Hi. I’ve been using some events and variables related to cooldowns in game instance to prevent player from resetting cooldowns on level change. However when I was just doing some researching I read things about events and variables in game instance are not actually suitable for multiplayer. Well, the multiplayer system I want to implement is simply a 1v1 match with another player on a single level, ends when one of players are destroyed. To fix this problem, I thought to check when player gets out of singleplayer and joins a match, then using cooldown calculations inside player blueprint since there will be no level change, but I don’t know if this is possible. So is there any ideas on how I use game instance variables and events for multiplayer ?
When joining a multiplayer sesion the map is reloaded so its the same as if you where changing levels.
There is no issue with you storing data on the game instance before moving to a new map. The problem is that the data cannot be replicated from it. What I would do is store the data in the game instance and read it once the new map is loaded (or after joining a multiplayer session). By reading the info I mean copying it to a replicated class, like the player state (which is where you want this kind of stuff to be if your intention is for it to be visible to other players).
So:
- By default have all that data on the Player State
- If moving to a server or another map copy to the game instance
- Copy back to Player state once migration is done
This is what Unreal Tournament does for cosmetic character customization.