OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

G2 Classic 1.1 mod: killed creatures resurrect

Open Nindaleth opened this issue 2 years ago • 8 comments

G2 Classic 1.1 mod download link: https://www.worldofgothic.de/dl/download_230.htm In G2_Classic.ini set Game=GOTHIC_EN and OU=OU_EN, otherwise the game will be in German.

Killed creatures appear not to be set as killed completely. They do give experience (on the first time only), they play the dying animation, but they can be killed again. If left alone, they'll just get up and go back to their thing.

Repro (on e70d3865): Kill the sheep outside the Xardas tower and wait for a few seconds. A funny repro is aggroing a wolf to Canthar, they then get into a sort of an infinite loop.

Nindaleth avatar Aug 26 '23 07:08 Nindaleth

Hi, @Nindaleth , thanks for report!

I'm assuming that this might be related to npc-rountines in general. Do you know, if the issue be reproduced without mod?

Try avatar Aug 26 '23 15:08 Try

It happens 100% of the time with the mod, while without the mod I've never seen it happen. Normally if you slay a sheep, it immediately deactivates as an attack target and you can loot its inventory - if you put away your weapon.

With the mod, after slaying it it still displays "Sheep", shows an empty health bar on the top and is normally targetable (making another attack will just repeat the dying animation), no looting is possible. Sometimes the dead body rotates and slides before the pose/animation is reset to the standard standing/walking one.

If I had to take a guess, I'd say some mod-provided script doesn't run completely.

Nindaleth avatar Aug 26 '23 19:08 Nindaleth

After investigating: engine was confused with content, and been running scripts in results, as-if it's G2notr

To workaround the issue, I've added -g2c command-line option

Try avatar Sep 16 '23 22:09 Try

On a quick test this resolved the issue, thanks @Try ! Do you plan to improve the solution in the future - should this issue stay open?

Nindaleth avatar Sep 18 '23 20:09 Nindaleth

Still have a dough on how exactly this part of engine suppose to work (from vanilla point of view). Difference for this case is behavior of ZS_Dead_loop. In G2-notr: func int ZS_Dead_loop() // return LOOP_CONTINUE In G2: ZS_Dead_loop is absent This signs that absence of *_loop mean infinite loop.

But, no! In G2-notr: ZS_GetMeat has no loop-function, yet expected to end immediately.

So engine now makes a split. Yet maybe we just missing something...

Try avatar Sep 18 '23 21:09 Try

Tested G2, there dead npc have state ZS_Dead_Interrupt. In NotR npc get same state if LOOP_CONTINUE is replaced by LOOP_END in ZS_Dead_loop.

thokkat avatar Oct 09 '23 14:10 thokkat

@thokkat hm, interesting

In NotR npc get same state if LOOP_CONTINUE is replaced by LOOP_END in ZS_Dead_loop.

Do I understood you right, that there is func void ZS_Dead_Interrupt() in scripts (and likely <state>_Interrupt)? Can't find anything of that in scripts...

Try avatar Oct 09 '23 21:10 Try

can't find anything of that in scripts...

Right there is no such state in scripts. This is what marvin G shows. I created these functions but they weren't used. Maybe some engine internal fallback state or the name shown is generic. If hero is revived with F8 state shown is _Interrupt. Probably one of the things that just worked so nobody noticed until NotR. At least this shows that no loop function existing means immediate end.

thokkat avatar Oct 10 '23 09:10 thokkat