Our game design has the following requirements:
-
A match consists of a number of rounds, whether another round will be started will be determined at the end of the previous round.
-
The level should be reset in between rounds, everything cleaned.
-
Some data should persist across rounds, probably in GameState and PlayerState.
-
Music should not be interrupted or reset when transitioning to a new round.
Is there a way of accomplishing all of the above?
Optimally I would like a way to keep GameState, PlayerState and playing music over level loads.
GameInstance can be used to persist data, but it seems pretty hacky to have to save the GameState and PlayerState to it manually and load it back at the beginning of another round, and I’m not sure it would keep music playing.
I’ve looked at level streaming as a solution and that seemed promising. I could create a “Master” level to be persistent, play music, gamestate and playerstate always loaded in that, and unload/load a sublevel when a new round needs to be started. The issue is that nearly every single Actor spawned during the game should be tied to the sublevel so that it’s cleared when a new round is started.
Another option is somehow utilising SeamlessTravel and GetSeamlessTravelActorList to maybe keep GameState and PlayerStates over level load, but I have absolutely no idea how that would work.
Also networking is no concern, local multiplayer only for now.
So far level streaming seems like the best choice if I can find a way to spawn actors inside the sublevel.
Any thoughts?