Summary
In this chapter, we learned how to optimize data requests in our game to improve network performance. We focused on decreasing the number of requests being made in the game by optimizing the firing of the weapon. We saw how to create an RPC method that can change the weapon’s firing state and how to toggle the firing state based on the “shoot” action being pressed or released instead of triggering the firing on every frame in the _process()
callback. Finally, we saw how to use the network profiler to assess the impact of these optimizations on the game’s performance.
After that, we tackled the issue of Asteroid
node’s MultiplayerSynchronizers’ syncs. We disabled the automatic synchronization by setting the Visibility Update Node of MultiplayerSynchronizer
to None and manually synced by using the MultiplayerSynchronizer.update_visibility()
method once the player joins the game. This decreased the Asteroid
node’s sync count...