In this feature, I add a different way to restrict the number of militia one can have. The goal is to force the player to not throw away his militia, but care for them - in this case because volunteers are limited. Hopefully, this is simple enough and easy enough to understand - my features have a habit of becoming confusingly detailed, which can be somewhat confusing.

Anyway, to train militia you now need volunteers - a new troop 'uses up' a volunteer. City sectors have an estimated number of civilians living there (since the introduction of disease, see SectorNames.xml ). If you control city sectors, and people are loyal there, you get more volunteers. More town sectors -> more loyal people -> more volunteers. Higher loyalty -> more loyal people -> more volunteers.
To add a strategic component ( and to reward the player if he doesn't turtle in in towns), any farm you control gives you a small percentage boni on estimated total loyal citizens. Thus in order to maximize your recruitment pool, you need to control both towns and farms.
Each time you liberate a town sector for the first time, you get a huge initial influx of volunteers. After that, the volunteer numbers are updated every hour.
In the lower left of the strategic map, you can see your current volunteer pool, and how many volunteers you get every hour.
The growth of volunteers can be set in JA2Options.ini:

[Militia Volunteer Pool Settings]
; If MILITIA_VOLUNTEER_POOL is TRUE, we have a limited volunteer pool. If we train militia, the pool is lowered, if we run out
; of volunteers we cannot train militia anymore.
; Each town sector has an assumed civilian population (see SectorNames.xml) and a loyalty value (the percentage displayed next
; to a town's name in the strategic map). population times loyalty equals loyal population.
; toggles this feature on and off
MILITIA_VOLUNTEER_POOL = FALSE
; Every hour we get loyal population times this factor volunteers for each town sector we control.
MILITIA_VOLUNTEER_POOL_GAINFACTOR_HOURLY = 0.001
; If we liberate a sector for the first time, we get loyal population times this factor volunteers instantly.
MILITIA_VOLUNTEER_POOL_GAINFACTOR_LIBERATION = 0.2
; Global loyal population size is increased by this factor for every farm sector we control.
; The reasoning is that controlling food supplies shows our commitment to the common people, and eases the food situation tremendously.
MILITIA_VOLUNTEER_POOL_MULTIPLIER_FARM = 0.05

So if, say, a city has a population of 500, and is 50% loyal, you receive 500 * 0.5 * 0.001 = 0.25 volunteers for it every hour. As I just coded this, I haven't tested whether these values are reasonable in a campaign - this needs testing by, say, you.

Note that militia hired from a PMC or recruited from prisoners does not use up volunteers. These might be valid options if, well, the population lacks the proper revolutionary spirits.

It would be possible to add extra volunteers for certain quests/sector liberations (rebels fully join your forces, prison liberated etc.), but I would like this non-hardcoded, so that any modder can use this for his altered campaign. Currently unsure about the best way to achieve that. Coded in r7880. You get extra volunteers for liberating Tixa and Alma, and for recruiting Miguel.

This feature is off by default.

This is fully savegame compatible. However, when switching to an exe with this, your volunteer will start at 0. Depending on your campaign, this might be an issue at first :-)

Very cool. This is flat-out realistically great! With all the new militia mods I can see that I'm going to have re-do my entire tweaking of militia. Since all of your militia changes are so good, I won't mind a bit!

Seems like a very good idea to me. Especially with that farm bonus which might make one camp less Thanks!

I just wonder tough - when is farm controlled by me and when by the queen? When I enter a farmland sector, the number of hourly recruits doesn't change even on hour or beginning of a day. Even with sector, that was occupied by queen (but was explored previously).

This sounds like it will be amazing once the fine details are worked out. It finally encourages developing your militia well on a game-logic level, and also provides further rationale for the PMC guards if your volunteer count is too low.

I just wonder tough - when is farm controlled by me and when by the queen? When I enter a farmland sector, the number of hourly recruits doesn't change even on hour or beginning of a day. Even with sector, that was occupied by queen (but was explored previously).

Basically whoever last entered a sector unopposed or won a battle there controls it, with all sectors initially belonging to the queen. As farms give a bonus to basic volunteer gain (+x%), but do not generate volunteers themselves, the effect might be very small in the beginning. Perhaps this might be the issue?

Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Because my current game is unplayable due to bug, I decided to start a new one and try "big bonus on farms, low base growth" aproach to this feature. This requires farms to be guarded. Here is content of GarrisonGroups.xml where all farms have garrison , type 25 - standard road block (except those already guarded otherwise).

This feature works for me greatly. I was just wondering, if I won't eventually be having too many volunteers. So I have this feature idea for you to consider.

What if after each battle certain percent of you volunteers quit? Like 1% for each milita casualty, may be a bit less. May be for every casualty over certain number, like 10. That way, if you let you militia bleed in some huge battle, most of them will realize freedom is overrated anyway and it will force you to make sure you keep those farms in your hands, so that you rebuild quickly.

As of r7880 & GameDir r2246, there are 2 new functions in Scripts/strategicmap.lua:

HandleSectorLiberation(...) is called whenever we liberate a sector, if fFirstTime is true, then this is the first time

RecruitRPCAdditionalHandling(...) is called whenever we recruit a RPC

For now, this is used to give us extra volunteers if we liberate Tixa and Alma prison, or recruit Miguel, as this would be the point all remaining rebels join us. It would be cool if the 2 armed rebels in Omerta basement would join as full militia, but there are some issues with that (like the fact that militia are essentially forbidden undergound).

Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

As of r8431 & GameDir r2379,
- recruiting any of the rebels gives you a small amount of volunteers, to show you the rebels are gradually joining your side.
- volunteers are now gained with a logarithmic rate, as otherwise the volunteer feature becomes pointless lategame. Previously you got to a point where you got so many volunteers that you'd have a hard time to even lower the pool. The formula is now

with MILITIA_VOLUNTEER_POOL_GAINFACTOR_HOURLY now switched to 0.002 from 0.001 previously. This means that in the beginning, we will get volunteers a bit faster, while later on not as much. I'll leave to those interested to plot where the break even point is

[Updated on: Tue, 25 July 2017 23:46]

Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.