Total War: WARHAMMER III

Total War: WARHAMMER III

Mortals, Mercs and Management
Maska_zgz 9 Aug, 2023 @ 5:08am
Exploring Recruitment Logic and Population Dynamics in Your Mod
Hi, _Zorbaz. I love this mod. I create the load order for me and my friends, currently having a list created of about 130 mods, working almost perfectly together thanks to about 30 patches and own versions that I have created, although many have not yet uploaded to the workshop, in addition to 3 or 4 complex and complete mods of own manufacture from scratch.

I am explaining all this to you to put you in the context of the situation that has led me to study each of the mods in depth, even reading the complete scripts of the mods. I want to create the best possible gaming experience for myself and my friends within the parameters of how we like to play. Very demanding, strategic, realistic and bordering on hardcore survival.

Now that I have brought you up to date on my reasons, I want to expose you some issues and questions regarding the code of this mod.
< >
Showing 1-15 of 15 comments
Maska_zgz 9 Aug, 2023 @ 5:10am 
The first of them is recruitment. In game, and without me modifying any of the original code, I have found that every time the AI runs out of the type of population needed to create a troop, which happens rarely, but is easy to force using certain command tools of the workshop, the AI gets stuck in their cities with an army that they could try to efficiently use to reclaim land, but they don't, because the AI thinks they can continue to recruit troops, but can't do it efficiently for this mod.

The AI stays almost indefinitely in the cities recruiting several almost empty units thanks to the predictive troop input each turn (7 out of 90 troops, for example) and merging them when it can. Testing the problem, I have exterminated the population of my own faction until no one was left in the city, and in this experiment, I was still able to recruit troops, but not a minimum troop of 1 for example (although the best thing would be not being able to recruit anything) . Recruitment has been normal, that is, I have recruited 90 lancers with 0 population required.

I have searched for a function that regulates the recruitment of troops without success. There are several functions that are based on whether or not there is adequate population for, for example, the replacement of casualties or to show the appropriate icons, but I have not found anything that regulates recruitment and its requirements.

I think the mod, and especially the AI factions, would greatly benefit from a restriction that is: "If there is not enough population for a complete unit to be created, it cannot be recruited."

I'm experimenting with a function that uses the same parameters as the "kiki_pop.calculateRegionForReplenishment" function, especially: "if nPopInProvince < nTroopsToFullHeal then" to avoid recruitment in that circumstance. But no success for now. And the subject interests me very much, because doing this would make the population compared to the military in the mod not a simple useless number, as a friend of mine says. It would really be a handicap and it would help the AI to not get stuck recruiting garbage, I hope.

Can you give me your opinion about it and perhaps guide me a bit on how to solve the problem? Thank you very much for reading me, for your patience, your work and for your possible help.
_Zevon  [developer] 10 Aug, 2023 @ 2:20pm 
As far as I know the solution was worse than the problem. If you do find a way to shut off the recruitment because there isn't enough pop I would be glad to put it in. As it stands there isn't really a way to do that.
DarkStar 10 Aug, 2023 @ 8:10pm 
Hello maska :)

I was wondering if I could ask about the mods you and your friends use in your games. The ones that add more strategy, realism and survival to the game.

That seems right up my alley and I was wondering if you could steer me in the right direction. Any help would be greatly appreciated, since this game seems to lack any depth, strategy, or difficulty.

Anything relating to lower replenishment, stiffer economy, slower recruitment, slower growth etc etc...
DarkStar 10 Aug, 2023 @ 8:11pm 
Zorbaz thank you for this mod. Loving it so far.
Maska_zgz 11 Aug, 2023 @ 1:19am 
@_Zorbaz: I've been trying for several days, I've tried various methods of approaching the problem, but I can't deactivate the recruitment. I've even gotten the troops in a newly recruited unit to be 0, but it still gives you the option to recruit. Which makes the AI go into an endless loop of useless recruitment, which only makes the game easier, and not the other way around, since the player knows how to avoid the problem, but the AI doesn't know how to avoid it. And he only stays in his city recruiting to almost infinity...

I'll keep trying, that's for sure. But for now I will leave it in the background to finish my other projects. And I will keep trying because, as it is currently, the population is more of a placebo effect than anything else in the military field. Except for casualty resupply, of course. But outside of there, it's really useless. And it's a pity. And before anyone says otherwise, I've in-game tested and examined the scripts of all mod versions since Warhammer 2, and the exact same problem occurs.

Anyway, the mod is absolutely brilliant. Thanks for everything. If I have any other questions I will put it here, so as not to dirty the mod thread. Thank you for answering me.

@BlackJack: No problem, but I haven't finished my patches, mods, and adaptations yet, so I'm going to keep the list hidden until I get everything set up right. Also, with the new update coming at the end of this month, some things may need to be changed, so the future is not yet clear. But I will keep you in mind, and when I release the list I will inform you first, so that you can try it. Thanks for the interest.
Last edited by Maska_zgz; 11 Aug, 2023 @ 1:25am
DarkStar 11 Aug, 2023 @ 6:06am 
Alright sounds good!
Maska_zgz 15 Aug, 2023 @ 1:33am 
Hello again, _Zorbaz. I continue to work tirelessly, many hours a day, on the problem of preventing recruitment if there is not enough population. I'm going to try to be clear and concise with my explanations, since I've tried so many different things that it would take me hours to explain everything, so I'm going to summarize everything in a spartan way.

After many attempts (dozens of hours trying) to avoid recruiting directly via scripting, I have seen that you are right, it seems impossible in the current conditions. I was about to give up, but suddenly I thought: "Okay, I can't directly attack the problem and deny the recruit action with a script that is within the reach of my abilities, but I can use the automatic ways that the game has to deny the recruit action. For example, the price of the units."

After several tests, I have seen that I could create a script with a much higher complexity, covering all units in the game, based on their nUnitSize, but first I wanted to do something basic, functional and with less complications, to see if it would work.

And here is the problem. I already have the script working, which awards an invisible bundle that increases the price of units to unreachable limits and that is updated when the character is selected and/or when he is moved, so if he moves to a region with recruitment capacity at the end of the movement it will update its status by removing the bundle and allowing recruitment.

The problem is that I am not able to properly invoke the parameters of your mod to use them as conditions, since, no matter how hard I fix the wrong values that appear, in the end I always find a nil value that I cannot repair. I have tried a multitude of code variants of your mod, located in functions and listeners, both using them exactly, and in a more free way, and in the end the same thing always happens. Failed in the last step:

I need to correctly access the population of the current region where the character is, for if there is not enough population of the right type, the bundle will be awarded and consequently, the recruitment will be deactivated due to lack of funds. And if it moves to another region that has enough population, the bundle will be removed. Once I get access to the population data, I can grow the script in complexity.

At the moment, with being able to access the data of strTroopType, nUnitSize, strRaceUsed and thereby finally knowing nPopInProvince, I can start with denying the recruit "if nPopInProvince < 100 then" for example, and if that works increase the complexity.

Please, could you guide me with the necessary code to access without problems the information of the population of each type in the region?

Thanks for your patience and help. The more I dig into the code for this mod, the more I like it. Is incredible. Thanks a lot.
_Zevon  [developer] 15 Aug, 2023 @ 8:58am 
@Maska_zgz! You should message me on discord. I check this it a lot more frequently and there I can share files and integrate any changes we make in a better way. If you are on my discord server please message me directly and we can continue this conversation there. As it stands you have done a lot more research on the problem then I have in the last days. The option I was looking at comes from the old Dived Et Impera mod on Rome 2 as recommended by another modder friend. I'm not sure if it is possible, but we could discuss it.
_Zevon  [developer] 15 Aug, 2023 @ 8:59am 
@BlackJack. I use tabletop caps, as well as my own custom battle mod that slows down battles and other minor tweaks.
DarkStar 15 Aug, 2023 @ 3:15pm 
@_Zorbaz TT caps is awesome.

I also use the 'realism' mod in conjuction with your population mod and thats pretty awesome. It really adds some depth to the campaign map and also some more strategic value to the battle side of things. The realism mod also adds a modicum of depth to the campaign side.
Жидомир 6 Oct, 2023 @ 1:12pm 
Hello every , does somebody know how can I make UI smaller because it hides panel of population
_Zevon  [developer] 6 Oct, 2023 @ 1:18pm 
You can't really make the UI smaller, but you can click and drag the Pop Mod's Region and Province panels around the screen.
sarumanthecursed 22 Jul, 2024 @ 4:11pm 
Originally posted by Maska_zgz:
Hello again, _Zorbaz. I continue to work tirelessly, many hours a day, on the problem of preventing recruitment if there is not enough population. I'm going to try to be clear and concise with my explanations, since I've tried so many different things that it would take me hours to explain everything, so I'm going to summarize everything in a spartan way.

After many attempts (dozens of hours trying) to avoid recruiting directly via scripting, I have seen that you are right, it seems impossible in the current conditions. I was about to give up, but suddenly I thought: "Okay, I can't directly attack the problem and deny the recruit action with a script that is within the reach of my abilities, but I can use the automatic ways that the game has to deny the recruit action. For example, the price of the units."

After several tests, I have seen that I could create a script with a much higher complexity, covering all units in the game, based on their nUnitSize, but first I wanted to do something basic, functional and with less complications, to see if it would work.

And here is the problem. I already have the script working, which awards an invisible bundle that increases the price of units to unreachable limits and that is updated when the character is selected and/or when he is moved, so if he moves to a region with recruitment capacity at the end of the movement it will update its status by removing the bundle and allowing recruitment.

The problem is that I am not able to properly invoke the parameters of your mod to use them as conditions, since, no matter how hard I fix the wrong values that appear, in the end I always find a nil value that I cannot repair. I have tried a multitude of code variants of your mod, located in functions and listeners, both using them exactly, and in a more free way, and in the end the same thing always happens. Failed in the last step:

I need to correctly access the population of the current region where the character is, for if there is not enough population of the right type, the bundle will be awarded and consequently, the recruitment will be deactivated due to lack of funds. And if it moves to another region that has enough population, the bundle will be removed. Once I get access to the population data, I can grow the script in complexity.

At the moment, with being able to access the data of strTroopType, nUnitSize, strRaceUsed and thereby finally knowing nPopInProvince, I can start with denying the recruit "if nPopInProvince < 100 then" for example, and if that works increase the complexity.

Please, could you guide me with the necessary code to access without problems the information of the population of each type in the region?

Thanks for your patience and help. The more I dig into the code for this mod, the more I like it. Is incredible. Thanks a lot.

very fascinating discussion.
Did you both find a solution?

I too would be interested to know about your mod list that increase the strategic aspect of the game.

cheers you geniuses.
_Zevon  [developer] 22 Jul, 2024 @ 5:23pm 
Sadly, we haven't made much head way. Life has been rather nuts on my end and something had to be cut. It was my gaming and modding.
Last edited by _Zevon; 22 Jul, 2024 @ 5:23pm
LeFr33man 19 Aug, 2024 @ 3:43am 
I feel silly after reading your in depth discussion regarding logical parameters to further improve the mod experience provided here. Because i was wondering if some text could be change. For instance on resplenishement info ( when hoovering above green + cross on unit card) it is written : "will consume" but it could be " will conscript " or " will recruit " . In my opinion, those surface level changes can modifiy the experience as in depth structural coherency. Thanks for your time lads :) great great great mod btw !
< >
Showing 1-15 of 15 comments
Per page: 1530 50