Try / OpenGothic

Reimplementation of Gothic 2 Notr
MIT License
1.16k stars 85 forks source link

Bow damage and accuracy suddenly became ridiculously low #669

Closed sixers closed 3 months ago

sixers commented 3 months ago

Describe the bug Suddenly my bow damage and accuracy got really low, like way worse. Noticed it after I escorted Bilgot. Nothing crashed.

Save-game/Log-file/Screenshots/Video If applicable, add screenshots or save-game file to help explain your problem. Screencast: screencast.mp4 Save: savegame1.zip

Application log If relevant attach log.txt file or, in case of game-crash, crash.log

YALdysse commented 3 months ago

I have the same problem. My accuracy has only greatly decreased. I can't say why this happened.

OS: Linux Mint 21.2 OpenGothic: 1.0.2769 (commi 4cc9d5a)

Try commented 3 months ago

Hi, @sixers and thanks for report!

I've looked inside savegame1.zip provided; it seem to be a save not from opengothic, but from vanilla: изображение

For context: OpenGothic writes saves in same folder, where executable working directory - can you please check there and provide correct save? Thanks!

sixers commented 3 months ago

@Try Apologies!

It this one correct? save_slot_1.sav.zip

Try commented 3 months ago

It this one correct?

Yes, thanks! I've checked the save: your's hero base damage is -190 somehow. This might indicate that unequipping of bow (95-dmg) was calculated multiple times, instead of one at some point.

Since it's hard to track down when/how it's happen - I've added an assertion for negative damage values and refactor state-tracking a bit to be more robust. And next time assert, hopefully, will trigger as soon as error happens.

Unfortunately can't fix the values automatically, theoretically negative damage can be a thing caused by the script, so here is a save(quick-save slot), where I manually edit hero state: save_slot_0.zip

sixers commented 3 months ago

Thanks! Works for me!

Since it's 2*95, I have a hunch about what might have caused it. I upgraded the Beliar sword twice within the last few hours. It seemed like upgrading unequipped the sword but not the bow. Is it possible that the engine actually unequipped the bow, reducing the base damage to 0, and then when I manually unequipped it from the inventory, it reduced the damage further to -95? And since I upgraded twice, the final base damage was -190?

I'm attaching my other save file after the first upgrade. If it's -95, it might confirm the theory.

save_slot_20.sav.zip

Try commented 3 months ago

I've tested save_slot_20; Damage is indeed -95, however it's probably still coincident: applyWeaponStats is not called, while upgrading the claw.

when I manually unequipped it from the inventory

Only drawing/undrawing a weapon counts. But maybe, during game-play undraw been interrupted by a monster or something similar.

Anyway, when testing on latest state of master issues is no longer reproducible and weapon manipulation is now tightly integrated with counting, preventing partial execution.

AlexMosesov commented 1 day ago

@Try Could you please help me out too?? I have the same problem in Chapter 4. Bow DMG is very low.

Here's my savegame file save_slot_1.sav.zip

I could try it myself but I couldnt open it in WordEdit(

Try commented 1 day ago

@AlexMosesov save_slot_20.zip

hope more people wont come here :D

AlexMosesov commented 1 day ago

Thank you so much!!

1) Was it negative dmg = -110? 2) What should I do to avoid this bug?

Try commented 1 day ago
  1. Yes, negative -110

  2. In Gothic damage is accumulative state. Aka if you equip bow, it gives you +NN damage, if you remove bow it take it back by subtracting NN. Naturally this system is error prone - one wrong line in code and numbers go wild. And to make it worse it persists across save-files.

    What should I do to avoid this bug?

Use latest build. It should be robust now (unless you already have error accumulated in save-game state)