feature/save_and_loaaaaaad #32

Merged
kziolkowski merged 18 commits from feature/save_and_loaaaaaad into develop 2025-11-26 14:41:29 +01:00
Owner

Implemented and reworked the Save structure based on our first use cases and some pointers from the chat.

General:

  • Split the save system into two parts: Settings and User Data.
    • Settings are for local stuff like window size, sound settings and so on.
    • User Data is for game saves that will later be synced via the Steam Cloud (already set up via the folder structure).
  • Added Versioning to the save data that isn't hooked up for now but will be helpful when migrating in the future
  • simplified the save structure to a simply "id - string payload" matching to make it easier to maintain and debug
  • found a way to use Guids for saving: I'm adding a Metadata entry to the top node of each saveable prefab scene and add it to a group called "Saveable". Then in the containing scene, I run a tool node that iterates over all instances in this group and auto-generates the ID where necessary. Needs to be updated manually, but works fine so far.
    image
    image
    image

Use cases implemented and synced via save (triggers on scene transition / restart):

  • Field and plant states
  • duck states
  • inventory state
  • item pickup state (both unique items and collectable ones)

Known issues:

  • The first run (when there is no save file yet) sometimes still triggers some ominous error messages. Could not repro last time I checked, but I cannot say for sure if it's gone for good.
  • There is still some cleaning up (todos) to do in the InteractionArea script, but that's something for another PR
  • Also there are still things we need to sync like player position, last scene loaded, dialogues played etc, but these will be added in the next batch
  • Also there are some known bugs with the current state of the dialogue system as a whole (looping, random triggers etc.) which will also be addressed in a different PR
Implemented and reworked the Save structure based on our first use cases and some pointers from the chat. General: * Split the save system into two parts: Settings and User Data. * Settings are for local stuff like window size, sound settings and so on. * User Data is for game saves that will later be synced via the Steam Cloud (already set up via the folder structure). * Added Versioning to the save data that isn't hooked up for now but will be helpful when migrating in the future * simplified the save structure to a simply "id - string payload" matching to make it easier to maintain and debug * found a way to use Guids for saving: I'm adding a Metadata entry to the top node of each saveable prefab scene and add it to a group called "Saveable". Then in the containing scene, I run a tool node that iterates over all instances in this group and auto-generates the ID where necessary. Needs to be updated manually, but works fine so far. ![image](/attachments/baee9c14-0c04-4671-88b6-741cfea5ce00) ![image](/attachments/4533d422-c982-4116-8782-fe0077f5f4cd) ![image](/attachments/07c0d5a3-054d-403a-8dd2-c06d333b83fa) Use cases implemented and synced via save (triggers on scene transition / restart): * Field and plant states * duck states * inventory state * item pickup state (both unique items and collectable ones) Known issues: * The first run (when there is no save file yet) sometimes still triggers some ominous error messages. Could not repro last time I checked, but I cannot say for sure if it's gone for good. * There is still some cleaning up (todos) to do in the InteractionArea script, but that's something for another PR * Also there are still things we need to sync like player position, last scene loaded, dialogues played etc, but these will be added in the next batch * Also there are some known bugs with the current state of the dialogue system as a whole (looping, random triggers etc.) which will also be addressed in a different PR
kziolkowski added 18 commits 2025-11-25 18:00:54 +01:00
kziolkowski requested review from Jonathan 2025-11-25 18:01:40 +01:00
Jonathan approved these changes 2025-11-25 19:21:15 +01:00
Jonathan left a comment
Owner

Nur eine kleinigkeit

Nur eine kleinigkeit
@@ -18,6 +17,7 @@ public partial class InteractionArea2D : Node2D
[Export] private int _id = -1; // TODO: remove
private Material[] _backupMaterials;
private int _interactionCounter;
Owner

Is this ever used?

Is this ever used?
Author
Owner

good catch, this is residue from an attempt at serializing the InteractionArea, which we won't do. So I'm deleting this now.

good catch, this is residue from an attempt at serializing the InteractionArea, which we won't do. So I'm deleting this now.
kziolkowski marked this conversation as resolved
kziolkowski merged commit 451ea82706 into develop 2025-11-26 14:41:29 +01:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Jonathan/Babushka#32