Re: siege
"Jonadab the Unsightly One" <[email protected]> 12 Aug 2005 23:04:03 -0400
| Newsgroups | gmane.games.freeciv.general |
|---|---|
| Message-ID | <[email protected]> |
Sam Steingold <sds-mXXj517/[email protected]> writes: > > For each square being considered, each friendly unit that can > > reach the square must be compared to each enemy unit that can > > reach the square. > > not really - the best offensive enemy unit has to be compares to the > best defensive and the best offensive friendly unit. this is O(n > log n) But how do you determine the best defensive and offensive friendly unit that can reach the tile, or the best offensive enemy unit that can reach it, for that matter, without iterating over all of the active units? And it's not just all of the ones that can reach the tile, because to determine that you really have to iterate over *all* of them. And furthermore, the way you previously described the "all out war" had unit after unit in simulated fights until all the units that could reach the tile would be exhausted. I quote: the probability is computed by applying the standard "Probability 101" formulas by playing out battles between the best units one by one. E.g.: suppose a coastal tile can be reached by one player's "warrior" unit, and the enemy has a battleship and a cruiser at distance 3 from the tile. Suppose the probability of battleship winning against the warrior is 0.9 and the probability of the cruiser is 0.8. Then tile availability is 0.1*0.2 = 0.02 [not taking damage into account]. How is that only O(n log n) when you do it for every tile within the work radius of every city in the game? -- $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/