I’m finding myself doing a lot of synchronization in the game mode. First I wait for the players to receive their states, and they report to the gamemode when done. Then I wait for them to spawn their pawns, and those report to the gamemode when done. Then I wait for them to finish loading the world, and they report to the gamemode when done. Then I wait for them to spawn the dynamic actors together, and they report to the gamemode when done.
Point being: I’m doing a lot of “report to the gamemode when done” and the gamemode is keeping a lot of lists of “these players have pawns, these players have the world loaded,” etc. When all the lists are full we start the game.
My other approach is to have each player run a state machine and to keep track of the lowest state any player is at, then I can advance the game when all players reach the same state.
Is there a more elegant solution to this that people are using? What kinds of patterns are people using to get the peers all on the same page?