Undo info in TADS VM

Does anyone know what’s going on with undo() in the VM? I note that with a minimal .t3 file, you can undo at least 25 times. I’ve just recently noticed that my (huge, nearly-complete) game is now only allowing two undos! I assume it’s a memory constraint thing, because of the huge amount of game state to save in each version (not to mention half a billion <<one of>> and <<first time>>expressions)?
Am I out of luck there, or (I haven’t tried this yet) would trying to manually allot more memory to the interpreter help?

1 Like

Looks like the defaults are defined here: tads-runner/vmparam.h at master · tads-intfic/tads-runner · GitHub

An interpreter could be compiled with a higher limit, but it’s not something that a game could control from within.

The defaults could also be changed, we’ve done that for both Git and Hugo in the past, when larger games meant their undo systems were inadequate.

2 Likes

I’m really glad you posted this. The question of UNDO states in huge games popped into my bed with an amount of dread, because my game caches a lot of calculations. I was just thinking if enough UNDO states were made, it could be a significant memory burden.

It’s cool to know that the interpreter will adjust the UNDO state count accordingly.

1 Like