Open osse101 opened 10 years ago
Awesome, @osse101! Thanks for getting the discussion started here :)
- Rewrite offline scripts to use references instead of assuming they are attached to the correct gameobject. This step is up for some debate.
- Rewrite online scripts to use the same player references used by offline and break networkVariables into only Network variables.
Ideally these two steps would see the merging of such scripts so that there was no longer duplication for online and offline modes.
- Rewrite offline scripts to use references instead of assuming they are attached to the correct gameobject. This step is up for some debate.
- Rewrite online scripts to use the same player references used by offline and break networkVariables into only Network variables.
@Cheeseness This would actually be duplication of work and should be called a merge, as you said. Updated my first post to say as such.
- Create a place to hold references to all player game objects (like PlayerInfo but with less Network)
The PlayerInfo class should work for offline since you can just ignore the online-only bits.
- Remove NetworkObject from level_full and put it and netLobby on the onlineMatchLobbyScreen.
I'll work on moving the netobj into the main menu and loading all it's settings from the config file when I get back.
This is going to be a hell of a headache, but it needed to be done sooner rather than later, so glad to see work on it has begun! In regards to this point:
Rewrite online scripts to use the same player references used by offline and break networkVariables into only Network variables.
In my mind, what's needed is a generic PlayerManager type layer that can work across modes (which is what networkVariables more or less does now, but only for online games), and then a generic GameManager that can do networkObject's work for online across offline and online (i.e. world loading, and also potentially game state stuff).
As for PlayerInfo, I agree with @bobsayshilol that it can be used perfectly fine for offline as well (in fact, in the current implementation I create PlayerInfo objects for local ball markers) - the data inside PlayerInfo just needs to be properly created and managed (which networkVariables does currently for online, and a generic PlayerManager would hopefully do).
Anyways, I think what I've described is more or less what you have in mind anyways. Are these changes still in the planning stages or being currently implemented?
Ah yes I've started moving the code over - I want to say it's almost done, but if I do I'll find a bug and be stuck on it for a while. The current implementation follows similar ideas:
A GameManager hasn't been implemented yet, but I assume that's just for offline script loading since that's all the networkManager scripts?
Sounds like you've made fantastic progress!
A GameManager hasn't been implemented yet, but I assume that's just for offline script loading since that's all the networkManager scripts?
What you describe your rework of networkObject as is more or less what I imagined GameManager being - basically, something to manage all the objects and data that is consistent between offline and online.
Anyways, can't wait to check out how it all works when it's in!
I didn't get around to adding a PlayerManager class, but other than that it's all there now.
What you describe your rework of networkObject as is more or less what I imagined GameManager being - basically, something to manage all the objects and data that is consistent between offline and online.
Ah good to hear we were both on the same page then :smile:
Here's my view of what things should move towards
Firstly, I feel everything should be ripped from level_full and level_full_local_multi except for the level specific content i.e. lighting, course, flag, environmental. That'd give us a single scene that can be populated with either online/offline players. In this scenario, players/carts/customization/network connections would have already been decided in the preceding lobby menu and the level scene would start by positioning objects at their spawn points, dividing the screen into player cams, and the general stage start sequence. And put a controller script on players to manage state change between menus, pre-level, level, and post-level.
Edit: To clarify the end state after these changes: Shared prefabs for offline/online Levels are runnable by either offline/online. 1 of each script with local/network handling as needed