Rematch not loading the players to the same game instance
Author: Jairo Manon
The issue was more on the how both players were loading the level. From the several tests I have made with the replication problem, I've found that when it comes to replication, the user interface always messes it up because of how it's being handled in the background. As a solution, I made a system for the UI to talk with the game instance and made it to reload the level through there by doing a server travel. I later fixed the UI and the logic for it to wait for the consent of both players to start the game again by having a counter on how many players are ready and checking if one of them has left the game to load the main menu for the other.
A current problem that kept happening on our game loop was that both players weren't loaded to the same game instance. Whenever one of the two players did win, they couldn't exactly select the rematch option because at the backend, they weren't loaded to the same level. Even worse, only the player with authority could actually decide to start the rematch instead of it being a mutual decision. Whenever the client wanted to rematch the other player, it would be loaded back to the main menu.
The issue was more on the how both players were loading the level. From the several tests I have made with the replication problem, I've found that when it comes to replication, the user interface always messes it up because of how it's being handled in the background. As a solution, I made a system for the UI to talk with the game instance and made it to reload the level through there by doing a server travel. I later fixed the UI and the logic for it to wait for the consent of both players to start the game again by having a counter on how many players are ready and checking if one of them has left the game to load the main menu for the other.
Comments
Post a Comment