jlothamer

joined 1 year ago
[–] jlothamer@programming.dev 1 points 8 months ago

I've thought about this problem creating a system to save game state. The issue with assigning a UUID works until you have dynamic scenes added to the game at runtime. The nodes in those scenes will all have the same UUID. In the end I ended up just using the paths and saving the fact that the scene that data is being saved for is dynamic. Then the system sees this and re-instances the scene and adds it back to the tree. (A slight adjustment to the path must be made as Godot will create nodes with the at (@) symbol in them, but you can't do that yourself.)

You can see this in action at my demo repo on github.

64
submitted 9 months ago* (last edited 9 months ago) by jlothamer@programming.dev to c/godot@programming.dev
 

If you ever wanted to make a game using visibility masking like the classic horror survival game Darkwood, then this demo is for you! In the readme I go over how it works as well as some pitfalls I've found along the way.

If you have any issues or feedback for the demo, please let me know. Thanks!

Godot 4 Visibility Masking Demo on Github