Latest Posts

Topic: taking a millitary building

BoeseKaiser
Avatar
Topic Opener
Joined: 2019-02-21, 11:03
Posts: 41
Ranking
Pry about Widelands
Posted at: 2021-02-07, 12:39

Hi everyone,

I have played quite a lot with a friend recently, and one aspect of battle still bugs me :

In some cases, a millitary building can be taken even if the opponent has more and better millitary waiting around to defend. If one low level soldier defeats the last remaining soldier of a building, they have a chance (it doesn't seem to always be the case) to march into the building even if there are dozens of supersoldiers from other defending buildings waiting to engage (exagerating for the example, but it really happenned that a soldier takes a building even though the other player has a lot of soldiers, including some better than the attacking player, around the site and out to defend). Now this could be an intended feature, and that's actually my question. I can concieve a couple of ways to at least reduce this effect (which would make a better use of the existing army) with strategic decisions, but I'm wondering if it should be like that in the first place.

Edit : i watched the replay from last time it happened. it was 14 soldiers for me with a a couple of supersoldiers, against 13 for my opponent without any supersoldiers, a couple had some health and attack upgrades. in number of soldiers it's not that big of a difference, but my force was definitely stronger. some of my soldiers from an other building decidd to join rather late, and one of them (well, 2, but one has to stay in the building) stayed behind

Thoughts?

Anyways, nice to be playing again a bit more, I'm still a huge fan.

Edited: 2021-02-07, 13:35

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-02-07, 23:48

Whether it's a bug or strategy depends on the details. If all your buildings are filled with some supersoldiers and some rookies, it sometimes happens that all your heroes walk out to defend and only one rookie remains inside, allowing any attackers who get past the defenders to take the building easily. This unfair chance is a (pretty old) known glitch; the usual solutions suggested are that either the player can choose whether the strongest or the weakest soldier remains inside to defend, or that it just defaults to the strongest (currently it's an arbitrary soldier). Nobody got around to implementing this yet though.
If one of your buildings contains only rookies and only the surrounding buildings have heroes though, then it is a strategy: If the attacker sends so many soldiers that they can engage all the defenders in battle and still have some more to reach the target building, then it is your own fault for not stationing some well-trained guards there.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-02-08, 08:49

To avoid such things the most expereinced Players in our forum tend to dismantle the building in such case. This needs a lot of attention in a fight of course. (Personally I don't know how they manage to still serve their economy meanwhile, but they are able to do so).


Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 01:54
Posts: 351
Ranking
Tribe Member
Posted at: 2021-02-08, 12:01

Why not give military buildings a reserve value? If you set the reserve value to X, at least X soldiers will stay inside the building even when enemy troops are near.

Obviously the player could change it, but I recommend a default reserve value of 1 for all rookie buildings and small hero buildings, 2 for medium hero buildings, and 3 for large hero buildings.

EDIT: Presumably the reserve value would also stop you from sending soldiers in the reserve to attack enemy buildings or go train, although the last one is only an issue if the building is understaffed or has the reserve set to maximum.

Edited: 2021-02-08, 12:08

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-02-08, 12:49

DragonAtma wrote:

Why not give military buildings a reserve value? If you set the reserve value to X, at least X soldiers will stay inside the building even when enemy troops are near.

This idea is not bad. However I am afraid it will suffer from the same thing as the solution Nordfriese mentioned (understaffed developers team).

Obviously the player could change it, but I recommend a default reserve value of 1 for all rookie buildings and small hero buildings, 2 for medium hero buildings, and 3 for large hero buildings.

Well, depending on the definition of reserve, the value of rookies might not solve the issue cause this is exactly what is the case now we have a reserve of 1 means at least one soldier stays in the building rather then going out for defense.
Furthermore we need to consider how to calculate reserve when changing the amount of free soldier spaces in a building (i.e. the slots are reduced by the player.

EDIT: Presumably the reserve value would also stop you from sending soldiers in the reserve to attack enemy buildings or go train, although the last one is only an issue if the building is understaffed or has the reserve set to maximum.

training should not be affected as a soldier from a building does not go for training but is replaced by a better trained one.


Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 01:54
Posts: 351
Ranking
Tribe Member
Posted at: 2021-02-08, 13:03

While the developers team may be understaffed, it's not like I'm asking them to add in an FPS mode! XD Somewhere there's code something like:

if (building.soldiercount > 1):
...SendSoldierInDefense()

That can simply be changed to

if (building.soldiercount > building.reserve):
...SendSoldierInDefense()

Or something similar. As for the rookies problem, even if they fall in combat, hopefully they'll delay the enemies enough for the heroes to return to the building. Finally, if the player lowers the number of slots that shouldn't change things; if a castle's reserve is 5 and the player lowers it from 12 slots to 4 slots, that just means that it'll never send soldiers out to attack offensively or defensively (until the player adjusts it again).


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-02-08, 13:06

Militarysites already have a property "minimum soldier capacity", defined as the number of soldiers who never leave the building except when the enemy is right at the doorstep. Exposing this to the Lua definition of milutarysites and adding buttons to allow the player to change it would be easy to do. But it would not solve the problem that the supersoldiers might go out leaving only the rookies to defend – and a fully trained attacker can cut through a dozen rookie defenders with ease in hardly any time at all.

Edited: 2021-02-08, 13:07

Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 01:54
Posts: 351
Ranking
Tribe Member
Posted at: 2021-02-08, 13:11

Then it may be best to adjust prefer rookies/prefer heroes into three types:

Rookies stay, rookies attack
Heroes stay, rookies attack
Rookies stay, heroes attack

They can be shown by two soldiers, one of them standing (the current icon) and one attacking to the side (I can try drawing new icons if you want).

I'd suggest a fourth type (heroes stay, heroes attack), except that would cause the same problem we're dealing with!


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-02-08, 13:17

We have an open bug report about expanding the hero/rookie preference into a dropdown with four types (rookies, heroes, average-trained soldiers, no exchange). UI-wise we could then have two such dropdowns, one for the building's preference and one for the kind of soldiers who remains inside as last reserve.
So we're back at the usual suggestion to allow the user to choose the kind of defender face-smile.png This won't make it into release 1.0 but IMHO we should definitely aim to implement this for 1.1, the issue comes up so often.


Top Quote
BoeseKaiser
Avatar
Topic Opener
Joined: 2019-02-21, 11:03
Posts: 41
Ranking
Pry about Widelands
Posted at: 2021-02-08, 15:00

Hey everyone, thx for the answers.

Of course dismanteling buildings is key, but sometimes it's too big of a inconvenience and it's worth sacrificing a bit of army to defend a strategic point. And yes placing your heroes is also key, but that was not really my problem :

in this case I had both enough soldiers and good enough soldiers that were already engaging, so my force out on the map was stronger in numbers and in upgrades, I'm not counting the one who stays in the buildings. But somehow my soldiers didn't intercept the opponents soldiers (too far away and/or body blocked) before they defeated the last soldier.

What I said about a soldier remaining in the building was an extra one, so the algorithm only send 3 out of the 5 soldiers of the tower, probably because my force already engaging was considered strong enough.

So the problem of which soldier remains would be of course nice to have (btw, a friend of mine mentioned that it could be the first one in the list, then you'd have to manage your units a bit but could have whatever setup you like) but is not the issue here. Generally speaking, a lot of sugestions to manage a bit more intuitively how soldier works can be interesting, but my question is rather if the described effect is desired with the system as it is now or if this is an unwanted effect of the algorithm.

I would say that for me the attacking player should only be able to take a building when their force are at least a bit stronger than the opponent. (modulo potential chance factors) Of course, that requires a good definition of "stronger" and that's quite hard to find. I would work with something like "if an army would win in most simulations of randomised fight-order, it is a stronger one" with probably a correcting factor to reward big number of soldiers (for the definition of strenght, I'm not talking about the implementation of the actual fights ! )


Top Quote