As explained elsewhere, while I am happy with the way equippable militia works, this feature can require quite a bit of item micromanagement. If you use hundreds of militia offensively, the gear you would like to use will be on some battlefield, while you still train your militia in towns. This then requires you to either move unequipped militia around (which can result in a bloodbath if the enemy breaks through) or to move potentially thousands of items, over an over again.

In my current increased team size game, that is simply too much. Nevertheless, I play with Drop All, and I want all that gear to be used for my militia. I could simply sell it via SELL_ITEMS_WITH_ALT_LMB, but then most of my income would be from those sales. Financing a war by slaughtering armies and then selling their weapons to random peasants strikes me as a bit... unwise.

This feature aims to be a viable alternative to this: militia training and promotions now require resources. We can get these resources by converting items:

If we don't have enough resources, the training/promotion won't happen. Unless we play with individual militia, promotions not happening will effectively be lost (with that feature on, the promotions will happen later on if we have the required resources again and unload a sector with the to-be-promoted militia).

Resources will be spent when we obtain militia by interrogation (we need to equip them after all, they had no guns in prison ), but not if we recruit them from a PMC (those guys bring their gear along).
The equipment the militia will use will simply be defined, like that of the enemy, in the TableData/Inventory xmls.
Items can be converted into resources in the sector inventory by pressing [Alt] + [RMB], similar to how SELL_ITEMS_WITH_ALT_LMB works. If you also press [Shift], an entire item stack will be converted. If you also press [y] (germans might want to press [z] instead), all items of that item number will be sold, so you can rapidly convert gear. While you press [Alt], you will see the resources you would gain by conversion on each item. This takes into account loaded ammo and attachments.
Resources will be shown in the strategic map while the Militia view is active. The colours here correspond to the colours in the inventory.

The resource value of an item is determined by its status, coolness, class specific modifiers, and the highest game progress reached so far.
Every time the highest game progress is increased, our resources are devalued (to represent gear being outdated). Due to the way it is coded, it doesn't make a difference (resource-wise) if you convert a gun at progress 10 and then wait until progress 50, or if you only convert it at progress 50 - in both cases, the value at progress 50 will be the same. This is to stop weird player behaviour, like stocking tons of guns intended for conversion simply to get a better rate. It has to be noted, though, that you train more militia from the same gear early on, but that is more of a personnel bottleneck than a resource one.

[Militia Resource Settings]
;******************************************************************************************************************************
; These settings control whether we require resources to train and upgrade militia
;******************************************************************************************************************************
;------------------------------------------------------------------------------------------------------------------------------
; If this feature is used, the player can convert items to get 3 resources:
; Guns: obtained from weapons, ammo
; Armour: obtained from helmets, vests, pants, LBE and face items
; Miscellaneous: obtained from melee weapons, launchers, grenades and bombs
;
; Whenever we train or promote militia, we spend these resources:
; - A green militia requires 1 Gun.
; - A promotion from green to regular militia requires 1 Gun + 1 Armour.
; - A promotion from regular to elite militia requires 1 Gun + 1 Armour + 1 Misc..
;
; If we don't have enough resources, the training/promotion won't happen.
;
; Resources will be spent when we obtain militia by interrogation, but not if we recruit them from a PMC.
;
; Items can be converted into resources in the sector inventory by pressing [Alt] + [Shift] + [LMB], similar to how
; SELL_ITEMS_WITH_ALT_LMB works.
; Resources will be shown in the strategic map while the Militia view is active.
;
; Every time the maximum game progress increases, the resource pool is multiplied by the fraction of new and old progress.
;
; This feature requires MILITIA_USE_SECTOR_EQUIPMENT to be FALSE.
;------------------------------------------------------------------------------------------------------------------------------
; if set to true, militia will take parts of its equipment from a sector's inventory.
MILITIA_REQUIRE_RESOURCES = FALSE
; The resource value of an item is determined by its status, coolness, class specific modifiers, and the highest game progress reached so far.
; progress modifier is MILITIA_RESOURCES_PROGRESSFACTOR / highest progress so far
; values between 1.0 and 100.0, 10.0 recommended default
MILITIA_RESOURCES_PROGRESSFACTOR = 10.0
; class specific modifiers, values between 0.0 and 1.0
; ammo modifier PER SINGLE BULLET. Note that coolness is not derived from the item's coolness, but the coolness of the crate item corresponding to this ammotype and caliber
MILITIA_RESOURCES_ITEMCLASSMOD_AMMO_BULLET = 0.01
; the gun modifier covers all guns and launchers
MILITIA_RESOURCES_ITEMCLASSMOD_GUN = 1.0
MILITIA_RESOURCES_ITEMCLASSMOD_ARMOUR = 1.0
MILITIA_RESOURCES_ITEMCLASSMOD_MELEE = 0.25
MILITIA_RESOURCES_ITEMCLASSMOD_BOMB = 0.25
MILITIA_RESOURCES_ITEMCLASSMOD_GRENADE = 0.17
MILITIA_RESOURCES_ITEMCLASSMOD_FACE = 0.2
MILITIA_RESOURCES_ITEMCLASSMOD_LBE = 0.17
; Different attachments have multiple modifiers. They also attribute to different resources
MILITIA_RESOURCES_ITEMCLASSMOD_ATTACHMENT_LOW = 0.05
MILITIA_RESOURCES_ITEMCLASSMOD_ATTACHMENT_MEDIUM = 0.1
MILITIA_RESOURCES_ITEMCLASSMOD_ATTACHMENT_HIGH = 0.2
; guns are further modified by a weapon class specific modifier
MILITIA_RESOURCES_WEAPONMOD_PISTOL = 0.6
MILITIA_RESOURCES_WEAPONMOD_M_PISTOL = 0.7
MILITIA_RESOURCES_WEAPONMOD_SMG = 0.8
MILITIA_RESOURCES_WEAPONMOD_RIFLE = 0.9
MILITIA_RESOURCES_WEAPONMOD_SN_RIFLE = 1.0
MILITIA_RESOURCES_WEAPONMOD_AS_RIFLE = 1.0
MILITIA_RESOURCES_WEAPONMOD_LMG = 1.0
MILITIA_RESOURCES_WEAPONMOD_SHOTGUN = 1.0

These ini values are just defaults, I haven't tested them extensively. Let me know how they work.

This feature is off by default, and it requires equippable militia to be off to work, as those two cannot be used at the same time, because I say so. As we have to convert items to be able to train militia, activating this in an existing campaign might be easier or harder than intended, depends on how much gear you have stored.

This feature is fully savegame compatible.

This feature has been added to the trunk in r8271 & GameDir r2330. Using the new exe without the new GameDir will do... nothing. Or... does it?.

Edit: silversurfer improved this feature in r8275.

[Updated on: Fri, 22 July 2016 22: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.

1. The feature looks strange when SELL_ITEMS_WITH_ALT_LMB is active. The font color for weapons and ammo could use some more power.
2. It's not possible to convert only the first item of a stack because that's not implemented. We can only convert a whole stack by pressing ALT + Shift + LMB. I'd prefer the "sell items" behaviour but currently both systems seem to be in conflict with each other because they are using the same hotkey functionality.
3. Resources are not displayed on the map screen when "militia" button is active. I need to figure out why this happens in my game.

1. Fair enough, committed in r8274.
2. Well, yes. We have a severe lack of keys (I'm not adding absurd combinations here, like [Alt] + [Shift] + [LMB] + [y] + [other key]).
3. No idea - perhaps you still have MILITIA_USE_SECTOR_EQUIPMENT set to TRUE? It needs to be set to FALSE.

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.

This feature at least forces us to "pay" something for the militia's equipment, which is a great thing.

A few minor points, though:
- you cannot give a few militia a certain gun that you prefer them to have, not even a gun-type (some extra guys with a colt commando could come in handy... Would be cool to create some guards for your supporting personnel like Flo, mechanics, etc. or some guys to accompany you with the weapons you prefer, especially now that you have an organisation like Kerberus.
- there is still a lot of difference in price between some pea-shooter and a decent sniper rifle which is not really reflected in this new resource system, but that may be a matter of opinion.

Don't get me wrong here, I welcome any creative optional add-on to the game - nice job again, Flugente! ;)

- Well... you can have a militia squad that you order to move in strategic whenever Flo etc. move, so they kinda 'follow' her. As far as equipping militia goes - hand-equipping militia would be absurdly tedious. While we could store their inventory (in condensed form) in the individual militia profiles (which I originally planned to do), not only would this require a staggering amount of UI work, this would also mean we would have to constantly manage their inventory. Managing inventory for 64 mercs is already tedious at times. Managing hundreds of militia would be painful.

I do somewhat get the appeal though

- Well... yeah. This feature essentially is a very broad simplification, as such, this has to be expected. Though have a look at the ini values - you can set some modifiers so that, for example, pistols always give less resources than sniper rifles etc.

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.

- Yeah, I understand, I wouldn't like to equip hundreds of militia either. Just a few that matter something more to you. And I guess it isn't really possible or a hell of a coding job to be able to equip only the few that really matter, like (some of) the veterans...

I get the guns, armour, misc and volunteers and have enough of guns and 22 volunteers to train with 62% approval, but when I train with a merc and is completed, no militia shows up when training is done?

Usually you need some kind of facility that allows training but if that facility wasn't there the option to train wouldn't even be available. So regarding axor01's problem I have no idea how that can happen. When we train militia the new militia should appear in the training sector and if that is already full they should spawn in another town sector that we control. Training cannot fail as far as I know.

I am speechless. This is such a brilliant feature, I cannot wait to test it out. I have always wanted something like this, something in between discount selling gear and lugging it around to give it to militia manually.

Since this feature removes the possibility to manually equip militias - would it be possible to have an option when starting training to select more/better equipment, i.e. higher resource costs, resulting the coolness factor of militia gear going up?

Maybe, if this was expanded into a whole new feature, one could make sure that all trained militia wear 3 pieces of armour, etc.?

i have a problem, when i train militia with the new feature milita requires resources.
I startet a new game and set ALLOW_TRAINING_ELITE_MILITIA = TRUE. I use the new feature MILITIA_REQUIRE_RESOURCES = TRUE (nice work and good idea by the way). I convert some items to train milita (ca. 135 guns, 100 armour and 2,8 misc) and set LEADERSHIP_AFFECTS_MILITIA_QUANTITY = FALSE.

After training militia i get 3 elite militia, not 10 regular as i expected (payed 750 bucks).

So i start some experiments.

1) If i train the next militia squad i get no militia (ca. 80 guns, 80 armour and 0,4 misc at training start of 2nd militia squad).
2) If i add some misc items (~2.2), i get some elite militia. When i change before ALLOW_TRAINING_ELITE_MILITIA = FALSE, 2 veteran militia joined my army.
3) If i set MILITIA_REQUIRE_RESOURCES = FALSE all is working normal (10 regular militia spawn after training is finished).

I´d like to play with the new resource system, but is this a bug or do i something wrong?