You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been thinking about adding the ability to run multiple simultaneous games at once in a single server. The server should have the capability to move players between games, and the player lists, chat and all game state will be separate for each game. There's actually one feature in the HQM protocol that makes it easier to reset state when moving players between games.
Plenty of technical issues need to be fixed:
Currently, pretty much all code is run in a single Tokio task and is therefore single-threaded. For this feature to work, we're going to need at least one Tokio task per game.
Player session handling needs to be rewritten to ensure that messages are handled by the correct game instance
Some data will have be shared between tasks, so we need to add a lot of mutexes and/or channels to the code.
Right now, the physics-heavy game loop is done in the same Tokio thread as all the I/O stuff. This will be an issue if we run multiple games in a server, as the game loop may starve the I/O code. We need to move as much of the game loop as possible into a different non-I/O thread. The easiest option would be tokio::task::spawn_blocking or tokio::task::block_in_place, but rayon::spawn could also be considered.
The text was updated successfully, but these errors were encountered:
I've been thinking about adding the ability to run multiple simultaneous games at once in a single server. The server should have the capability to move players between games, and the player lists, chat and all game state will be separate for each game. There's actually one feature in the HQM protocol that makes it easier to reset state when moving players between games.
Plenty of technical issues need to be fixed:
The text was updated successfully, but these errors were encountered: