• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Hi everyone, welcome to another dev diary! Last week we talked about changes to frontlines (both UI & backend and AI) and today I want to talk about some of the other fixes and changes we have been up to.

1.7 ‘Hydra’ is a chance for us to rewrite and improve some pesky systems and to step up and go 64-bit, so this diary is going to get a little technical :)

64-bit
1.6.2 will be the last 32-bit build of HOI4 and we will be leaving it (and older as normal) on steam for those who still want to access it (and make sure to mark the build). We also will not be converting any of the old versions to 64-bit. It would simply be too much work. Because of this we have decided to up the big decimal on our version number to 1.7. 1.7 ‘Hydra’ will be fully 64-bit supported on Linux, Mac and Windows and it has been a big undertaking. There are many reasons for this change. Some platforms like Mac are phasing out 32-bit quite aggressively and we don’t want to end up with people not being able to play on there. 64-bit lets us use newer compiler features and a lot more possibilities code wise in the future. It is also about time, because it felt like a lot of the industry did this over 5 years ago :D

As a player you won’t notice a huge difference. We haven’t seen any big performance improvements for example, although I wouldn’t say that it’s impossible some areas might improve as our investigations have been pretty shallow. 64-bit is tricky in that on one hand we get access to the possibility of more optimized code, CPU registers etc, but it also takes up more memory, and memory is often highly impactful on speed too. We see it as an investment into the future where we know we can start taking advantage of things now that the foundation is in and make it easier for us to work.

We have already seen some of this internally where we during this work have been able to replace a lot of basic code structures dating back to the Year of our Lord 2003 :)

Convoy system
The old code system keeping track of your favourite little boats has long plagued development, and after 1.6, when we still had some issues, we decided it was simply best to take it out back and shoot it. 1.7 comes with a new system rewritten from scratch. The old convoy system was operating in a way where everyone could control it, and by association, everyone could also break it at any time. It would also swap convoys in between the country’s supply and the assignments at every single tick, swapping them around all the time, and convoys getting lost because there was no sense of ownership and control over the convoys. It was a nightmare.

The new system is a centralized system where each country has one instance of a class that has full ownership and control of convoys, and any other gameplay code that needs convoys can request them from this system but never have real control over them. This “magically” fixes bugs with convoys disappearing from the game because it’s not possible to write code like that anymore. It’s stability by design along with the other great and exciting stability changes that we are bringing to you with this patch.


Naval Balance Changes
We have been looking at convoy escorting, subs, detection and raiding and making improvements:
  • Subs can now fire also while withdrawing
    • Convoy escort missions were too binary. Either you have protected the convoys in time or not. Arriving on time provided too much of an advantage to the escort and thus made sub raiding less viable. Subs will now get an extra volley or two in most combats, making raiding with high-quality subs against low-quality escorts more viable.
  • We increased submarine detection chance from passive detection (hi bitmode) and lowered detection chance from firing torpedos. Detection chance from passive sweeps now scales parabolically so that large differences in detection and visibility will be much more pronounced.
  • We gave carriers passive sub detection and gave them a detection increase in doctrines. This makes them more viable in their historical roles in the Atlantic.
  • We also increased detection values on some later radars and a bit on sonar, to make detecting subs a bit easier.
We have also been looking at various issues related to convoys and how they defend themselves against naval bombers. There were many different problems:
  • Unit transports died too easily vs naval bombers, this was extra bad for the AI which generally suffered more to this than a player would.
  • In small naval bombers vs transports as above, we also had way too high casualties for the planes
  • Because convoys are not “real” units they would heal up after battle, so unless you sunk them there was no real damage to the enemy.
To deal with this, we have made several changes:
  • Troop transports get a special defensive boost in the particular case of being attacked directly by naval bombers
  • The anti-air formula for ships shooting back has changed so that partial damage is taken into account. We now essentially roll a dice for partial damage allowing it to kill planes. Before, weak ships like convoys that got hit a lot had much to big an impact, and early naval bombers didn't really deliver. This should be a lot nicer now.
  • At the end of battles we add up all the damaged convoys and for a fraction of them we roll a dice based on the damage to see if they sunk from that damage. The kills get attributed to the last to strike them during the regular battle.

When it comes to regular combat we wanted to help out carriers and capital ships a bit and we felt the more realistic way of doing that was to give them a time at the start of the combat when they are the only ones active. Carriers and aircraft are active straight away. Some ticks later capital ships and subs get to fire and last screens. This gives a bit of a boost to those bigger ships and represents their longer ranged weapons better.

Script-Side Performance Improvements
1.6 came with a number of new script features to improve performance for targeted decisions. Previously these decisions would check every country in the world every day, and with some of the more complex triggers that could amount to quite a bit of number crunching. With the new features, we can pre-restrict the list of targets to reduce the necessary number of checks. Unfortunately, the new script features came too late in development for us to utilize these features in the initial release and other bugs took priority.

Thankfully, a member of the community by the name of Antoni Baum (aka “Yard1”) did make the effort to go through our script and fix all the places where the new features would make a difference (as well as a few triggers where a small reordering of script checks resulted in better performance). This work has been merged into 1.7 with permission. While it is difficult to measure the immediate performance effect of these changes, we saw a performance improvement of about 5-10% depending on the overall gamestate, number of wars etc.

We planned to put 1.7 out as an opt-in beta tonight but we hit some snags (which is why this diary is a bit late ;)) but we think we should have the open beta tomorrow with patchlog for those brave enough to help us test it :)

See you again next week!
 
No argument from me. I know why they used it, I'm just surprised to hear it. It's like watching some documentary about how things you use everyday are made. It's interesting, and some of it surprising.
You should check out the history of the engine they used for Half-Life, that one's been around the block a few times.
 
I have been thinking of doing something where CAS is better vs armored targets compared to NAV to give them both a role, but that would require quite a lot of changes to both plane combat and naval combat.

The traditional role of CV CAS in the pacific is to put holes in enemy CV flightdecks.
Maybe some bonus when attacking CVs is appropriate.
 
Let's pretend for a moment that CAS and NAV bombers were equally effective at killing ships with different positive and negative qualities. In HoI 4 the naval bomber MUST be better for balance purposes or it makes it too easy to just say well why don't I just skip NAV bombers and just do CAS/Fighter research (since I need those for ground troops anyway).

The reality is that bombs dropped from dive bombers were something like 3-5x easier to hit the target. Once you were well trained in the procedure you got pretty good at hitting the ship - somewhere. But overall CAS bombs didn't do much real damage to armored ships unless they got a lucky hit (think about shooting at a tank with a machine gun and getting a lucky hit where one bullet goes through the drivers vision slit. A number of famous battleships were later killed when first damaged by CAS bombs (I know this happened to the Yamato and I believe it was the case wish Bismarck also) and then later suck by other means.

The difficulty in hitting a ship with a torpedo launched by a plane seems trivial if you have ever seen the hunt for red october. But WWII tech was nowhere near that good. I remember watching an account of an American pilot talking to his bombardier telling him to release the torpedo. His fellow ariman told him not yet and made him wait about 10 seconds for the wave conditions in the water below to be just right to release the torpedo. In the middle of a bombing run that is an eternity!

History lessons aside it hurts me a little that NAV bombers do so little damage. Ignoring how these planes are balanced now I would really love to see a rework of the whole system. Without looking at current numbers I would love to see a system where CAS can only hurt subs, destroyers and convoys unless they get a critical hit. To balance this out CAS planes overall would have a much higher chance of hitting (reflected by high naval attack) but have much lower damage (naval damage) than torpedo bombers.

Say for example CAS planes were changed to get 20 naval attack and only 5 naval damage on a 1940 model. I would expect to see torpedo bombers with 10 naval attack and 20 naval damage. This of course would require a rework so that light cruisers and better would have 'damage reduction based on armor' except in the case of a critical hit.

As a basis for comparison Current game numbers in 1940 tech have the torpedo bomber with pretty much double stats of the CAS bomber in terms of attack/damage.

I have seen math projections that suggest if you are going to mass produce CAS planes then you are just better off making extra and using some for navy operations and skipping NAV planes. For example this works perfectly for Germany who needs lots of CAS vs ground units and then later needs NAV planes to sink the UK navy.
 
Last edited:
The difficulty in hitting a ship with a torpedo launched by a plane seems trivial if you have ever seen the hunt for red october. But WWII tech was nowhere near that good. I remember watching an account of an American pilot talking to his bombardier telling him to release the torpedo. His fellow ariman told him not yet and made him wait about 10 seconds for the wave conditions in the water below to be just right to release the torpedo. In the middle of a bombing run that is an eternity!

Dive bombing guide:


Torpedo bombing guide:
 
History lessons aside it hurts me a little that NAV bombers do so little damage.
Little damage? They deliver one strike after another with little to no losses or any other associated cost, and even a fleet freely operating in uncostested waters and filled with AA up to the brim is still extremely helpless.
 
Cheers for the DD Podcat and lots of exciting changes :D. I will admit I'm a bit distracted at the moment (and not just by the obvious) but I'm very much looking forward to giving 1.7 a run when things settle down :cool:.

The old code system keeping track of your favourite little boats has long plagued development, and after 1.6, when we still had some issues, we decided it was simply best to take it out back and shoot it.

Actual picture of your code after you'd finished with it :)

ciltvaira.jpg


We gave carriers passive sub detection and gave them a detection increase in doctrines. This makes them more viable in their historical roles in the Atlantic.

Great work, this be very good :).

We increased submarine detection chance from passive detection (hi bitmode) and lowered detection chance from firing torpedos. Detection chance from passive sweeps now scales parabolically so that large differences in detection and visibility will be much more pronounced.

Parabolic scaling also sounds tops :).

At the end of battles we add up all the damaged convoys and for a fraction of them we roll a dice based on the damage to see if they sunk from that damage. The kills get attributed to the last to strike them during the regular battle.

More wonderful :cool:

Carriers and aircraft are active straight away. Some ticks later capital ships and subs get to fire and last screens. This gives a bit of a boost to those bigger ships and represents their longer ranged weapons better.

Ooooh, very nice :) Will it be possible to adjust how long this is in the defines, or by the weather or time of day?

Thankfully, a member of the community by the name of Antoni Baum (aka “Yard1”) did make the effort to go through our script and fix all the places where the new features would make a difference (as well as a few triggers where a small reordering of script checks resulted in better performance).

Thanks for your work @Yard1PL :cool:

I have been thinking of doing something where CAS is better vs armored targets compared to NAV to give them both a role, but that would require quite a lot of changes to both plane combat and naval combat.

As some others have mentioned, aerial torpedoes tended to be more effective against larger ships (particularly those with substantial horizontal armour), while CAS were particularly good at hitting smaller, more agile ships (dive bombers took a heavy toll of British destroyers during the Dunkirk evacuations). Some kind of relationship between the type of attack (CAS or NAV) and evasion might be cool (so NAVs could still do more damage, but they might be a lot less likely to hit more evasive ships, while CAS could wail on BBs, but they'd need a lot of hits to do real damage). As always, please ignore if not helpful :).

What I really would like though is that Carrier planes automatically support land combat when on the invasion support mission ( without range penalty since they sail right up the the shore being invaded ). That would make Carrier CAS much more useful I feel.

This would be super-cool, although might be nice if NAVs could do it a bit (but perhaps less effectively) - Avengers, Swordfish and Albacores (at the very least, just going from the top of my head) all performed CAS missions from carriers, with Avengers doing a heap of 'em.
 
No argument from me. I know why they used it, I'm just surprised to hear it. It's like watching some documentary about how things you use everyday are made. It's interesting, and some of it surprising.
If it is code from 2003 it probably isn't HOI code, but Clauswitz code which was developed for Europa Universalis (2 or 3).
 
On the topic of convoys, could you make sure this windows shows numbers that make sense? (numbers don't add up, why twice the same flag, ...) + add a scrollbar in the filters
index.php




its because convoys are not counted in the very top counter, that is only for actual navy ships ie submarines battleships ect, that counter, well any of them really also dont count ships of any kind sunk by naval mines. confusing yes, but a bug no
 
This would be super-cool, although might be nice if NAVs could do it a bit (but perhaps less effectively) - Avengers, Swordfish and Albacores (at the very least, just going from the top of my head) all performed CAS missions from carriers, with Avengers doing a heap of 'em.

Yes. That's why I wrote Carrier planes and not Carrier CAS. 1944 CV Fighters historically also saw alot of use in ground support roles with heavy loads of rockets and bombs + strafing.
 
Yes. That's why I wrote Carrier planes and not Carrier CAS. 1944 CV Fighters historically also saw alot of use in ground support roles with heavy loads of rockets and bombs + strafing.

Many land-based fighter-bombers also replaced specialized CAS in the last years. German ground attack units replaced Stukas in 1944 with Focke-Wulf 190. In the Eastern Front FW190 fighter-bomber units survived without any escort fighters, Stukas did not, so Bf-109s could be sent West.
 
Yes. That's why I wrote Carrier planes and not Carrier CAS. 1944 CV Fighters historically also saw alot of use in ground support roles with heavy loads of rockets and bombs + strafing.

Blast, right you are, sorry. Well said, and completely agree :).
 
you'll need to wait for the patchlog for the smaller stuff. but yeah the 24 cap is fixed
I was starting to wonder about this because I could see my sub admiral not gain anything for a long time and then as the subs started to die off, suddenly get some good xp. Meanwhile my main fleet admirals were languishing in the officers club from all I could tell. I have been very happy with the naval changes overall, despite some artifacts like my destroyers and light cruisers getting massive number of kills on the capital ships (even those without torps) and my main ships getting maybe an assisted kill here an there. After all, now if feels like the battel of the Pacific and the Atlantic (if you are the USA) must be prioritized as well as the simple (relatively speaking) smashing of armies on the ground.
The other thing I would like to see is a better way for the CV's to be accredited for their kills... tho that might be done now that the re-balancing you mentioned earlier in the posts has been done.
Thanks a lot for MTG's (and all the other efforts in general)... this has literally made it into a new game for me. And since I like playing the USA (as well as China and Russia), I am very happy for all the changes done, both political and naval. (I love playing UK and Japan in general, but now the Naval as well as Oil/Gas resource, adds such a new dimension that I am almost scared of playing them).
Thanks for all this)))) HOI4 is my favorite game since HOI2(Darkest Hour)... making this my overall favorite game)))))