Potential Siege Bug (plus fix) - 2.032

Users who are viewing this thread

EvilSquid

Recruit
I was just recently messing around with the latest source files + tweakMB to find out what is happening with sieges and surrender, and noticed the following bug:
Code:
[anyone,"player_siege_ask_surrender", [
      (assign, ":no_men", 1),
      
      (try_begin),
        #Kings dont surrender so easily
        (this_or_next|is_between, "$g_talk_troop", kings_begin, kings_end),
        (this_or_next|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
        (store_mul, ":no_men","$g_enemy_strength", 3), #player need to have x3 men than deffenders (else_try),
 (is_between, "$g_talk_troop", active_npcs_begin, kingdom_ladies_end),
 (troop_slot_eq, "$g_talk_troop", slot_troop_home, "$g_encountered_party"), #important place for lord
  (store_mul, ":no_men","$g_enemy_strength", 2), #player need to have x2 men than deffenders
 (else_try),
(store_mul, ":no_men","$g_enemy_strength", 1.5), #player need to have x1.5 men than deffenders.
(try_end),
(ge, "$g_ally_strength", ":no_men"),]
"Surrender? It's a joke, right? You have very few men with which to storm the fortress.", "close_window", []],

Naturally, the above means you'll get the "Surrender? It's a joke..." line if you have greater strength than the enemy (meaning you won't get to the other dialogues which perform further calculations), when the opposite is likely what is intended.

So, changing that line to:

Code:
(lt, "$g_ally_strength", ":no_men"),

means that now, it's technically possible to get a fort or town to surrender via dialogue if you outnumber them by an appropriate amount (1.5-3x), as opposed to an assault or waiting until RNG causes an insta-surrender (10% chance each once they start starving). Prior to this change, it's actually the opposite - you only get to the surrender dialog if you <i>don't </i>outnumber the enemy by the appropriate amount.

Of course, this fix only makes surrender possible - the remaining checks compare many things (such as checkpoints, infiltration success, raiding farms, days spent starving, etc.) against the enemy's strength. None of the remaining checks takes the strength of your army into account (assuming you pass the one above), while the score you need to beat does take the enemy's strength into account, so the stronger the enemy defenders, the more likely it will be that the garrison will insta-surrender (due to starvation) as opposed to agreeing to surrender via dialogue. So this tactic is more useful when your level is lower and/or you chance upon a small garrison (and you'd rather use up money/time/food than troops).

Related to this, is the strength of anyone following your army being properly calculated? I could be wrong but it appears that $g_ally_strength is calculated by using script_party_calculate_strength on p_main_party only, and doesn't appear to factor in other lords following your army (or in the vicinity). It is properly calculated for other scripts (such as simulating battles etc., some of which is used in sieges), but as-is it won't count other armies following you for the surrender options (and they probably should).

I've solved this by adding the following code just after $g_ally_strength is first set:

Code:
(party_get_slot, ":strength_of_attacker_followers", "p_main_party", slot_party_follower_strength), 
(val_add, "$g_ally_strength", ":strength_of_attacker_followers"),

I decided not to include "nearby friends" for this, since I figured that an army should be participating in the siege (i.e. following) to be counted. IMO the script for working out sieges should handle starving better, e.g. if the place doesn't surrender instantly then it should wound 10% of the remaining defenders. This would also make the surrender option occur (slightly) more often. But this is probably a tweak and not a bug-fix so I won't go into it here (I only mention it because it's kind of related).

Note: I found an issue possibly related to this going back to 2015 (!) but now search isn't cooperating...
 
Wondered why I could never get them to surrender when I had over 1000 men with me. Will try this and translate it to .txt format and add it to the tweaks thread.

Not only does lords following you not caluculate into surrender, they also don't calculate when you order the vanguard, it only calculates yours which means if you are seiging a large town with allies you will lose most of your troops while your allies lose none.

I think the first one is working, still haven't got them to surrender, but they now say other lines other than "Surrender, it's a joke" before they would just say that all the time.
 
CeltiberoCaesar said:
Hi EvilSquid,

Thank you for taking the time to report and suggest a solution for that bug. We will fix it for the next version.

:grin: :grin:

No problem - figured it would be worth sharing since you guys are still rolling out fixes. There's a bunch of other stuff I've found which I'll share in future topics at some point (soon). I'd share it all at once but the thing is I've kind of mixed all of this stuff up with various other changes which would fall into the mod/tweak category so don't want to confuse and annoy...

There're all pretty minor like this one (which is probably why most of them haven't even been registered as bugs yet).
 
AfLIcTeD said:
Wondered why I could never get them to surrender when I had over 1000 men with me. Will try this and translate it to .txt format and add it to the tweaks thread.

Not only does lords following you not caluculate into surrender, they also don't calculate when you order the vanguard, it only calculates yours which means if you are seiging a large town with allies you will lose most of your troops while your allies lose none.

I think the first one is working, still haven't got them to surrender, but they now say other lines other than "Surrender, it's a joke" before they would just say that all the time.


Hmmm, well I thought they did factor into other scripts, and I thought that included the vanguard - I'm sure that even though I put my important troops in a quarters, when I placed the mantlets I had troops dying that I no longer had in my main army. I did have those troop types in my quarters, but on checking them I found I hadn't lost any, so I assume the game must have added troops from my allies. Either that or putting them into quarters makes them both available for use but invulnerable to death from certain siege scripts? :wink:

I know that for the actual assault, I can confirm that when you lead the troops yourself, that I definitely had allies with me - generally I'd have more allied troops than my own, so I'd actually lose less men than my allies. I don't tend to let them assault without me though - since the casualties for that are way higher than if you do the battle yourself - so I guess it's possible that this could result in allies not being added properly - but I thought a recent patch fixed this already?


Getting the requirements to trigger the surrender is pretty tough. The (potential) problem is that once you pass the initial check, the rest of the calculations don't take your army size into account (they're generally just arbitrary-looking numbers added to "conditions", but they DO take the enemy's army size into account (i.e. the "conditions" need to exceed 2*enemy_strength). So the later in the game you are, the more difficult this is to reach due to the larger garrison sizes.

Each day they spent starving gives you 80 points toward "conditions", but each day spent starving there's also a 10% chance the garrison surrenders by itself (i.e. without requiring you to contact the garrison first). I think the only time I got a surrender was when I had everything done and successful (successful infiltration, found a traitor, pillaged farms, checkpoints active, mantlets built and placed, ladders built), plus they'd been starving for a number of days, plus they'd sallied out twice due to starvation.

By that time they had hardly any non-injured troops left, so it would have been almost as easy to assault them at that point (plus I would have gotten more loot). Not to mention that they could have just as easily surrendered the next day for all I know, so this probably only saved a day or two at most. Although this way should theoretically mean fewer casualties than assaulting the place, given how easy it is to cheese the AI on most assault maps and how many troops I lost due to siege events and placing the mantlets (though I did the old "put your good troops in the quarters when placing mantlets" trick), I'm not sure I was that much better off.

And if we assume that most of those chumps can be replaced easily enough, and then factor in the cost of the food I went through (good variety + amount for morale), plus the peningas for the occasional event, plus the cost of priests/camp women every 3-4 days - in most cases it's probably not worth seeking surrender. The only thing that makes this viable is the fact that troops often take time as well as money to replace, which might be more important than the time/money saved by assaulting it.

In winter I would have definitely been worse off, but that's to be expected.

There are other factors - your relations with the centre, the owning lord, the owning lord's personality type - which can mean earlier surrenders - but I don't tend to generally have good relations with my enemies. Also I think the lords relation/personality only factors in if the lord is actually present (i.e. you talk to him instead of the generic commander).

So... overall, starving them out is situation-dependent, where you can both afford to take however long you want, and where the casualties you take in an assault would definitely be more than the casualties you take during all those siege events (and you have lots of food with you, and have enough for expenses, and you're not fussed about missing out on the extra loot/prisoners). IMO most siege works are still worth it since they can help thin their numbers prior to an assault - that's usually what I do when facing large garrisons and/or places that are difficult to assault.

It's also useful to get them to sally out due to lack of food in those cases, although there are times where I swear that I lose more troops fighting an (starving!) enemy's sally than a direct assault against their full garrison...
 
The issue of g_ally_strength not including allies was inherited from Native. It is used in two places: determine siege surrender and extract money from caravans. My guess is that it was nerfed so the player couldn't exploit the latter.

I will add some sort of fix.
 
Cool, sounds good. BTW it's awesome that you guys are still patching this game even as work on Bannerlord progresses.
 
EvilSquid said:
Cool, sounds good. BTW it's awesome that you guys are still patching this game even as work on Bannerlord progresses.

they are awesome (BWStudios), but they are not the ones working on Bannerlord (TaleWorlds). VC was developed by a third party company, similar to all the add-ons to MB (NW, MBF&S, Carribean!, VC)
 
kalarhan said:
EvilSquid said:
Cool, sounds good. BTW it's awesome that you guys are still patching this game even as work on Bannerlord progresses.

they are awesome (BWStudios), but they are not the ones working on Bannerlord (TaleWorlds). VC was developed by a third party company, similar to all the add-ons to MB (NW, MBF&S, Carribean!, VC)

Ah of course, my mistake - for some reason I assumed they were now part of the same company (prob cos they're on these forums), whereas they're more like 3P contractors. Still cool of them to continue pumping out free updates either way, unlike some companies I could mention.
 
Back
Top Bottom