Latest Posts

Topic: Naval Warefare: Soldier management in ports

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2488
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2023-09-08, 14:03

I have trouble to understand the soldier management in ports. AFAIK one can use a port like a normal military building, set the amount of soldiers and either prefer heroes or rookies. But especially the rookie/hero setting doesn't work as i would expect. E.g. in my last testgame i have set the port to store 10 soldiers and to prefer heroes, and all other military building not to prefer heroes. Although the port isn't fully filled up with heroes each trained hero is going to some warehouse and stays there. Also after some time the trained hero isn't going to the port. I noticed this behavior also some time ago, it's really difficult to let heroes go the port. One solution for this test game was to prefer heroes also in some military building near by the port. And now they are immediately going to the military building. After they have been arrived i set the military building to prefer rookies and reduced the amount of soldiers and now they are walking to the nearby port.

What does the settings in ports in regard to the amount of soldiers and the heroes/rookie preference?


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 2002
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2023-09-08, 20:30

Ports and HQ still act primarily as storage. The garrison setting sets the minimum amount of soldiers who will stay in the building at all times and are therefore not available for requests from other buildings or warships. E.g. if your port has a garrison of 10 and currently contains 8 soldiers, then it requests 2 from elsewhere and won't send out any soldiers to any other requesters. If the garrison is 10 and the port currently contains 15 soldiers then up to 5 of them will be sent away when requested somewhere.

Note that all this is just about numbers; the port does not define which of its individual soldiers are garrisoned and which are available. So when a port decides to send away a soldier the decision which one to send is arbitrary and does not take the port's preference into account.

Also I can think of one situation where preferences likely don't work as expected: Say the port is set to garrison 5 heroes and contains 5 rookies and 1 level 1 soldier. Then the port will request "heroes", which actually means "a soldier who is better than the worst stationed soldier". Then the port might decide it can fulfill its own request by treating the 5 rookies as the garrison and the level 1 as free … and choosing that one to "replace" a rookie from the garrison … and since the port does not define which individual soldiers are garrisoned, repeat ad infinitum without getting any exchange. I haven't checked that, but these code paths are not that well tested for warehouses. I could look into this soon-ish.


Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2488
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2023-09-09, 10:43

Thanks for the explanation. Setting the amount of soldiers works as expected, but the hero/rookie setting doesn't work as expected for me, because it seems that "preferring heroes" does not work. In my example the heroe(s), or other better soldiers, didn't go the port. It feels like the setting "No preference" is always active, also if i set "prefer Heroes" in the port.

I just doesn't get the purpose of the preference settings in ports face-sad.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2699
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2023-09-20, 19:49

For me it is important for the gameplay that the garrison at a port or a HQ acts like other mitlitary buildings except from not being abble to attack and just defensive garrison.
So the hero button needs to work. The garrisson need to be seperated from the stored soldiers, and the garrison soldiers might go out for defending nearby buildings.


Top Quote