wounded attacking soldiers failing to retreat

Bug #1554552 reported by king of nowhere
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

When an attacking soldier drops below 50% healt, it will retreat if possible, i.e. if it is not surrounded by enemies. This mechanism is malfunctioning in 7852, where soldiers keep attacking even if they are low in healt AND there are no enemies around. See attached replay

Tags: military

Related branches

Revision history for this message
king of nowhere (lainluigi86) wrote :
Revision history for this message
king of nowhere (lainluigi86) wrote :
GunChleoc (gunchleoc)
Changed in widelands:
importance: Undecided → High
milestone: none → build19-rc1
tags: added: military
Revision history for this message
TiborB (tiborb95) wrote :

It seems that this union is causing a problem:

union {int32_t ivar3; uint32_t ui32var3;}

In my branch I eliminated it and created new variable of soldier object: retreat_health. One of advantages will be that the value will be visible via DBG window and also in verbose logs. So a tester will see what value is applied.

I am not able to load attached files, though...

Changed in widelands:
assignee: nobody → TiborB (tiborb95)
Revision history for this message
king of nowhere (lainluigi86) wrote :

if you update the game to the latest version every time, of course you can't open 7852.

Revision history for this message
TiborB (tiborb95) wrote :

You know, nobody will create new branch from old trunk...

Revision history for this message
GunChleoc (gunchleoc) wrote :

That's because we broke compatibility again after this bug was posted ;)

Revision history for this message
king of nowhere (lainluigi86) wrote :

yeah, when i reported it, it was new. and if nobody fixed it, the bug is still there.
the replay simply showed a soldier fighting, getting wounded to below 10% of his hp, then going on attacking despite a complete lack of enemy soldiers around

Revision history for this message
TiborB (tiborb95) wrote :

"then going on attacking despite a complete lack of enemy soldiers around" - whom did he attack when there were no enemies?

The bottom line of bug was that there was a health threshold set properly, but shortly afterwards it was erroneously re-set to 0. This is fixed.

Also, you probably understand, threshold is tested only before engaging new opponent, during the fight (between two soldiers) threshold is not relevant.

Revision history for this message
king of nowhere (lainluigi86) wrote :

"whom did he attack when there were no enemies?"
he went to attack the military building. the point was that he had all the chance of retreating. Anyway, good that it is fixed

Revision history for this message
TiborB (tiborb95) wrote :

I hope it was fixed. I just want to emphasize, that there is DBG window that will give you more info about what is going on, can be useful when debugging their behavior.

Revision history for this message
king of nowhere (lainluigi86) wrote :

which one is the version where it should be fixed? because i tried the latest available windows version, the 7907, and the bug is still there

Revision history for this message
Miroslav Remák (miroslavr256) wrote :

This is the branch: lp:~widelands-dev/widelands/bug-1554552 . It hasn't been merged into trunk yet.

Revision history for this message
GunChleoc (gunchleoc) wrote :
Revision history for this message
kaputtnik (franku) wrote :
GunChleoc (gunchleoc)
Changed in widelands:
status: New → Fix Committed
assignee: TiborB (tiborb95) → nobody
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.