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:
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:
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:
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...
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...