I’m trying to pull chunks asynchronously from the my server. The chunks are being sent from the server asynchronously, but the requests for the chunk from the client are not, or at least behave in that manner.
I can prove the requests are jamming the GL thread because my loading screen at first sends all the requests for them (due to the pager requesting them all at once when I set the location to it for the first time). At that point the game freezes, and only becomes responsive once all requests have been sent and it starts receiving them. On a local version of the game (non-networked) using the same algorithms everything is nice and smooth, and I have removed the line where the chunks are added to the scene amongst other things to try to find any other cause. The only differences are that in the networked game is they are requested via a network state (local, same pc).
At first I presumed that sending 3-400 requests was causing a bit of a backlog, but during the game as I move around, it only requests 3 chunks at a time (the three chunks in front). The data is small, just 3 integers denoting the bitshifted grid position.
Any ideas on what I’m missing?