Storing Variables in Multiplayer over multiple maps

Hello guys, happy Easter

I have a lobby map in my multiplayer game and for balancing and testing purposes i have a huge amount of changeable variables there. However after using servertravel those variables are only available for the host and not for the clients.

Im currently storing them inside the Game Instance but apparently there is a problem with storing them there. It doesnt work no matter if I use replication or not. Also the clients do get the same instance when they request it, only the variable is empty. Since the values are there on the server i can assume that parsing the values from the UMG into the Game Instance itself is working.

Does someone have a good way of dealing with this?

By the way i used the game instance because to my knowledge that is the only place where data would survive servertravel or a map change in generell

Hi, game instance persists during level changes, so it makes sense to put variables there you want to persist throughout multiple maps. The game instance exists only locally though, so it does not replicate (replicated variables and things like RPCs e. g. RunOnServer, Multicast won’t work there, since it does not replicate). So you can store your variables there, but if you want the server to tell the clients something about those variables, then you will need to do so from an actor that does replicate and exists on all clients. So recreate the variables you want the server to share with the clients inside that replicated actor (ofc you will then need this one in every of your levels, you could use GameState though) and then set them from the server whenever you make a map travel. Then clients can access them from that replicated actor.

Thank you for your answer ! It makes sense that it didnt work when i wanted the clients to get information from the hosts game state.

So lets assume the hosts set the basic player movementspeed in the lobby map and that gets saved on his game instance before level change. Then after level change the game state could get those information from the host right? How would the game state now which players game instance is the correct one?

Also the clients kinda need information on Begin Play since it affects basic things like movement. Also a lot of map actors use this value in their begin play, how can i make sure that they are not too fast? Would a delay of 0.2 seconds or so be enough to guarantee that the game state can catch up?