Hearts of Iron IV

Hearts of Iron IV

James's Ammunition Mod
142 Comments
Bangshotuhead 5 May @ 5:05pm 
came in to say props to the dev for actually responding lol this is like a first time i see a creator actually help out and respond
1230james  [author] 23 Apr @ 6:32pm 
Ah, yeah that would do it lol
「Yama」 23 Apr @ 1:47pm 
I was using this mod in this game :

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3378477376

I used a little bit "too much" of "Factory Ouput Bonus" and here i got those number...

I am ashmed of myself :steamfacepalm:
1230james  [author] 23 Apr @ 12:53pm 
This is a serious question since it sounds like you caused some number somewhere to overflow, and I need to know if it's that or if there's some other hidden flaw
1230james  [author] 23 Apr @ 10:27am 
...how many mils do you have? 😨
「Yama」 23 Apr @ 9:32am 
In one of my games, I have the icon in "Empty" with a daily gain of -1307660.5K.
The "From idle Military Factories is at -1506977.4K.

So pretty well, i can't make ammo...

How can i resolve this issue wihout restarting a game ?
1230james  [author] 21 Apr @ 3:58pm 
Good to know; I'll make a note of it in the description for others after work
Sincap Adam 21 Apr @ 9:14am 
nope it worked when i disabled the technology advancement stuff from game rules
Sincap Adam 21 Apr @ 9:06am 
nope it crashed as i expected xd
Sincap Adam 21 Apr @ 9:03am 
hmmmm i will try this mod in Great War Redux , ammo shortage was a huge issue in ww1
1230james  [author] 17 Apr @ 8:54pm 
(1/2)
Because I can never rely on PDX mod users to use any common sense, I'm copypasting a question that was posted to my profile page???? instead of here for some reason

"is it possible ican make the ammunition production rate 3x or 4x ? same with storage ? maybe by editing some file ?
i use this on mods like tno i love the mod but when its not vanilla a lot of countries are not designed for this in terms of military factory amount per ammo production and storage.
so i find battles such as south african war short lasting as the rebels, enemy factions etc are notable to produce ammo to keep up for more than a few days."
1230james  [author] 17 Apr @ 8:54pm 
(2/2)
All math-related definitions and logic are defined in common/scripted_effects/JAM_calculations.txt . This is a very long file, but the very top of it will be a bunch of macros defining constants that's used in the math calculations defined later in the file. The very first two are the daily ammo production rates in thousands. You can just make those numbers 3 or 4 times bigger.

Ammo storage capacity, similar to fuel, increases with state infrastructure level. Obviously there's no equivalent of fuel silos for ammo for the sake of compatibility, so ammo storage per infrastructure is comparatively much larger. The calculations file also has macros defined for the base ammo capacity (that every country always has) and capacity added per level of infrastructure. These numbers can be freely tweaked to whatever you need them to be as well.
1230james  [author] 2 Mar @ 9:25pm 
Update is out! Apologies again for the huge delay.

Please check the change notes for the full list of changes in the mod. They include:
• Air ammo usage rebalancing
• Ammo shortage malus modifiers are now shown under National Spirits
• Various tweaks to AI behaviors
• Ammo production game rule is now separated between one game rule for players and another for AI

Thank you for your patience, and let me know if you run into any issues!
1230james  [author] 2 Mar @ 2:01pm 
Finally working on making tweaks to this; sorry for the delays!

Probably goes without saying but air ammo usage will be the main thing being revisited. Currently looking at observer games with the air ammo consumption reduced by about 50% and it seems a lot more manageable. Right now I'm seeing an AI Germany field almost 10k planes (the vast majority of them being fighters) and they're consuming just under 500k ammo per day on air. Before the changes, they'd be spending 300k ammo on about 3k planes, so it's a sizable improvement.

Seems workable to me since by this point they also have enough mils to produce the ammo for those 10k planes, but I might tweak it downwards a tiny bit more as I run more tests. Notably it seems the AI just loves throwing down more fighter wings even if it doesn't really need them. I'll try to see if I can do anything about that.
KRUS 11 Jan @ 1:32am 
Good, but airforces too expensive, in mp (10k+ aircrafts to 41) its difficult
Kaarlo 6 Nov, 2024 @ 6:27am 
@1230james, what you could do to fix the Plane ammo consumption is lower the consumption by alot.
1230james  [author] 5 Nov, 2024 @ 9:26pm 
no
FELDRIC 5 Nov, 2024 @ 7:03pm 
mod food please
Skalitz eBoy 12 Oct, 2024 @ 12:38pm 
I read the comments and you guys have problem with air force. My suggestion is "1000% more expensive plane" mod can help!
LordZarmack 11 Sep, 2024 @ 11:01pm 
aye, for now though lowering that wing size makes it all manageable and should give you a bit of time to have a think about how you want to further develop your mod.

Victoria 3 is great, I just wish someone would import the ho4 battle system over to it to make combat and wars feel better.. that's the only reason I can never really get into it the same way.
1230james  [author] 11 Sep, 2024 @ 10:15pm 
Will make a note of it
SilverWolf347 11 Sep, 2024 @ 9:29pm 
Might I suggest a game option to buff ammo production just for the AI, and not the player? My time playing with it so far has shown me the AI are not always competent at keeping their units supplied. Even worse, I've noticed a lot of AI get a huge increase on ammo usage because they have units with no general. Maybe even making that something that can be toggled in the game rules could help the AI be more competent.
1230james  [author] 11 Sep, 2024 @ 6:13pm 
I'm totally okay with just lowering air consumption rates. Needing to point people to other rework mods as a soft prerequisite seems pretty annoying.

I'm primarily a Victoria 3 modder and I have a bunch of stuff to do in that sphere atm so this might take quite some time, but I'll see to changing the rates to make air forces less of a drain. These numbers should help inform what the new values should look like, so tyvm for them 👍
LordZarmack 10 Sep, 2024 @ 1:53am 
Using the "Air wing rebalance v3" by Wy-at War mod = Air: 58.90k Manpower = 218k ammunition, 89 wings, 1749 Aircraft in total so far more realistic.

I think this is the immediate solution, though not ideal as the ammo use is still bloody high... just a bit more believable and consistent.... if it was my mod i'd integrate the air rebalence as ammo is already a realistic mod and more for MP than Player v AI.. + the air wing size changes really help smaller nations contribute to the war via air power.
LordZarmack 10 Sep, 2024 @ 12:20am 
..to that end, maybe combine/ recommend your mod with a air wing size reduction to historical values? of- I'm going to test this with air wing rebalance v3 by "Wy-at War" and let you know the results by 1940....I do have a door to hang today but I should have time.
LordZarmack 9 Sep, 2024 @ 11:21pm 
(Obviously in historical terms the idea of the uk Fielding over 3k air units over the skys of the uk when historically it was akin to 700-800 at it's peak v 2500 or so is silly, but with all wings being forced to be 100 units each ~ what choice do we have)
LordZarmack 9 Sep, 2024 @ 11:18pm 
Air: 232k Manpower = 823k 89 wings, 6888 Aircraft in total.
Navy: 244k Manpower = 57k : 20 fleets with 520 units.
Army: 1.35M Manpower = 24.2k : 126 divisions
LordZarmack 9 Sep, 2024 @ 11:14pm 
Playing as the Empire right now and obviously (the battle of Britain) ~ No idle/non-commanded units either, but air consumption - when you consider the royal navy, and the french fleet of equal manpower cost is using just 6.93% of air... and the army is using 2.92%
1230james  [author] 9 Sep, 2024 @ 4:54pm 
How many airplanes and how many air wings do you have deployed in total?
LordZarmack 9 Sep, 2024 @ 4:38am 
My air units are using over 800k ammunition, the army (about 120 + units are using 36k.
LordZarmack 9 Sep, 2024 @ 4:36am 
Mod is alright but aircraft take far too much, it's rendering almost all nations to be unable to advance 90% of the time, so much so it took Germany until 1941 to take Poland... playing with mostly better mechanic mods.
1230james  [author] 5 Sep, 2024 @ 9:38am 
:steamhappy:
SilverWolf347 5 Sep, 2024 @ 12:48am 
Surprisingly lightweight and compatible. I got curious and peered in at the mod's files to compare it to the original you forked from (that I used to use, as well), and I must say you did a really good job overhauling this, and shockingly making it a lot more compatible with other mods than one might except. I appreciate your work. :steamthumbsup:
Kaarlo 21 Aug, 2024 @ 8:54pm 
@1230james, my bad, didn't see that i already asked about that trigger.
1230james  [author] 21 Aug, 2024 @ 8:51pm 
Did you read any part of what I said?
Kaarlo 21 Aug, 2024 @ 8:39pm 
@1230james, maybe you could fix the air wings consuming ammo but using is_fighting_air_units
1230james  [author] 16 Aug, 2024 @ 11:08pm 
That trigger is only available in combatant scope which is only provided in a few very specific contexts. It can't be used arbitrarily, which makes it not usable for something like periodic math computations running in country scopes.
Kaarlo 16 Aug, 2024 @ 7:31pm 
Maybe you can use is_fighting_air_units
1230james  [author] 16 Aug, 2024 @ 6:31pm 
I can make a note to add a game rule or something to adjust the ammo consumption of air wings since there's not much agency over how much they consume aside from disbanding them entirely.

If anyone else has any feedback regarding air ammo usage, I'd also be open to adjusting their consumption rates unilaterally (they have a secret multiplier that currently lowers what their usage would be by 75%), although I would need some more feedback on how much lower it needs to go.
1230james  [author] 16 Aug, 2024 @ 5:48pm 
There's literally no other option for it because the game exposes nothing useful about air wings that could be used to determine whether or not the air wing is doing something versus idling on the ground. The only alternative would be to exempt air wings from using ammo entirely.
Kaarlo 16 Aug, 2024 @ 3:31pm 
Why does the air wings take so much ammo when not even preforming a air mission just sitting at air base. For my friend it consumed 300k ammo for just having them at airbases. Why would even a air wing the dosen't do any air mission consume ammo is it standing on the airbase just shooting. You should really change that.
1230james  [author] 8 Aug, 2024 @ 12:26pm 
They should be compatible at least on a basic level. I don't use either of those mods so idk what exactly they do and if they affect this mod, but as per the Compatibility section in the description, the numbers might be a little off.

If any mods you have add new unit types, those types will use a fallback value defined for their military branch (i.e., the army, navy, and air force have different fallback values) that's somewhere around the average consumption rate of a unit in that branch. This means the mod will still function, but the numbers might be a bit off from what they should be if, for example, you have a new type of infantry but now it's consuming the same amount of ammo as tanks would.

For techs, if certain vanilla techs got deleted or renamed internally then it might break the tech-based ammo consumption increases, but those can be disabled via a game rule if it ever causes problems.
miguelmonte2005 8 Aug, 2024 @ 5:39am 
so ill make an assumption and say that this is incmpatible with RT56 and Ultimate Tech tree... right?
1230james  [author] 28 Jul, 2024 @ 10:23am 
They suffer every manner of combat debuff. They're applied as hidden dynamic modifiers so you won't see them anywhere except when checking the tooltips for stuff like a specific division's defense in a battle's info popup.
Shekhel A'govnur 28 Jul, 2024 @ 4:33am 
I might be a bit slow but what happens if your ammo is out, does your units just suffer debuffs or whats up?
1230james  [author] 26 Jul, 2024 @ 9:16pm 
Sure
Kaarlo 26 Jul, 2024 @ 8:49pm 
Can i take this mod and use it for like a templatev I will of curse credit you.
1230james  [author] 26 Jul, 2024 @ 8:45pm 
If you just did that and literally nothing else then you would be producing ammo based on your civilian factories instead of military ones

But from there you could change the variables and everything else to re-brand it all as food or whatever even though they'd functionally be almost identical
Kaarlo 26 Jul, 2024 @ 8:37pm 
So if i just changed the num_of_military_factories and num_of_available_military_factories to num_of_civilian_factories and num_of_available_civilian_factories i could use it for food?
1230james  [author] 26 Jul, 2024 @ 8:34pm 
The calculations for ammo production are done in the JAM_se_calculate_ammo_produced scripted effect.

The number of military factories can be retrieved with the num_of_military_factories and num_of_available_military_factories .

There are civilian factory counterparts named num_of_civilian_factories and num_of_available_civilian_factories .

https://hoi4.paradoxwikis.com/Triggers#Buildings