New Static Scene for player and enemies #9703
Replies: 2 comments
-
Moving to discussion, as there is no concrete technical implementation provided. |
Beta Was this translation helpful? Give feedback.
-
This reminds me of some discussion on making a persistence system, something like this: The scene would have helper nodes that will take care of saving/loading the state of the scene, and spawning any additional nodes needed for that. You would have to configure these helper nodes to specify what parts of the scene would be persisted. Then you can call a method on them to take an snapshot and save it. And they will automatically load the last snaptshot on ready. We can also imagine this working with the multiplayer system (which already have the means to syncronize a scene across the network). But you could have local persistence without networking, and it might be an stepping stone for adding multiplayer to a geme. Anyway, I have seen people using PackedScene to store a scene before unloading it, so they can then instantiate the saved PacketScene when the player comes back. It is a "perfect" save... Kind of. It has issues:
But hey, easy to use. It seems to me that static scene idea would have some of these issues, since it would have to work without knowing what is worth saving... So it would save everything. My current solution is a combination of three things:
Hopefully this is food for thought for anybody who wants to make a generic version of such systems. |
Beta Was this translation helpful? Give feedback.
-
Describe the project you are working on
2D RPG Game
Describe the problem or limitation you are having in your project
when moving from scene to scene every child scene in the world scene gets reset. even the player
Describe the feature / enhancement and how it helps to overcome the problem or limitation
if one can make these child scene retain their state after leaving the scene then one enters to the scene they will have their properties not chanced after leaving the scene
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
having an option to scene to be persistent across all so it will not change when changing the scene
If this enhancement will not be used often, can it be worked around with a few lines of script?
you need to add a global script and have to configure it, have to be handle separately from the scene
Is there a reason why this should be core and not an add-on in the asset library?
it is a feature that will be used for most of 2D games and it will be very helpful and make the cording easiar
Beta Was this translation helpful? Give feedback.
All reactions