On Fri, 9 Dec 2016 00:28:29 +0100
"Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net> wrote:
> I'm currently reworking the (per-player) visibility map, by
> a) doing it (mostly) lockless
> b) using BitSet instead of the huge boolean array
> c) encapsulating the whole logic into an own class

(c) is obviously a win in terms of making things easier to read.  The other
two are nice, but I doubt the existing locking is a serious problem, and
equally doubt that there is a huge win in going to a bitset.  Can you
benchmark the bitset change?  I have seen cases where it was slower.

> As it obviously needs the map dimensions (coming from the Map
> object), I'm wondering whether these dimensions can change -
> or the map object being replaced - after a player is initialized

The map dimensions should be fixed after the game is generated.  Note
though that the Game (and thus Map) gets replaced on reconnect (trunk is
currently broken due to this:-).

> (dont wanna call getGame().getMap() all the time)

I doubt there is much choice.  I recommend just calling it once at
the top of major routines.
 
> By the way: I'm a bit confused by Tile::isExplore() ... is that
> method only valid on client side

Correct.  The type will always be non-null on the server side, but
exploration is only meaningful with respect to a European player.

> assuming a Tile instance is
> only used within context of a specific player ?

Not sure what you are saying there.  Beware of Tile.  The whole cached
tile structure confuses me regularly and I wrote it.

Cheers,
Mike Pope

Attachment: pgpjhFDRlhBvX.pgp
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to