Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

A way to save the state of the timeline #45

Open
AnidemDex opened this issue Feb 27, 2022 · 2 comments
Open

A way to save the state of the timeline #45

AnidemDex opened this issue Feb 27, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@AnidemDex
Copy link
Owner

Describe the project you are working on

Event System

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Sometimes you want to save the state of the event manager between game sessions. Sure, saving it manually can works, but why forcing the user to deal with complex things when we can make a helper class for that?.

The idea is to create a class that stores the state of the EventManager, and a function in event manager that takes that resource to continue doing its stuff.

extends Resource
class_name EventManagerState
var last_timeline:Timeline
var last_event:Event
# in EventManager
func resume(data:EventManagerState):
    # continue doing stuff

This only makes sure to continue with its own stuff, it doesn't care about other data (like, the state of the scene tree)

Adittional information

No response

@AnidemDex AnidemDex added the enhancement New feature or request label Feb 27, 2022
@Crystalwarrior
Copy link
Collaborator

Saving timeline/event resources directly is sub-optimal because that leads to inconsistent file sizes that vary depending on the complexity of the timeline.
What has to be saved, instead, is just the last_event, and the next_event references.
The problem is those references have to be unique and always refer to that specific event. Not only that, the game developer should be able to change and edit things about those events, timelines, etc. - for example, if the event text changes between game sessions, that should be reflected on the event.
I think saving resource paths might be ideal. If those resource paths change, the developer would then take responsibility to migrate those save file resource paths, but it's much easier to deal with than having to deal with saving direct resources.

@Crystalwarrior
Copy link
Collaborator

Crystalwarrior commented Feb 27, 2022

Btw if we can create a migration system for that developer so they don't have to do this themselves it would actually help a lot, I want transferring saves between game versions to be as painless as possible. Though I understand if the developers reorganize where their timelines are located for some reason it might just be out of our hands at that point.

@AnidemDex AnidemDex added this to the 2.0 milestone May 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants