Hi
I seem to have ended up in the situation where I need 2 access mothods to my game objects. The game area (think oct tree) that contains the objects needs to access all of them in one game tick (server side collision detection), this is a longish running task (8ms processing on the client with 201 objects), whilst at other times, I want access to just a single object (when a player sends an update). If I make every object a managed reference, then the player updates are scalable, they access a fine grained object, meaning other objects can also be updated at the same time in other transactions. When I come to do my game tick, I really don’t want to do 202 separate database reads, followed by potentially 201 writes when the server dictates the results of the collisions. I would like the sector to read the whole thing in in one go, do it’s work, and write it. This requires less accessing of the db, which should improve performance in the case where I need every object (which I do here).
On the flip side, this would mean that each time I get an update from a client, I need to get the whole sector out of the store.
What happens if I stick a bunch of GameObjects in an array list in the sector, and have a managed reference to individual objects attached to the ClientSessionListener?, does it work?, does it provide fast access in both situations?
The alternative, is to queue client updates and process them when the sector tick happens, but I already have situations where the sector is read to send to new players, and by queueing player updates up, new players would be out of sync before they even started. This might not be such an issue though, as player updates are also sent on channels at mch higher frequencies, but these are treated in the client as advisory, not authorative.
Cheers
Endolf
) Maybe a ring buffer? I’m imagining that could be implemented in a similar manner… hrmm… may want to try that as an evening experiment some time soon…