this post was submitted on 19 Oct 2024
1 points (100.0% liked)

Godot: The open source game engine

21 readers
1 users here now

A community for discussion and support in development with the Godot game engine.

founded 1 year ago
MODERATORS
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/BainterBoi on 2024-10-19 11:31:27+00:00.


Hey. I have an 2D-rpg in development, and implementing a proper save-system now.

I have read about many ways to go with it, and there seems to be few quite different options that get recommended:

  • JSON, like in Godot's tutorial.
  • Using PackedScenes - apparently quite error prone(?)
  • config files

Now, the JSON approach seems like a sensible way. However, I am thinking what is the "godot way" of doing this, especially when scenes consist of hundreds of objects that have tons of custom-resources added to them?

Let's take a simple use-case:

Each distinct map is a scene. Each map has many objects inside of them as a child nodes - enemies, interactables, loot-objects etc. Now, in map I have "transfers" to other maps that player can move on-to -> initiate map-change. Transfer-node's job would be simply to take current map, save the exact state of the map and load last-saved state of the target-map. This way, everything stays in different maps as player left them - couple simulated exceptions aside.

Now, we can imagine that every object in these map-scenes is quite complex. Enemies are a good use case - they have tens and tens of variables, including dozen or so custom-resources that further define multiple other fields that dictate how they behave. During development, new fields and features get added.

With all this in mind, my instinct is to go towards a solution that takes entire scene and saves it exactly as is. However, that seems to be adviced against it as scenes can introduce hard-to-debug problems(apparently?) and it is not too reliable etc.

Do you think there is some golden standard I should follow here that is often used in these kind of situations? What would be the best way to tackle this situation, so that saving is both reliable but also rather straightforward? I believe this is such a common problem that there has to be well-defined way to handle these. Especially with case where Nodes and Custom-resources are used extensively, which seems kinda encouraged in Godot's model?

Thanks for reading! Any advice is greatly appreciated!

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here