Skip to content

Restore Ikarus runtime bindings after loading a save - #987

Closed
Solessfir wants to merge 1 commit into
Try:masterfrom
Solessfir:restore-ikarus-after-load
Closed

Solessfir wants to merge 1 commit into
Try:masterfrom
Solessfir:restore-ikarus-after-load

Conversation

@Solessfir

Copy link
Copy Markdown
Contributor

Loading a save restores script variables but leaves Ikarus's transient parser and engine bindings uninitialized.

Reproduced with Archolos: dialogue and facial-animation calls work in a new game, then fail after saving and reloading with MEM_GetFuncID: Unresolvable request and an out-of-bounds access to MOB_CREATEITEMS.PAR1.

Call MEM_InitAll after restoring variables and HERO, only for scripts using Ikarus. This does not rerun gameplay initialization, reset NPC routines, or change the save format.

Verified on Windows using the same save and AI_ResetFaceAni call before and after the fix. The call failed before and completed without those errors afterward. Windows and Android ARM64 release builds passed on the development branch before extracting this fix.

@Try

Try commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Hi, @Solessfir !

Thanks for PR, but I will have to reject it for now. There is no software design on save/load in DMA environment yet. One option is to do same as in regular games: stash whole memory state and transparently restore it on load. Other one - make it dirty to respect Ikarus API to work with archives.

Either way - it's probably too early to start on it, as first priority would be to have DMA work cleanly in use-cases without save/load. Part of it will include: implement reinterpret_cast, develop unit-tests, custom-compiler (for test scripts).

@Try Try closed this Sep 12, 2026
@Solessfir
Solessfir deleted the restore-ikarus-after-load branch September 14, 2026 06:33
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

Successfully merging this pull request may close these issues.

2 participants