On 09.12.2016 09:43, Michael T. Pope wrote: > Actually I did not think the map display was calling canSee(), but it > does, albeit only per Unit, not per Tile.
hmm, what is that flag actually used for ? all the tiles a player can see (IOW: has been explored) or just changes in these tiles (eg. moving enemies, etc) ? > That would be a good place for > lock removal. AFAICT it is only contending with the main client thread > that is processing updates from the server, but I could be wrong there. my implementation only holds the lock while the visibility map is recomputed, so IMHO we should keep that lock there, just in case any other thread might cause that (IOW: calls canSee()). >> I've read some people reporting a boolean array faster than a BitSet > > I have seen code where it was actually measured. However, that was > several years ago in a Java version far away. New figures would be > convincing. BitSets are kinda case that calls for a heavy machine specific optimization, so I'd be surprised if they didn't invest more resources into that. Do we have some realistic workload example for a measurement ? >> (and ASF folks have an own implementation which they claim to be >> way faster than BitSet for *very large* sets). OTOH, Android folks >> (which are very concerned about optimizations) advice against such >> boolean arrays. > > I think it is memory consumption that the Android folks are (rightly) much > more worried about. More worried than us anyway (for now). Isn't there an android port ? > On the server side every Tile contains a map of Player to > player-view-of-the-Tile (Tile.cachedTiles). This is necessary so that if a > player sees some map feature (e.g. a settlement), then loses sight of it, > and then the feature changes (e.g. the settlement is destroyed), the server > still has enough information to continue to inform the player about the > *old* state of the tile, until such time as the player regains visibility > of the changed tile. Do we really need an extra hashtable for each individual tile ? Wouldn't it be even more logical to have one per player ? (by the way would make killing a bit less complex) >> Does the client only get explored tiles from server ? > > The client gets *everything* from the server. Unexplored tiles are > skeletal (just id,x,y IIRC), other tiles are either the current full > correct state of the tile including units (if visible to the player), or > the last view of the tile (if not visible). where does the ID come from and what it is exactly used for ? isnt the coordinates just enough ? --mtx ------------------------------------------------------------------------------ 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