Twine Version: 2.3.5
Story Format: Harlowe 3.1.0
I am working on a game which may last long when played, like e.g. 1000-2000 passage visits.
I am worrying about the memory usage, because I read in other threads that:
>>Twine stores the state of all (global) variables for every passage-visit, such copying all variables for every step.<<
My Question: How can I limit the memory usage?
My thoughts so far:
Solution 1: Tell Twine, I have no use for a complete history of variable states. I am satisfied with having something like
- a history of visited passage names, like (history:) is described in Harlowe documentation,
- a 1-step undo (but I donât even need that).
Is there some way to achieve that?
Solution 2: Use only very few global variables (like $xy), but mostly local variables (like â_xyzâ)
Currently I canât do that, because local variables, defined in a passageâs gloabl space, are not visible within hooks in that passage. Such their use is so limited, that I almost never can use them.
Is there any work around for that?
An example why Solution 2 does not work for me:
â begin example â
(set: _options to (a: âHelloâ, âByeâ))
(set: _choiceIndex to 0)
⌠some passage text and interaction âŚ
(event: when _choiceIndex > 0)[(print: (_choiceIndex) of _options )]
â end example â
This gives two error messages, because _choiceIndex and _options are undefined within the hook.
Any help or ideas are very welcome.