Hi everyone,
I'm working on a multiplayer game project and I'm looking for some advice on how to manage data persistence between scenes. Here's a breakdown of what I'm trying to achieve:
So, first, some context, I have two main scenes: a lobby scene where players can choose their loadouts, roles, and select levels, and a main game scene where the actual gameplay happens.
This thing is, I need to persist certain information (like player choices) between these scenes.
Right now, there's no system in place that outlives a scene. Game objects and gameobjectsystems are tied to the scene's lifetime.
I'm aware of the `DontDestroyOnLoad` flag, but it feels a bit hacky and I'm not sure if it's the best approach for a clean architecture.
So
- What are some good patterns or best practices to achieve data persistence between scenes in a multiplayer game? / How would you handle the transition of player data from the lobby to the main game scene?
And
- If I want the persisting information to be networked, how should I approach this?
- Does the `DontDestroyOnLoad` method handle networked data, or are there better alternatives?
I'd appreciate any insights or experiences you can share. Thanks in advance for your help!
I'm working on a multiplayer game project and I'm looking for some advice on how to manage data persistence between scenes. Here's a breakdown of what I'm trying to achieve:
So, first, some context, I have two main scenes: a lobby scene where players can choose their loadouts, roles, and select levels, and a main game scene where the actual gameplay happens.
This thing is, I need to persist certain information (like player choices) between these scenes.
Right now, there's no system in place that outlives a scene. Game objects and gameobjectsystems are tied to the scene's lifetime.
I'm aware of the `DontDestroyOnLoad` flag, but it feels a bit hacky and I'm not sure if it's the best approach for a clean architecture.
So
- What are some good patterns or best practices to achieve data persistence between scenes in a multiplayer game? / How would you handle the transition of player data from the lobby to the main game scene?
And
- If I want the persisting information to be networked, how should I approach this?
- Does the `DontDestroyOnLoad` method handle networked data, or are there better alternatives?
I'd appreciate any insights or experiences you can share. Thanks in advance for your help!