Latest Posts

Topic: strange soldier behaviour

LeightonMan
Avatar
Topic Opener
Joined: 2017-05-19, 14:17
Posts: 43
Ranking
Pry about Widelands
Posted at: 2024-04-26, 11:46

Hi everyone, I've not been playing Widelands for a few years - life got in the way! Anyway, I tried the map "no metal challenge v2" using Widelands 1.2 release on Arch Linux 64bit and found a situation where enemy military building are visible but when I try to attack, I can't send more than one soldier. I launch the attack using all available soldiers but they leave my buildings and all but one return. The single soldier left carries on. He is quickly defeated and then the enemy can attack me but I still can't send all available soldiers to attack them. If I've posted correctly, the attached savegame shows what happens. I can avoid the enemy attack by demolishing the barrier nearest the border and the nearby fortress build completes giving me even more soldiers in the Attack pop-up window. Still, only one actually attacks. Can anyone explain what is happening please?


Attachment:
strange soldiers.wgf (954.3 KB)

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1984
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2024-04-26, 12:09

I didn't look at the savegame but it sounds like you're encountering this known bug: https://github.com/widelands/widelands/issues/5878

The soldiers are listed as attack candidates despite actually not being in range of the attack target, which they only notice once they start trying to find a path. This has become more noticeable due to a recent semi-related bugfix.

When looking for soldiers to list in the attack window, we consider all military buildings within a radius of 25 fields walking distance (i.e. respecting water, rocks etc, but not considering terrain elevation).
While when a soldier actually walks to the target, the algorithm looks for a path with a final actual walking cost of no more than 3 times the air-distance of flat terrain. This now also considers elevation, and caps the length of detours not at a fixed length but depending on air-distance (i.e. bigger air distance permits longer detours).


Top Quote
LeightonMan
Avatar
Topic Opener
Joined: 2017-05-19, 14:17
Posts: 43
Ranking
Pry about Widelands
Posted at: 2024-04-26, 15:57

Many thanks. Yes. that's it exactly. The air distance is quite small but, due to a strip of water, the actual walking distance is three or four times the air distance. Thanks again.


Top Quote