AI Army compositions makes no sence at all to the players Recruiting capability 1.4.2 Beta

Users who are viewing this thread

Ok, so just to keep some things straight:
  • Npcs have a mandatory 2 day cooldown after they escape or get ransomed before they can do anything. They sit in their castle/town hall during this time. Escape chances are determined by the percentages found in the screenshot here.
  • After the 2 days is up they spawn with 10% of their party capacity filled (and an absolute max of 19 troops). These troops have an average tier of ~3.
  • To get troops they pull from their garrisons and buy troops from notables and taverns. They pay the same price as the player for these troops. They do not spawn any additional troops after the initial 10%, and there is nothing else giving them free troops otherwise. It usually takes npcs 5-7 days to recruit up to party limit, but this can be a bit shorter or a lot longer depending on the state of their kingdom. Their parties will obviously still be majority tier 1 at this point.
  • Npcs respawn with only a few horses initially, but will buy and sell horses from settlements just like the player. They generally don't keep many horses on them, and as a result, are usually quite a bit slower than the player party (Khuzait being the exception). They don't use horses for upgrades, but aside from Khuzait they don't amass cavalry troops that quickly anyway. The silver lining to that is that horses are more easily obtainable for the player (as you don't need to compete for horses with the npcs).
  • Npcs have the ability to recruit troops from allied notables as if they were on 'very easy' setting. This is because their initial relations with notables are not set yet. Once they are set this cheat will be removed according to a dev.
  • They have an 'aggressiveness' score that is determined by their Valor and Mercy traits. I don't entirely know how that factors into their behavior though. Caravans and Villager parties have 0 aggressiveness if that tells you anything. The variable is used extensively in the behavior functions of the MobileParty class.
  • Npcs pay the same price for wages as the player, but stop paying wages to retain enough gold to buy food when their gold is too low. The unpaid wages create a morale debuff instead (same as the player), but currently it looks like the morale system has some issues that prevents it from generally going low enough to cause desertion. This is true for the player and his clan parties/garrisons as well.
  • Npcs pay the same price for troop upgrades as the player.
  • Npcs obtain money in the same way that the player does. While players get 25% of their fief's prosperity as tax, npcs get 30%. They get their battle loot turned directly into gold, and get a good market price for the conversion (50% full value). They get tariffs from trade with their settlements at the same rate as the player. They also get money from ransoming troops/lords. They don't get workshops or caravans however. Here is a (likely outdated) breakdown of npc income by type.
  • Each troop of an npc gets passive xp equal to (5 + Troop Level) per day. This means a recruit gets 11 xp a day and will take (279/11) = 25.4 days to upgrade. A tier 2 unit will take 29.6 days to upgrade. Tier 3 will take 34.2 days. Tier 4 will take 39 days. Tier 5 will take 43.8 days. So, for a stack of troops to go from tier 1 to tier 4 passively it takes 89 days, which is over a year game time. They obviously also get xp from battles like the player. The amount of passive xp they get might be lowered in a future patch (and become leadership based instead) according to this post here.
  • Factions start the game with a total party capacity in the range of 1500-2000 troops. This means that destroying a single army likely only represents 30-50% of their total forces in a given moment, which is why you often see multiple armies while beseiging a settlement for a prolonged period of time (they are mostly different lords). This total capacity only grows as the game goes on (except for losing factions with a lot of defections). Hiring mercenary companies will add a few hundred more troop capacity per company.
My experience with the game is not entirely the same as what some other people are reporting, but I won't bother going into detail about it.

(Sorry for the huge block of text; I wish there was a way to at least add line spaces after each bullet point)

Thank you for taking the time to post all the details behind the mechanic, it is interesting and i was not aware of this, i thought it was much more simplified than this for the AI.

So yes basically the game is EA so for the mean time until more advanced mechanics and diplomacy feature will be added, the devs tried to balance snowballing which is a good intention.

Well, to be fair AI generals still come back with many recruits after a defeat but perhaps what they could do to make winning decisive battles more meaningful is to slightly increase the cooldown or their ability to come back from far in the player's territory to attack him just a few days after their 1000+men army full of cav and elite units was destroyed by the player who is still healing his wounded from that battle.
 
I think the "very easy" setting thing is what screws up the player so much. lords walk around their kingdoms and completely drain the troops from all of the towns, making their armies big and making it harder for you to recruit yourself, even in places where you have high relationships.

I am looking forward to this placeholder being removed. I think it will also slow down snowballing kingdoms a bit as a bonus, since newly conquered territory will be harder to recruit from.
 
I am looking forward to this placeholder being removed. I think it will also slow down snowballing kingdoms a bit as a bonus, since newly conquered territory will be harder to recruit from.

It will be replaced with lords having actual relations with notables, so effect will be more or less the same. You will still be competing with the lords, their recruitment patterns will just not be distributed among them evenly. But the overall capacity to recruit will be the same. More or less. It has to be otherwise game would become unbalanced.
 
It will be replaced with lords having actual relations with notables, so effect will be more or less the same. You will still be competing with the lords, their recruitment patterns will just not be distributed among them evenly. But the overall capacity to recruit will be the same. More or less. It has to be otherwise game would become unbalanced.

Yeah but instead of lords wiping out everything around them they would need to return home to recruit. I guess it depends on how localized to their initial holdings their relations would be, and how they would change over time. Either way I think it will be way better than the current system. Right now they could raid a village 100x, conquer the castle ruling it and then hire the best warriors from the village, which makes little sense.
 
If someone with skills could look under the hood and see what the AI does after defeat and why that'd be interesting.
What do you think I've been doing? Did you think I just pulled all of this information out of thin air?

There's way too much to post here in its entirety, but I'll source and explain some of the more "controversial" bits.

So, when an npc is released or escapes from captivity, it calls the EndCaptivityAction class and changes the hero's state to "Released," then sets DaysLeftToRespawn to 2 in all cases. Here is that block of code:
Respawn-Cooldown.png
In the HeroSpawnCampaignBehavior class there is a function (method?) called DailyTick(). In that function it decrements hero.DaysLeftToRespawn for all heroes by 1 each day, and then calls the SpawnHeroes function.
Hero-Spawn-Campaign-Behavior-Daily-Tick.png
In the SpawnHeroes function it checks a bunch of conditions, one being whether DaysLeftToRespawn is <= 0. If all of the conditions are met, then it calls the SpawnLord function.
Hero-Spawn.png
The SpawnLord function (not pictured) does a variety of things, such as give the party some initial items (based on nearby village type/production), pick a settlement to spawn in, set the lord's hitpoints to max, and set the hero's state to "Active." It also calls the SpawnLordParty function.

The SpawnLordParty function instantly calls the SpawnLordPartyInternal function. This is the function that sets the troop limit of the respawning lord to 10% (or 19, whichever is lower). I have checked and double checked in game that lords always spawn with only 10% of their party filled always. This is also the function that sets the npc's aggressiveness based on traits. It also "initializes" the mobile party.
Spawn-Lord-Party-Internal.png
The InitializeMobileParty function calls the FillPartyStacks function, which is what actually populates the npc's troop roster based on the 10% limit and the faction's party template found in the partyTemplates.xml file in the Modules\SandBox\ModuleData folder. It's kind of complicated how it does that, but I'll try to explain it anyway. Essentially it is randomly filling the party's troop roster, with certain troops having a higher priority. It's weighted toward spawning lower tier troops, but it is not strictly sorted by tier. Here is relevant the block of code:
Fill-Stacks-Add-to-Roster.png
And here is Vlandia's party template from the xml file as a reference:
Vlandia-party-Template.png
So what the block of code does is sum up all the min_values and max_values from the xml and divides by 2 to get what I've termed the "stack total." Vlandia has a stack total of 53.5 for instance. It saves this value as num6. I'll call the [(min_value + max_value) / 2] number for each individual troop the "min/max average."

It then multiplies the stack total (num6) by a random percentage (a decimal from 0 to 1) and saves this as num7. This number is the weighted chance of a particular troop getting added to the roster. In the third 'for loop' (with "m" as the index) the game subtracts the min/max average of first troop in the template from num7 and checks to see if num7 has fallen below 0. If it has, then it breaks the loop and adds that troop to the roster and starts over. If it hasn't, then the loop increments and it subtracts the next troop's min/max average from the new num7 value and checks again. It keeps doing this until the troopNumberLimit has been reached.

As an example, take Vlandia's stack total of 53.5. Say the random multiplier that's chosen is 0.5, which makes num7 = 26.75. The game looks at the first slot in the party template stack, which is a Vlandian Recruit, and subtracts the min/max average of 16 from num7 (26.75 - 16 = 10.75). That new number is saved as num7 and the game then checks if it is below 0 (it's not). Since it is not, it moves to the Gallant next and subtracts 8 from the new num7 value (10.75 - 8 = 2.75). Still not below 0, so it moves on. Next up is the Light Cavalry, which has a value of 4.5. Since (2.75 - 4.5) is a negative number it breaks the loop and adds 1 Vlandian Light Cavalry to the troop roster and starts over.

Since recruits have a min/max average of 16 and they are the first troop checked, there's a roughly 30% chance that a recruit will be added to the roster each time through the 'for loop,' so you would expect to see most (Vlandian) lords respawn with 30% of their parties filled with raw T1 recruits.

Also, here is the block of code that controls the passive xp each npc troop receives per day:
NPC-Daily-Troop-XP.png
You can see a breakdown of the party size capacity for an individual lord by opening the dev console (Alt + ~) and using the command "campaign.show_party_size_limit_detail [Party Name]" for the npc. You can also tally up the total party capacity for all of the vassals in a faction using this command, which is where I got my estimate for the range of total party capacity on campaign start. I based my previous estimate on just a couple factions, but I went back and counted for each faction and it turns out the actual range is between 1855 (Khuzait) and 2351 (Western Empire).

I have checked the code and/or corroborated in-game most of the other things I stated in my last post as well, but it would take a lot more time to fully explain everything and this post has already ended up being much longer than I had anticipated.

Keep in mind I did not write the code, I don't know it front to back, and I can't see the comments, so it's possible I have misinterpreted some parts, but I'm rather confident in my analysis. Obviously it's also possible that there are still bugs lurking in the code, but I've verified what I can through in-game testing, and everything works as I would expect it to. There is not reason to dismiss all of this just because it doesn't "feel" correct.
 
Thanks for the analysis Bannerman Man, very much appreciated and I suspect everything you've posted is correct. My main worry remains how AI Lords handle their Patch 1.4.0 option to disregard wages below 'critical money limits'. Would you have an insight into what that critical level is, and whether the AI handles partial wage payment up to that threshold? If the critical money limit is, say, 5000, I could imagine the AI having enough money at every village to buy food, recruit, upgrade, etc., every day but not pay the upkeep, resulting in low-morale but non-deserting troops/garrisons. Does morale even factor into autocalc between AI armies? I worry that this money hack (and it really is a hack, let's be honest) has done a lot of harm to the simulation's realism. The player's critical money limit is 0: no money, can't recruit, can't upgrade, can't buy food until the desertions take denar outflows below denar inflows.

The issue I have seen in recent playthroughs, and AnandaShanti as well, is successful factions like Khuzaits rebuilding after defeat at speeds that do not appear throttled by realistic financial considerations, such as the ones the player would experience from losing repeatedly. I think you're right about everything here: respawn amounts, recruitment slots, exp gains, etc. I'm just concerned that they are managing to recruit and upgrade their armies with a disregard for the financial implications both in upfront cost and upkeep, because the 'critical' level leaves them enough to always afford the former and disregard the latter. Anecdotally, I've certainly found it possible to avoid troop desertion with a combination of Leadership skill, food and partial wage payment (haven't tested yet whether enough Leadership and food can offset the morale impact of total non-payment of wages).
 
Last edited:
The issue I have seen in recent playthroughs, and AnandaShanti as well, is successful factions like Khuzaits rebuilding after defeat at speeds that do not appear throttled by realistic financial considerations, such as the ones the player would experience from losing repeatedly. I think you're right about everything here: respawn amounts, recruitment slots, exp gains, etc.

AI lords generally have a lot of money (you can check by going to the barter menu; a typical amount is in the six figures) and recruiting troops isn't that expensive. You can get around fifty T3 units for under 20,000 denars.
 
I wished the Battanian roster didn't have as much cavalry as it does. Makes their armies weirdly lore unfriendly.

And I do dislike the artificial nature of AI being able to build up armies so quickly without issue. Let them play by our rules. If they get destroyed and can't fight for a while? Good. Less whack a mole, and battles are more meaningful. A defeated lord needs to go to their garrison, get men and then get recruits.

Better yet, unless cruel or desperate, lords should focus on training their troops to at least t2 rather than sending them back in to die again.

Battanian cavalry is historically accurate though. The Celtic tribes of the British Isles used a lot of jav cav.
 
Would you have an insight into what that critical level is
I do actually. It depends on the party type. Clan leader parties will stop paying wages when total clan gold is < 2000, vassal parties will stop paying wages when clan gold is < 4000, and garrison parties will stop paying wages when clan gold is < 8000. All of this can be seen in the DefaultClanFinanceModel class, specifically in the AddExpenseFromLeaderParty and AddPartyExpense functions. Here are the screenshots:
Add-Expense-From-Leader-Party.png


Add-Party-Expenses.png
If a vassal party's gold on hand is <5000 at the end of the day then it will be reset to 5000, and the difference will be added to the clan's daily expenses. That's what the bottom half of the second screenshot covers. This applies to both npcs and the player.
and whether the AI handles partial wage payment up to that threshold?
Yes, it calculates income before expenses and will apply any new income to partially cover troop wages. Since most clans have daily income, this means that wages are almost always at least partially paid.
Calculate-Party-Wage.png
Does morale even factor into autocalc between AI armies?
...
Anecdotally, I've certainly found it possible to avoid troop desertion with a combination of Leadership skill, food and partial wage payment (haven't tested yet whether enough Leadership and food can offset the morale impact of total non-payment of wages).
No morale doesn't affect autocalc as far as I'm aware, but I haven't really checked very thoroughly. Low morale does seem to be less of a problem than was probably intended. The reason for this is this line in the MobileParty class under the DailyTick function:
Recent-Events-Morale.png
So the morale penalty gets applied as a proportion of the wages that are not paid. If no wages are paid, then you get a static -20 modifier that remains as long as you continue to fail to pay wages. If half wages are paid it becomes -10, etc. down to 0. There is also a daily NoWage penalty that factors into the "Recent Events" modifier on the morale tooltip. This penalty stacks each day continuously for every day of missed wages. The maximum penalty that can be added per day is -3, and again it's reduced in proportion to the amount of wages that were paid.

Well, since most clans can pay at least a portion of their wages due to income, the static debuff usually tops out around -16 or so, while the daily debuff will subtract around -2.5 each day. Over time the Recent Events modifier will drop to around -25 or so, and the line shown in the screenshot above provides an upward force of 10% of the total modifier each day. So 10% of -25 is added back into the modifier each day and it cancels out the downward force from missed wages. Well a base morale of 50 minus 16 minus 25 leaves morale at a total of 9, which is only barely below the threshold of desertion which happens at 10 morale. Any other + morale will boost you over 10 and no desertion will ever take place, no matter how long you neglect to pay wages. I think I botched that explanation a bit, but hopefully you can still make sense of it.
I worry that this money hack (and it really is a hack, let's be honest) has done a lot of harm to the simulation's realism.
...
I'm just concerned that they are managing to recruit and upgrade their armies with a disregard for the financial implications both in upfront cost and upkeep, because the 'critical' level leaves them enough to always afford the former and disregard the latter.
Why do you assume the recruiting model is that simplistic? It's actually really complicated, and I feel like I only have a basic understanding of it. It's definitely not as simple as [If Clan Gold > Recruit Price, then Buy Troop]. I could make a whole nother comment just as long or longer explaining the recruiting procedure, but to boil it down, the more money a clan has the better their overall recruiting will be. Here are the major points you need to know:
Find-Party-Size-Normal-Limit.png

Get-Recruit-Actions-For-Party.png
There is a multiplicative factor that is applied to the total party size capacity that is controlled by the amount of money a clan has. If a clan has > 108000 gold, then the clan can recruit to their full party capacity. If they have between 18000 and 108000 gold they will be able to recruit to between 77.5% and 100% of their maximum party size. Between 9000 and 18000 they will recruit up to 75%. Below 9000 they will only be able to recruit between 55% and 73% of max capacity. As Apocal said, clans usually have very deep pockets, but it's still possible to hurt their ability to fully recruit by beating them repeatedly.

Npcs also don't just get to straight up buy whatever recruits they get to first. There are dice rolls happening behind the scenes each time an npc tries to recruit a troop from a notable, and the more money the clan has, the more times they get to roll the dice per troop. The more troops they currently have relative to their maximum party capacity, the lower the odds they'll successfully recruit a troop.

Mercenaries in taverns are handled separately from regular faction troops, and clans generally need even more money to have a good shot at recruiting large amounts of them.

One last point: there's also a minimum amount of money that a clan party needs to have to be allowed to recruit troops. This threshold is controlled dynamically based on the amount wages currently being paid for the party, how many troops the npc is currently carrying, and how many total "commanders" (vassals) a clan has. Here's a screenshot of that formula:
Start-Recruiting-Money-Limit.png
Does this (or part of it) apply for companions when they are running their own party or just to the lords?
Companions use separate logic. They don't have any forced cooldown. They just get scattered to a settlement that is nearby to the player's current location.
Player-Companion-Escape-Case.png

Holy sh*t that was a lot of typing haha.

Edit: I also highly agree with this:
I think the "very easy" setting thing is what screws up the player so much. lords walk around their kingdoms and completely drain the troops from all of the towns, making their armies big and making it harder for you to recruit yourself, even in places where you have high relationships.
 
Last edited:
Thanks for that - it confirms everything I feared. There's nothing complex about a piecewise linear recruitment cap for the AI, and their critical money limit is set far too high, allowing theoretically bankrupt AI Lords to replenish to ~60% of their cap indefinitely (which they do rather quickly, thanks to their Very Easy setting for recruitment - doesn't take them long at all to fill up to their wealth-based cap). This lines up with my experience of unrealistic continuous army replenishment from e.g. Khuzait Lords even after beating them into poverty. You can not bleed a faction dry on the field, ever - the only true wins are the captures of fiefs, to cut down their denar inflows and eventually cause an exodus of Lords. This is also why Merc Clan playthroughs (which tend to focus more on field battles and disregard sieges - why bother when you can't own land?) are so unfulfilling. Focusing on field battles made the threads holding the system together far more apparent, and it's not pretty.

The option for bankrupt AI Lords to disregard wages and still recruit ~60% of cap for no practical impairment (since morale never hits desertion levels) is a really silly hack. I hope the devs remove it.
 
Last edited:
Battanian cavalry is historically accurate though. The Celtic tribes of the British Isles used a lot of jav cav.
Battania being inspired and heavily based off Celtic culture doesn't mean they have to be historically accurate. We have some Gallic influence through their metallurgy, but otherwise they are very Welsh/Irish with their liking for longbows and skirmishers.

Now granted, I think Battanian Mounted Skirmishers should stay. Give them an extra set of javelins and now we have a worthwhile compliment to the Battanian army.

Its those scouts and horsemen that just fill up too much of Battania. I'd rather they introduced an alternative noble line of Battania cavalry, added some common archers in and give us an army with more archery.
 
Last edited:
Its those scouts and horsemen that just fill up too much of Battania. I'd rather they introduced an alternative noble line of Battania cavalry, added some common archers in and give us an army with more archery.

Would be cool if they introduced chariots :smile:
British Celts used them if i remember well.
 
There's nothing complex about a piecewise linear recruitment cap for the AI, and their critical money limit is set far too high, allowing theoretically bankrupt AI Lords to replenish to ~60% of their cap indefinitely (which they do rather quickly, thanks to their Very Easy setting for recruitment - doesn't take them long at all to fill up to their wealth-based cap).
No, the piecewise function itself isn't complicated, but it's only a portion of the recruiting procedure. A piecewise function is actually a great way to give them fine control over what the curve looks like and create reasonable limits at either end of the spectrum. If they decide that the critical money limit or wealth cap is too high, then they can easily change it just by tweaking a few constants.

The amount of money npcs have does have partial control over how quickly they can recruit (at least for clan leaders). Like I said before, npcs have to "roll" for a chance to get a recruit. Each npc gets 1 roll by default, and gets additional rolls for each integer in the equation [Sqrt(PartyLeaderGold/10000)]. So at 10000 gold they get 1 extra roll, 40000g 2 extra rolls, etc. The roll has to be above the current wealth adjusted party size ratio (number of troops/total party capacity) to pass. If the roll succeeds, then a troop is recruited (assuming they have the slot unlocked) and it moves on to the next notable. If it doesn't, then it moves to the next recruitment slot and tries again for each slot, and if it fails for all 6 slots then it moves to the next notable. It does that procedure 7 times every time a settlement is entered, and once each hour thereafter (though npcs will only wait around in towns, not villages). It's hard to tell exactly how much this slows their down recruiting, but it too can easily be adjusted if the devs decide it's not enough.

Mercenary recruiting is much more sensitive to party gold, and a clan that is broke will have a <1% chance of ever recruiting a mercenary troop from a town.

There are separate recruitment procedures for caravans, common area parties, garrisons (currently unused), and minor factions, but that's outside the scope of the discussion.

There are also other aspects of npcs that are handicapped by money that I've found:
  • Lords buy fewer (if any) horses when broke, so their travel speed is reduced relative to a wealthy lord or the player.
  • A multipler is applied to the influence cost to call an npc party into an army. A party that is 40% full will cost 3 times as much as an equivalent strength party that is full. A party at 70% capacity is twice as expensive. It uses the true party size ratio rather than the wealth limited one, so a party that is wealth capped to 70% capacity will always be twice as expensive as an equivalent strength party at full capacity. Hard to say if that was intended or not.
  • A multiplier is applied to the garrison size of a clan's settlement based on wealth. This means they will pull more troops from the garrison and add fewer back until it meets their lowered ideal size. Here is how that multiplier is calculated:
Owner-Clan-Economy-Effect-On-Garrison-Size-Constant.png
I also haven't looked too deeply into the behavior functions for the AI because they are really dense and it's hard to figure out exactly what's going on, but in the AiMilitaryBehavior class there is a multiplier applied to the "CurrentObjectiveValue" variable that is determined by the party size wealth cap. I don't know what effect this has on behavior exactly, but applies to raids, sieges, and settlement defense.
Ai-Military-Behavior.png


Ai-Military-Behavior2.png

The option for bankrupt AI Lords to disregard wages and still recruit ~60% of cap for no practical impairment (since morale never hits desertion levels) is a really silly hack. I hope the devs remove it.
Honestly, I think the wage skipping comes into play less than one would think. Most of the lords with money problems hover around or slightly below 8000 gold, which is the cutoff for garrison payments. Since their income is calculated before the expenses, they actually end up paying the garrison wages completely the majority of the time and only miss payments every so often. The threshold to skip mobile party wages is very rarely crossed. The only reason they added that cheat in the first place is because npcs were falling into holes of bankruptcy that they were unable to climb out of and it was breaking their behavior (they would just sit in a settlement and do nothing).

In my opinion they should worry about fine tuning the balance of AI recruiting behavior after they've added all of the mechanics, for instance the notable relations.
 
Last edited:
I'm not relieved to see that there is obscure or dense complexity to these functions - none of us should be. It's not elegant, and its implementation in recent patches had led to a deterioration in the credibility of the AI simulation and wider game economy. This is hardly a fresh opinion - the dwindling playerbase on these forums seems to feel the same way.

I've sunk enough hours into the unmodded 1.4.2 game to state that the current setting of the parameters has killed the concept of war attrition - something that was actually functional in earlier iterations of the game, and was always core to the enjoyment of the franchise's lategame. I'm pretty convinced it's wage-skipping as it's the patch note that best explains the change in attrition pre-1.4 and post-1.4. I guess we'll have to wait and see, in their next patch, if they can address the issue - but frankly, my expectations are low. Critical mistakes like the player-centric diplomacy of 1.4.1 suggest that they do not have clarity on how some of their own functions interact, anymore.

Fingers crossed they come out of the code refactor with better foundations. After the long wait, if 1.4.3 proves as gaffe-prone as its predecessors, I suspect what little faith and goodwill is left will evaporate - and get redirected entirely to the mod community.
 
Last edited:
I've sunk enough hours into the unmodded 1.4.2 game to state that the current setting of the parameters has killed the concept of war attrition - something that was actually functional in earlier iterations of the game, and was always core to the enjoyment of the franchise's lategame.

That isn't really supported by the fact that the lords in 1.4.1/1.4.2 still have tons of denars on-hand. For wage skipping to be relevant, they need to be exceptionally poor for a lord; that is mostly restricted to clans without fiefs.

Personally, I have never been able to grind down a lord from repeated defeats in any patch since the initial wave of anti-bandit capture patches and even then it was the bandits repeatedly defeating them when weak rather than their money running out (this was back when post-battle gold loot wasn't capped, so you could easily get 50K denars from defeating a lord).
 
Last edited:
That isn't really supported by the fact that the lords in 1.4.1/1.4.2 still have tons of denars on-hand. For wage skipping to be relevant, they need to be exceptionally poor for a lord; that is mostly restricted to clans without fiefs.

I guess my question then should be... how do they get tons of denars on hand? Fiefs don't generate that much wealth anymore (especially early on, before they've been built up properly). AI Lords don't own workshops, or smith, or go on endless victory streaks like the player, or have the campaign speed to efficiently farm Looters/bandits, or own vast swaths of land (Rulers aside). How does an AI Clan with a single fief afford multiple full war parties + the fief's garrison in the first place, let alone build up the nest egg to refresh their armies after continuous defeats?
 
Last edited:
I guess my question then should be... how do they get tons of denars on hand? Fiefs don't generate that much wealth anymore (especially early on, before they've been built up properly). AI Lords don't own workshops, or smith, or go on endless victory streaks like the player, or own vast swaths of land (Rulers aside). How does an AI Clan with a single fief afford multiple full war parties + the fief's garrison in the first place?

Bannerman Man covered this:
Npcs obtain money in the same way that the player does. While players get 25% of their fief's prosperity as tax, npcs get 30%. They get their battle loot turned directly into gold, and get a good market price for the conversion (50% full value). They get tariffs from trade with their settlements at the same rate as the player. They also get money from ransoming troops/lords. They don't get workshops or caravans however. Here is a (likely outdated) breakdown of npc income by type.
Mexxico wrote:
In the table it was clearly seen battle loots are so important for Npc clans. Long peace times (identified as blue rectangles in table) damage kingdom's economy because lords cannot get loots, in opposite in war times kingdom clans get rich (red rectangles). As you see at table a kingdom's income source mainly comes from tax from towns / castles / villages but it is only 60% was not 80% like I expect. Remaining 35% come from battles. About 5% others (prisoners, etc).

They build up money because of battle loot*. Fief income works because their party costs are cheap: lots of lower-tier units in comparison to a player's usual high-end mix and they also tend to be smaller much of the time. Just look at the sizes of individual parties in an army and you'll find lots of them around 70 men or even lower.

So basically the initial advantage of fiefholding from the start of the game, followed by being able to stack up money from battle loot. And that income far surpasses the cost of raising and losing parties regularly.



*edited on review, I badly worded my post
 
... being able to stack up money from battle loot. And that income far surpasses the cost of raising and losing parties regularly.

This is a great insight: at 50% conversion of loot into gold, it makes sense that a single victory would allow an AI Clan to pay for a multitude of defeats, and would make attrition borderline impossible to achieve. It also sounds like a mistuned number, responsible for enabling denar inflation amongst AI Lords. The loot converts into vastly more gold than they spend building up armies. In theory if two AI foes defeat each other repeatedly in alternation, they will both spiral upwards in wealth rather than experience attrition. It's depressingly stupid, and runs counter to Mexxico's own stated intentions in the post - namely, for 80% of a kingdom's income to come from taxes.

Mind you, that was a 1.3.0 post from early May, before prosperity of settlements got sharply reduced. I'd be surprised if taxes accounted for even half of a kingdom's income in 1.4.2, that's how far we've backtracked on the vision.
 
Last edited:
I'm not relieved to see that there is obscure or dense complexity to these functions - none of us should be. It's not elegant, and its implementation in recent patches had led to a deterioration in the credibility of the AI simulation and wider game economy.
While some areas of the code are rougher than others, it's generally highly readable once you get used to it IMHO. Behavior functions are always going to be very complex though. That said, the refactor will certainly be welcome, because from an outsider's perspective it seems like the wrong methods get called in certain places, or they don't do exactly what the developer thought they did. I'm sure a lot of kinks will be worked out from this process.

This is a great insight: at 50% conversion of loot into gold, it makes sense that a single victory would allow an AI Clan to pay for a multitude of defeats, and would make attrition borderline impossible to achieve.
Counterintuitively, a defeat might actually gain a clan money, because the entire time they are imprisoned plus in their 2 day cooldown phase they are still collecting money from fiefs, but have one less party's worth of wages to pay. That all depends on how useful that vassal party was being with respect to earning loot and how much the party's wages were.

Also, ironically, I think one of the worst things for a clan's finances is actually being at peace. Not just because loot income dries up, but also because party wages continue to grow since the passive experience gain continues to level their troops over time. Without troops being regularly culled from clan parties by fighting and losing, they have no party space to withdraw garrison troops when their money dwindles and their expenses steadily outgrow their income and slowly drain their funds. Without a way for npcs to dismiss troops and/or intelligently manage troop upgrades this will always be a problem for peaceful factions.

Clans that are getting their parties wiped at a reasonable rate will be constantly pulling troops from their garrisons, and as a result their wages are more flexible and respond better to dips in clan wealth. Garrison size correlates somewhat well with clan wealth (this is because clan wealth has a direct impact on ideal garrison numbers).

I'm also not convinced that factions totally collapsing due to attrition from field battles is necessarily even a good thing. Is it more historical? Sure, but the player is currently much too strong in field battles compared to the AI and it would be trivial to ride around slaughtering npcs until they run out of money and then go clean up the fiefs afterwards. In my opinion, attrition should happen on a sliding scale that doesn't bottom out, but still lessens the resistance faced when sieging, etc.

The bottom line is that, at the moment, without the wage cheat the simulation will be more likely to destabilize over time without player intervention. It's not good game design to have the AI lose on their own because they are constrained by their own ruleset in such a way that they can't properly manage their finances to the point of bankruptcy and starvation. That's what was happening before (still does in some cases), but the devs were at least upfront about the change. Everything is still subject to change anyway.

It also sounds like a mistuned number, responsible for enabling denar inflation amongst AI Lords.
There's no doubt it's on the high side, but from the very start of a campaign the player can get a 35% conversion rate, and that bumps up to 37% by trade level 25 if you get the equipment perk. Don't forget, loot is also a huge source of income for the player too, and the player will have a much better win/loss ratio than any given npc.

Edit: You must also factor in plunder as well as loot. Each time a vassal is defeated the winning party gets 5% of the party gold as plunder. Since non clan leader parties only carry between 5000-10000 gold on them at a time, the plunder is approximately 250-500 gold, but if you take down a clan leader you will get 5% of their total clan gold (up to 10000g) as plunder. Therefore, it's more lucrative to target wealthy clan leaders. All of this gold is correctly withdrawn from the losing side's money.

Mind you, that was a 1.3.0 post from early May, before prosperity of settlements got sharply reduced. I'd be surprised if taxes accounted for even half of a kingdom's income in 1.4.2, that's how far we've backtracked on the vision.
Did you read this part of the post?
As conclusion, with a patch we will decrease loot income from battles (for only npcs, they get this income as gold instead of items for now, however there was no trade penalty applied, we will add that) by 50% and we will increase all tax incomes from settlements by 25%. This will make economy of kingdoms more stable, they will not need battles to save their economical balance, also player will get 25% better tax too.
They didn't have any trade penalty applied before, and now it sits at 50%. Prosperity may have gone down as a whole, but taxes also went up across the board. It would still be interesting to find out the current breakdown of npc income. Npcs appear to pull in roughly a couple thousand denars a day from taxes and tariffs, but it's hard to pin down a number for loot because it's so highly variable.
 
Last edited:
Back
Top Bottom