Bug in fight

Bug #1817664 reported by GunChleoc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Unassigned

Bug Description

I got this bug report from Worldsavior:

In the fight around 47:46 at the Sentinel in the Northeast, the Atlantean solder should win the fight.
However, he dies at his 5th attack instead of hurting the enemy.
He had received a blow right before that.
Host version 8984, cleint version 8990.

After looking at it, I think that the soldier dying might be correct and that the issue is how we show the animations. I might be wrong though.

The Sentinel building was destroyed manually by the player.

Related branches

Revision history for this message
GunChleoc (gunchleoc) wrote :
Revision history for this message
GunChleoc (gunchleoc) wrote :

Video

Revision history for this message
Benedikt Straub (nordfriese) wrote :

I can´t imagine a attack-1 frisian soldier is strong enough to kill with one blow an atlantean hero that still has so much strength left??
It really does look as if the atl soldier attacks the enemy and hurts himself while doing so. Might be interesting to log all attack steps to watch the blow strength and remaining health of both soldiers. I´ll look into it…

What makes such fights harder to watch is that after a successful attack, the health bar only drops when both animations are complete and therefore with some small timeshift. It would be nicer if the bar fall gradually from old to new value during the 1 second the animation needs.

Changed in widelands:
assignee: nobody → Benedikt Straub (nordfriese)
Revision history for this message
Benedikt Straub (nordfriese) wrote :

Internally, everything works fine. The atlantean soldier is killed by a lucky hit from the frisian soldier and dies. He does not get a new attack turn afterwards. So it looks like for some reason, we either show an unrequested attack animation or the battle animations are generally out of sync...

NOCOM: get_battle_work() called, frisian soldier´s turn is being computed...
NOCOM: Attacker´s health is 5444, defender´s health is 1878
NOCOM: Attacker´s health is 5444, defender´s health is 1878
NOCOM: Calculating combat round.
       NOCOM: New combat round starting
       NOCOM: Attacker (frisians) health is 5444, defender (atlanteans) health is 1878
       NOCOM: Hit chance 82
       NOCOM: Hit!
       NOCOM: Attack strength is 2537
       NOCOM: Real damage is 1979
NOCOM: Waking up opponent.
NOCOM: Showing appropriate anim attack_success_e for frisians soldier.
       End of turn.

NOCOM: get_battle_work() called, atlantean soldier´s turn is being computed...
NOCOM: Attacker´s health is 1878, defender´s health is 5444
NOCOM: Attacker´s health is 1878, defender´s health is 5444
NOCOM: Round was just fought, nobody is ready for the next one yet.
NOCOM: Showing appropriate anim evade_failure_w for atlanteans soldier.
       End of turn.

NOCOM: get_battle_work() called, atlantean soldier´s turn is being computed...
NOCOM: Attacker´s health is 1878, defender´s health is 5444
NOCOM: Applying 1979 damage points to atlanteans soldier
NOCOM: Attacker´s health is 0, defender´s health is 5444
NOCOM: The battle is over, atlanteans soldier has lost.

NOCOM: get_battle_work() called, frisian soldier´s turn is being computed...
NOCOM: Attacker´s health is 5444, defender´s health is 0
NOCOM: Attacker´s health is 5444, defender´s health is 0
NOCOM: Opponent is not ready yet, showing evade anim...

<no more output for this battle>

tags: added: graphics
Revision history for this message
hessenfarmer (stephan-lutz) wrote :

From the video it seems like the health bar of the atlantean soldier is displayed incoorectly as 1878 is little more than 10 % of the health while the health bar shows a round one third of the health left

Revision history for this message
GunChleoc (gunchleoc) wrote :

Let's look into the animation issue then.

There's another branch open about the cosmetics of the health bars:

https://code.launchpad.net/~widelands-dev/widelands/bug-794407-soldier-stats

So, if fixing this bug should touch that, better wait so that we won't get ugly merge conflicts.

Changed in widelands:
milestone: none → build21-rc1
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Benedikt Straub (nordfriese) wrote :

Found the cause! It´s a fairly simple issue. The last evade_failure animation loops over, so the first one or two frames are visible again. This looks almost as if the soldier is beginning to attack. That´s the same problem as bug 1766957. I´ll just add one or two empty frames to the end of all soldiers´ eva_fail animations to make this less likely (as was done in the other bug). Then we can have this for b20. A "true" fix would touch the state/task system of bobs, which has high potential for introducing new bugs, and is much more work than it´s worth.

I already implemented the gradual health deduction I suggested in #3 because it helped to debug this, and because it looks nicer. That´s an easy 20-lines change. I looked at your branch, this won´t even interfere with it… can I keep it in my fix? please?

Revision history for this message
GunChleoc (gunchleoc) wrote :

Well, since you've already done the work, let's keep it in and I'll deal with the conflicts.

description: updated
Changed in widelands:
milestone: build21-rc1 → build20-rc1
Revision history for this message
Benedikt Straub (nordfriese) wrote :

> I´ll just add one or two empty frames to the end of all soldiers´ eva_fail animations to make this less likely
Scratch that, that would look strange during normal combat…
Instead, I´ll display the eva_fail for a shorter time if it is known that the soldier will die immediately afterwards. That´ll make the loopover less likely without touching the main battle

Revision history for this message
Benedikt Straub (nordfriese) wrote :

I can´t test the attached replay anymore as it now goes out of sync the first time a soldier is killed, but this branch should fix the issue.
I could reproduce this bug in other games, and with the branch I can´t.

Changed in widelands:
assignee: Benedikt Straub (nordfriese) → nobody
status: Confirmed → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

More detailed log

Revision history for this message
GunChleoc (gunchleoc) wrote :

The log in #11 shows 3 hits for second 48:00. Needs investigating.

Changed in widelands:
status: Fix Committed → Confirmed
Revision history for this message
Benedikt Straub (nordfriese) wrote :

I couldn´t reproduce that.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I am attaching a spreadsheet reproducing the calculations from the final fight. There were no errors that I could find, so this bug is resolved.

Changed in widelands:
status: Confirmed → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers