Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: militia resources
New feature: militia resources[message #346251] Fri, 15 July 2016 22:09 Go to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
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:

  • 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. 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 aww), 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.
http://i.imgur.com/5C03Vym.png
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.
http://i.imgur.com/XWLPSFl.png
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.

For more details, see JA2_Options.ini:
Toggle Spoiler


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]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

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.

Report message to a moderator

Captain

Re: New feature: militia resources[message #346266 is a reply to message #346251] Sat, 16 July 2016 16:06 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
Ok, I've tested a bit and have some feedback:

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.

[Updated on: Sat, 16 July 2016 16:17]




Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New feature: militia resources[message #346269 is a reply to message #346266] Sun, 17 July 2016 00:07 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
Regarding 1) I would change the following in function "RenderItemInPoolSlot" in "Map Screen Interface Map Inventory.cpp":

1. left align the values:
swprintf( sString, L"%-5.2f", dvalue_Gun );


2. add some space between the lines:
sY += usFontHeight + 2;


3. use a different color for gun points:
Instead of "FONT_BEIGE" use "FONT_ORANGE". I find that much better to read.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New feature: militia resources[message #346272 is a reply to message #346269] Sun, 17 July 2016 00:59 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
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.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

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.

Report message to a moderator

Captain

Re: New feature: militia resources[message #346288 is a reply to message #346272] Sun, 17 July 2016 16:36 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
Flugente, I hope you don't mind that I changed and fixed a few things in r8275. Please update your feature description in the opening post.

Here is the change log:
Fix:
- price and militia resource points display in sector inventory was incorrect and didn't take Shift key into account (ancient bug that nobody ever seemed to have noticed)
- display of militia resource below the map didn't work if MILITIA_VOLUNTEER_POOL was FALSE (this fixes point 3 from my previous post)

Enhancements:
- militia resource points display below map now better organized
- militia resource points display below map now available when in sector inventory and pressing ALT key
- conversion of items to militia resource points now available with ALT + RMB, ALT + Shift + RMB and ALT + Shift + Y + RMB just like quick sell feature works (this takes care of point 2 from my previous post)


Here is a picture of how the display looks now:
http://picload.org/image/rradpipg/inventory.jpg

[Updated on: Sun, 17 July 2016 16:36]




Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New feature: militia resources[message #346291 is a reply to message #346288] Sun, 17 July 2016 18:28 Go to previous messageGo to next message
Uriens is currently offline Uriens

 
Messages:345
Registered:July 2006
So basically left click to sell, right click to convert to resources?

Report message to a moderator

Master Sergeant
Re: New feature: militia resources[message #346293 is a reply to message #346291] Sun, 17 July 2016 19:49 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
Exactly. I wanted it to be as logical and user friendly as possible.


Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New feature: militia resources[message #346296 is a reply to message #346293] Mon, 18 July 2016 20:10 Go to previous messageGo to next message
bigalmoho is currently offline bigalmoho

 
Messages:35
Registered:January 2016
Excellent new feature plus some fine tweaking!
Teamwork delivers the goods!

Report message to a moderator

Private 1st Class
Re: New feature: militia resources[message #346303 is a reply to message #346296] Tue, 19 July 2016 13:00 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
@silversurfer: Good work! I'll see to it when I'm back home again.

Edit: Or more precise, after I can get on svn again.

Edit2: Finally updated description in opening post.

[Updated on: Fri, 22 July 2016 22:47]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

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.

Report message to a moderator

Captain

Re: New feature: militia resources[message #346344 is a reply to message #346251] Sat, 23 July 2016 12:16 Go to previous messageGo to next message
Panzer is currently offline Panzer

 
Messages:89
Registered:February 2016
Location: Altis, Sometimes Tanoa
Cool feature, but not for me, I like having my absolute tyrannical control. ;)
Being serious, I don't find the current system problematic personally. Maybe I'm just great at management.



I have no Wife, Children, or real Job. This also means I have 24 hours a day and 7 days a week to think of a rebuttal. You have been warned.

"I got another problem: I am being overrun by Dinosaur Nazis on Hoverboards!" -Ravenhugger

"Before you judge a man, walk a mile in his shoes. After that who cares? He's a mile away - and you've got his shoes!" - Unknown Criminal

Report message to a moderator

Corporal 1st Class
Re: New feature: militia resources[message #346364 is a reply to message #346344] Mon, 25 July 2016 00:42 Go to previous messageGo to next message
Thor is currently offline Thor

 
Messages:423
Registered:February 2007
Location: Belgium
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! ;)

[Updated on: Mon, 25 July 2016 00:45]

Report message to a moderator

Master Sergeant
Re: New feature: militia resources[message #346365 is a reply to message #346364] Mon, 25 July 2016 13:57 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
- 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 aww

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




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

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.

Report message to a moderator

Captain

Re: New feature: militia resources[message #346367 is a reply to message #346365] Mon, 25 July 2016 17:25 Go to previous messageGo to next message
Thor is currently offline Thor

 
Messages:423
Registered:February 2007
Location: Belgium
- Yeah, I understand, I wouldn't like to equip hundreds of militia either. happy 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...

- Good that you mention this ini setting, I like that!

Report message to a moderator

Master Sergeant
Re: New feature: militia resources[message #346469 is a reply to message #346367] Thu, 04 August 2016 07:58 Go to previous messageGo to next message
SchmittLenin is currently offline SchmittLenin

 
Messages:30
Registered:August 2015
Nice work!


Lurking is nice

Report message to a moderator

Private 1st Class
Re: New feature: militia resources[message #347082 is a reply to message #346469] Tue, 27 September 2016 09:20 Go to previous messageGo to next message
axor01 is currently offline axor01

 
Messages:31
Registered:July 2013
Location: RSA
Hi All.

Started new game with new features active, and militia recruitment.

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?

PS. Do I need to control ALL the sectors in a town first?

Is there a chance training can fail?

[Updated on: Tue, 27 September 2016 09:26]

Report message to a moderator

Private 1st Class
Re: New feature: militia resources[message #347118 is a reply to message #347082] Sun, 02 October 2016 10:59 Go to previous messageGo to next message
SchmittLenin is currently offline SchmittLenin

 
Messages:30
Registered:August 2015
Don't you need to train them from that police building thing?


Lurking is nice

Report message to a moderator

Private 1st Class
Re: New feature: militia resources[message #347124 is a reply to message #347118] Sun, 02 October 2016 17:39 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
SchmittLenin wrote on Sun, 02 October 2016 09:59
Don't you need to train them from that police building thing?

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.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New feature: militia resources[message #347987 is a reply to message #347124] Mon, 02 January 2017 23:18 Go to previous messageGo to next message
Vincent J. Claymore is currently offline Vincent J. Claymore

 
Messages:285
Registered:February 2011
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.

Fantastic job, Flugente.

Report message to a moderator

Master Sergeant
Re: New feature: militia resources[message #348042 is a reply to message #347987] Wed, 04 January 2017 11:50 Go to previous messageGo to next message
Vincent J. Claymore is currently offline Vincent J. Claymore

 
Messages:285
Registered:February 2011
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.?

Report message to a moderator

Master Sergeant
Re: New feature: militia resources[message #350965 is a reply to message #346251] Thu, 14 September 2017 15:45 Go to previous messageGo to next message
BumBum_tot is currently offline BumBum_tot
Messages:1
Registered:September 2017
Location: Germany
Hello,

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?




Report message to a moderator

Civilian
Re: New feature: militia resources[message #350967 is a reply to message #350965] Thu, 14 September 2017 21:09 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Hi BumBum_tot, welcome to the pit!

The bug is that, as you've observed, the bug is that presence of misc resource is always required, even if it isn't needed for the militia. You can avoid that bug by having more of that resource.

In fact, someone else recently reported this bug, it was fixed in r8456. The newest SCI should already have that, or you can wait for the next SCI (which should come about tomorrow or so).



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

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.

Report message to a moderator

Captain

Re: New feature: militia resources[message #361970 is a reply to message #350967] Tue, 01 December 2020 22:31 Go to previous messageGo to next message
blaa is currently offline blaa

 
Messages:26
Registered:May 2009
Location: -
It´s too bad there is no possibility to remove game progress from the equation. I started the game and a pistol was worth 13 points. So I kill one guy with a pistol and can train 13 militias out of it, makes no sense at all. So I tuned it so I got roughly a 1:1 ratio. I capture Drassen airport and could train 18 troops. I conquer the next sector and suddenly I can only train 9 troops! Again makes no sense at all, the values just going down wildly as you make minor progress.

This would be a good feature if it was somewhere along those lines: All items always have the same value. Ideally a gun is worth 0.x points and the rest can be reached by converting ammo. A rookie needs pistol or any other weapon. A regular needs at least piece of armor and a machine pistol or better. A elite needs more armor and an AR, shotgun or rifle.

Sadly, both militia features are basically broken in fundamental ways:

This one makes no sense. In fact them bringing their own weapons makes more sense than this feature with the values going all over the place. And the other one has you carrying around stuff behind your militia every time you use the "request backup" function aka a usability nightmare. Both features sound great on paper and are terribly flawed in praxis.

I ended up balancing militia cost around the monetary values of alt+lmb selling.

[Updated on: Tue, 01 December 2020 23:49]

Report message to a moderator

Private 1st Class
Re: New feature: militia resources[message #361971 is a reply to message #361970] Wed, 02 December 2020 13:31 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
This feature was never intended to always have a 1:1 ratio. If you want that, you can simply outfit your militia directly.


Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New feature: militia resources[message #361972 is a reply to message #361971] Wed, 02 December 2020 15:17 Go to previous messageGo to next message
blaa is currently offline blaa

 
Messages:26
Registered:May 2009
Location: -
But then the issue is with carrying the gear behind them. You have 15 militia with weapons in one sector and 15 in another. One sector gets invaded, you press "request backup from other sectors". They win the fight. You have 30 militia with weapons in one sector, 0 in the other. You redistribute 15 militia to their original sector. One sector has 15 militia and 0 guns, the other has 15 militia and 30 guns.

If you can tell me how to avoid that, I´ll gladly use the feature again. I asked on the discord and nobody knew. That was the big issue that stopped me from using sector inventory militia.

As for the resource feature, it just makes no sense to me, sorry. It honestly makes more sense to see what you can sell a pistol for, then calculate some ammo and roughly make one green militia cost that. There is literally no reason for the extra gun resource when values fluctuate like crazy. Again, just from conquering two sectors it halved the militia I could train. 18 gun resources at no sectors, 15 airport, 9 c13. Halved! For that little progress. thumbs down Not to mention how weird it is to see your resources go down "just because". You conquer a sector and suddenly you can train less people. Did the guns rot away in 30 minutes?

And btw, I love most of the features Flugente did. Just the two militia features are neither quite here nor quite there imo.

[Updated on: Wed, 02 December 2020 16:08]

Report message to a moderator

Private 1st Class
Re: New feature: militia resources[message #361976 is a reply to message #346269] Thu, 03 December 2020 11:10 Go to previous messageGo to next message
robertstevens is currently offline robertstevens

 
Messages:6
Registered:November 2020
Nice

Report message to a moderator

Private
Re: New feature: militia resources[message #362814 is a reply to message #346251] Tue, 06 April 2021 16:58 Go to previous message
No-Nothing is currently offline No-Nothing

 
Messages:81
Registered:March 2013
Hello!
This resources system is good idea and works fine, but for me it is interesting rather by its part involving handling of inventory. It just because I am since long prefer equipment system. Till now I don't want to use equipment system cause it intervenes into my general inventory too much! So your new system gives a hint solving this problem.
Instead of sending stuff to resources you send them into your completely isolated army inventory. Army inventory divides itself into 3 ones, for each militia rank. Every army inventory is an exact copy of general inventory so there is absolutely no need for new GUI! You just need 1 button to cycle through general --> admin --> regular --> veteran --> general inventory or better 4 buttons for each. In admin inventory you send items to regular, in regular inventory to veteran, in veteran inventory back to admin.
Now you transfer all your equip militia practice to these army inventories. They can call it the hybrid version between resources system & equipment system and important note here I see this hybrid system as replacement for (useless for me) equipment system, not resources system! And yes army inventory is magical inventory available everywhere you have militia. No more magic here as with resources system by-the-by... that why I called it hybrid.
Tiny note: I would like to have the hotkey "convert all items to resources / send all to army inventory". I wonder why you didn't do this straight away.
Important note: enemy soldiers restricted to some limits. Admins have poor equipment, regular better stuff. Militia has to be balanced accordingly. You may put cool items to admin inventory, but admin militia may not use them. This can be controlled by <ubCoolness>x</ubCoolness> entry. It has nothing to do with reality or something, it's just game rules!

Report message to a moderator

Corporal 1st Class
Previous Topic: New feature: Arulco Special Division
Next Topic: In-development feature: Individual militia
Goto Forum:
  


Current Time: Tue Dec 03 23:21:55 GMT+2 2024

Total time taken to generate the page: 0.02024 seconds