Cogito World State - resource for consistency between levels #315
Replies: 2 comments 4 replies
-
This makes a ton of sense, and your approach seems logical. I have been simply adding my save and load dictionaries and functions within the cogito save state and scene manager scripts for my own variables, which makes it problematic when updating through version control. FYI, I had been saving nested dictionaries, which wouldn't be possible based on your limitation to Strings, bools and ints, in which case I would just stick with my original implementation. I think those three types are good though. |
Beta Was this translation helpful? Give feedback.
-
So folling up on this: Since the Cogito Editor tab brought more issues, this plan will have to change a bit as well. I'm thinking that only using a custom resource by itself would be easier to implement for now. Instead I'd structure it like this:
|
Beta Was this translation helpful? Give feedback.
-
Hey everyone,
I've encountered this in a different game recently and was wondering if this should be a built-in Cogito feature, something that I'm simply calling World State
Let's say you have two level scenes:
Headquarters_Interior
andHeadquarters_Exterior
. And then lets say in theExterior
level scene, there's lit up sign. In theInterior
level scene, there's a switch in the basement that cuts off power to the building. Now when you go back to theExterior
level scene, the sign should be dark, because the building power is off.My idea for this would be creating a
CogitoWorldState
class that's a custom resource that gets managed per save slot (similar toCogitoPlayerState
), except in this case, we don't know exactly what data the user needs to save.I haven't tried this at all, but in my head I'd approach it like this:
Create a tab in the Cogito Editor tab called
World State Data
Create a simple interface that lets the user create a new
WorldStateData
resource (.tres)Let the user add which kind of data/variables the WorldStateData resource can contain (keeping it maybe Strings, bools and ints )
Now in game runtime, if there's a WorldStateData present, it's contents gets saved/loaded as a state resource file as part of each save slot. My hope is that we can just write all variables present in the WorldStateData into a dictionary and then save/load that.
Thoughts, ideas, critiques?
PS: This would be for after the 1.0 release.
Beta Was this translation helpful? Give feedback.
All reactions