<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39845 >
William Allen Simpson wrote: > <URL: http://bugs.freeciv.org/Ticket/Display.html?id=39845 > > > Jason Dorje Short wrote: >> A triple-loop is also rather tedious (possibly too slow with a very >> large number of old cities in the game). A simpler loop is possible if >> we make border assignment context-based and impose the restraint that >> borders can expand only one tile per turn. >> > Four (4) passes over the number of tiles, instead of one (1) pass over > the cities? That's tedious? > > This is some new use of the word "tedious". What I found tedious was > trying to read 900+ ->owner uses (in two branches simultaneously) to find > the ones that were assignments instead of references.... > > In the computing point of view, by definition the number of cities is > always less than the number of tiles, by orders of magnitude. Perhaps. But consider the worst case, where there are a large number of high-culture that are spaced closely together (is there a limit to how far city influence can extend?). In this case you could end up iterating over every tile many, many times. And this case, rare as it is, is exactly the one that we should be concerned about since maps with no cities have no problem with computation time anyway. Oh and by "tedious" I meant for the CPU, not the coder. Bad choice of word perhaps. > The context-based borders are not "simpler" in any computational sense, > because the execution is data dependent and therefore harder to debug! Ya. >> The hard question is what to do to a unit/fortress/city when the tile >> under it gets reassigned. This part will end up being more coding >> (though less argument) than the borders changes themselves. >> > No new code necessary. > > A unit reassigned converts to the new owner, attacks, or leaves. So you give the unit one turn to attack or leave or it gets converted on the following turn? What if it is entirely surrounded by the newly-claimed non-allied tiles and cannot get away in time? Is that going to be a common scenario? > An occupied fortress cannot be reassigned. An unoccupied fortress has > no border/vision of its own. > > A city cannot be reassigned. It *should* be able to be "converted", by > proximity to a superior civilization, at which time it self-reassigns. Can a fortress be converted? > Vision in fits and starts with little carved out discontiguous blocks > (see the picture) just isn't workable (and is annoying in practice). Somehow I missed seeing the picture. But if you're talking about granting vision to everything within borders, it follows that you want contiguous borders, yes. How will your system deal with ocean? Is that just included in the factor() function that assigns tile influence based on the city's culture? > And I actively dislike the idea that buggy savegames won't be fixed until > some gradual and unpredictable evolution.... > > That's what I'm trying to redesign. Okay. -jason _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev