Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to persist runner state #1

Open
mapto opened this issue Jan 7, 2022 · 3 comments
Open

Need to persist runner state #1

mapto opened this issue Jan 7, 2022 · 3 comments

Comments

@mapto
Copy link

mapto commented Jan 7, 2022

Hello,
I'm participating in the Interact-IF jam. My team decided to use yarn, and I'm now trying to make a python web-based storytelling app.

My current challenge is that I need to preserve state across web requests. One naive option is to memorise the state as a sequence of player choices and re-run the narrative up to the current point. Clearly, this is suboptimal, even if the story is deterministic (not sure for how long this would be a given in a storytelling context).

A better solution would be to be able to initialise the runner with an optional state. Clearly this would not only be a node, but also variables, etc. I'd appreciate a comment on whether such an approach is consistent with your vision and wouldn't mind giving it a try aiming for a pull request.

Thanks a lot!
Martin

@weaversam8
Copy link
Member

weaversam8 commented Jan 7, 2022

Yes, I see the value in something like this! I also agree with you- initializing with a state is better than passing a sequence of choices... There's no guarantee a story is non-deterministic.

Open to a PR for sure!

Also, I'm not sure if something like this exists in the C# or Unity APIs for Yarn, but if it does, we should do our best to mimic the pattern they use there.

Edit: after a quick search, I don't think anything like this exists in the Unity integration, beyond just controlling variable storage. We'll want to roll our own then. Probably a simple save / load paradigm.

@josefalanga
Copy link
Contributor

Hello there @mapto. Do you have plans of continuing the work on the PR? Do you need help?

@mapto
Copy link
Author

mapto commented Oct 30, 2023

Hello! I'm sorry, but I am not going to work on this anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants