I’ve been recently thinking about networking, and I’ve realised what I could do is store the structure & texture of each object locally (or at least be sent from the server on initial connection). What I need to do though is once the server knows the location of the player, send all the objects within a rough area of the player to the player. This list updates every second or two, as the region can be reasonably large. I’m not sure how I make something like a quad tree to do this as I’m fairly new to JME3.
Quad trees with minimum split sizes degenerate into regular grids. Generally, it’s better just to go with the fixed size (potentially sparse) grid right from the beginning. Then determining a cell location is simple math instead of a tree traversal.
With optimizations of this sort, you generally want to take a cautious approach. Either allow objects to occupy more than one cell, or else place them by their centers and include extra adjacent cells in your search area.
@Ajnin123 said: I guessed that's how I might do it, my only concern being that some tiles will probably go into multiple chunks. What would I do then?
If sgold’s answer doesn’t give you what you need then I think I need to understand the difference between a tile and a chunk… because I would have used them interchangeably.