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

Game Crashes When AI is Defeated in Campaign #432

Open
Tealdragon204 opened this issue Aug 14, 2023 · 9 comments
Open

Game Crashes When AI is Defeated in Campaign #432

Tealdragon204 opened this issue Aug 14, 2023 · 9 comments

Comments

@Tealdragon204
Copy link

Can't pass the third mission for humans in the campaign because the game crashes once I destroy the town hall. I am using the GOG version of the game

@timfel
Copy link
Member

timfel commented Aug 14, 2023

I assume you are on Windows? If you can share stdout.txt and stderr.text and any crash.dmp file in the stratagus folder that you might have, that would help

@Tealdragon204
Copy link
Author

Windows, no files like that in the installer version. Tried portable, glitch doesn't seem to occur in portable and is exclusive to the installer which didn't have any of those files

@timfel
Copy link
Member

timfel commented Aug 15, 2023

Windows, no files like that in the installer version. Tried portable, glitch doesn't seem to occur in portable and is exclusive to the installer which didn't have any of those files

The installer version stores such files in %AppData%/Stratagus or Documents/Stratagus. Could you check?

@Tealdragon204
Copy link
Author

stderr.txt
stdout.txt
https://drive.google.com/file/d/1nyNjR28RbOlAHgtnjaJw-c-fkAUfNvHD/view?usp=sharing

Should be all the files. This time it happened on the Portable version but much later on into the game

@timfel
Copy link
Member

timfel commented Aug 15, 2023

Thanks, the crash.dmp helped. Just posting here the data for reference:

   Parameter[1]: 00000030
Attempt to read from address 00000030

PROCESS_NAME:  stratagus.exe

READ_ADDRESS:  00000030 

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  00000030

STACK_TEXT:  
00f4f54c 00adae58     00f4f580 00b68074 00d9d1c8 stratagus!AiCheckUnits+0x99
00f4f554 00b68074     00d9d1c8 03b744a0 00000000 stratagus!AiEachSecond+0x78
00f4f580 00b6501a     00000000 e2c329ed 00019b1a stratagus!PlayersEachSecond+0x154
00f4f5d4 00b653c2     e2c32a19 03b744a0 00b09eb0 stratagus!GameLogicLoop+0x12a
00f4f620 00afc6b0     e2c32aa1 154bf049 0126e2e0 stratagus!GameMainLoop+0x222
00f4f698 00c0ad16     00f4f6d0 0130ba01 0126e2e0 stratagus!StartMap+0x220
00f4f6f8 6c018c7a     0126e2e0 0130baec 00f4f864 stratagus!tolua_stratagus_StartMap00+0xe6
WARNING: Stack unwind information not available. Following frames may be wrong.
00f4f70c 6c029bb2     0126e2e0 1548ea48 ffffffff lua51!lua_setlocal+0xe8a
00f4f7d8 6c018814     0126e2e0 00000004 0126e2e0 lua51!luaopen_table+0x2742
00f4f7e8 6c0110f2     0126e2e0 1548e998 00000000 lua51!lua_setlocal+0xa24
00f4f7f8 6c018d62     0126e2e0 00f4f8ac 00000000 lua51+0x10f2
00000000 00000000     00000000 00000000 00000000 lua51!lua_setlocal+0xf72

STACK_COMMAND:  ~0s; .ecxr ; kb

FAULTING_SOURCE_LINE:  C:\projects\stratagus\src\ai\ai.cpp

FAULTING_SOURCE_FILE:  C:\projects\stratagus\src\ai\ai.cpp

FAULTING_SOURCE_LINE_NUMBER:  202

This is here: https://github.com/Wargus/stratagus/blob/c57ec097b3563de34ef05c84e6b152f5ab5eaea3/src/ai/ai.cpp#L202

I'm not actively developing on Stratagus atm, maybe @Jarod42 has an idea.

@Tealdragon204
Copy link
Author

Thanks! Would greatly appreciate it. I remember my dad playing this game as a kid and wanted to try it but I found the vanilla version to clunky and was having a blast with this mod until the crash. Would love to see it in working order

@timfel
Copy link
Member

timfel commented Aug 16, 2023

@Tealdragon204 the way to get past that is to cheat into the next level. In any mission, press return, type "corwin of amber" and hit return. this enables cheats. then again press return, type "human4" and hit return again. This way you'll unlock the 4th human mission in the selection screen

@timfel
Copy link
Member

timfel commented Aug 16, 2023

   Parameter[1]: 00000030
Attempt to read from address 00000030

The source line is const unsigned int t = AiPlayer->UnitTypeRequests[i].Type->Slot;. The offset we're reading from NULL is 0x30. The UnitTypeRequests is later in the PlayerAi class, so I don't think AiPlayer is NULL here. AiRequestType seems too small to have such an offset. So we get to the Type field that we're reading Slot from. Slot seems from the source like it could end up at 0x30 offset, so my best guess is we're dealing with a request that has a null type for some reason. This line looks a bit dodgy: https://github.com/Wargus/stratagus/blob/96ba028dfdc7ef8ba72bd161c5fd9a9ced45562a/src/ai/script_ai.cpp#L908C48-L908C48 type was not NULL before, but could it become NULL here?

@tomexplodes
Copy link

tomexplodes commented Apr 7, 2024

Just want to add that I also have this issue, except with the Orc campaign mission 3, extracted from the actual CD, with the portable stable release. Here are my files:
crash.dmp
stderr.txt
stdout.txt
War1gus-extraction.log

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