HOI4 - Together For Victory AI Update #4

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

SteelVolt

Technomancer
2 Badges
Aug 4, 2014
735
4.201
  • Paradox Order
  • Hearts of Iron IV Sign-up
Greeting friends!

This will be the last of these before the release of Together for Victory, and unless I am to write one about a hotfix, the last one for the year.

This weeks tale from the trenches will actually be about one of the points in the changelog. Sorry about cheating like this for the last diary, but it was too good to leave out:
- Scary fix makes AI actually consider all target areas of enemy, in stead of one at a time. Should set pacific area ablaze when the time comes, and keep the invasions rolling.
  • Wow...so...way back in development before the invasion craft tech limited the number of divisions you could use for invasions, the AI sometimes had a tendency to set up A LOT of them. As a fix for this, that did do the trick in the general case, the AI would consider ONE area per enemy for invasion at a time, before doing another one. When I say area here, it is any enemy territory with land connection to all parts of itself...shitty description, so a couple of examples: Ostpreussen is a separate area from main Germany, which is its own area, so Germany initially consists of two areas. When/if they annex Austria, it becomes part of the main German area. Similarly, every single island is its own area.
At this point, I am sure you can see at least a few problems this could cause in the pacific. My hopes were that Japan and USA would invade each other, and the invasions would be small enough to happen often enough that this would not become a problem. However...when the invasion is to an island that has had its port taken over by someone else, the AI would not be able to plan an invasion to it, and thus not make any more invasions until that area was fully conquered...which was not a guarantee.
This restriction was lifted, and the scary part of this was letting the AI be potentially a lot more active. It has turned out that the invasion craft limits and tweaks to the front balancing balances this out really well.

This is a good example of how fixes to earlier problems can cause new ones further down the line as development progresses. This happens a lot in AI, and not rarely will the same symptom pop up over and over but due to new reasons under the hood.

So, moving on with more boaty stuff:

- Added a "pacific continent" to aid in AI prio.
- Added contininent prioritization for the AI with high scores to Europe and the Pacific, but low to Africa.
  • Calculating the value of a larger area is expensive, and the value of locations like the pacific islands depends less on what they contain in terms of buildings and resources and more about where they are located. By introducing scriptable priority for areas, which can be modified through script on a per country bases, it is possible to tweak where countries should focus and even base this on triggers. So, merry christmas, modders :)
This is also an important part in improving the AIs pacific activity, and is an extra part of reducing their African ditto.

- AI sets up a couple of fleets to be used for special missions.
  • The AI tries to prioritize naval regions based on a ton of variables, and in the end may miss out on covering some important stuff. By ear marking a couple of fleets for specialized missions, such as covering invasions, the AI is now better at not getting stuck waiting for fleets that may never come before being able to invade. It also steps up its general naval game a bit.

- Made sure that AI does not completely block itself when having multiple invasion orders against the same area but being unable to cover the regions for all of them at the same time.
  • The naval invasion AI tries to coordinate invasions against the same area, but forcing it to do this would make it never invade if it was unable to cover all necessary regions for all the invasions at the same time. This restriction was softened, so the AI will be more capable at getting stuff done. This one was hitting Japan hard when they wanted to navally invade south.

- Made AI better at supporting naval invasions by focusing on the next one to complete preparation.
* This one might seem either cryptic or obvious. Before the AI would just pick the top invasion on a list to focus on first, now it picks the one that is next in line to be done preparing.

- Tweaked naval invasion priority to make them more inclined to take islands (particularly with air bases) and home region.
  • Pretty much speaks for itself, particularly in the context of the Pacific theater.

- Made AI invasions scriptably more unpredictable.
  • While only a define for now, it should make life more interesting in singleplayer, with less hammering of invasions in the same location over and over. Also gives modders another thing to play with :)

- Stabilized AI invasion prio scores. Should result in invasions not swapping units around as much and randomly getting canceled.
  • Under the hood the AI has a priority score for every orders. The invasion score was allowed to depend on variables that shifted from day to day, such as preparation level. This would cause different numbers of units to be assigned to them over time, causing some really bad behaviour. Stabilizing this score has made the invasion AI a lot more stable and reliable.

That was more or less all the work that has been done to the naval AI. The changelog had more AI points in it, some really heavy and important stuff related to AI division design among other things. I really hope you will enjoy the DLC, and even if you don't get it, I hope all these fixes will increase your enjoyment of the game. And either way, I look forward to keep improving the HoI4 AI, and you can all look forward to more improvements being done.
 
  • 62
  • 27
Reactions:
Looks like a fine improvement, well done guys.
 
Thank you! This DLC looks better and better. The AI improvements is IMO the most important ones for SP like me.
Can't wait to give it a try!
 
  • 4
Reactions:
Cheers for the DD Steelvolt, more excellent AI goodness :). Looking forward to seeing it in action in not very long at all now :). Great story from the trenches as well.

Greeting friends!
  • Calculating the value of a larger area is expensive, and the value of locations like the pacific islands depends less on what they contain in terms of buildings and resources and more about where they are located. By introducing scriptable priority for areas, which can be modified through script on a per country bases, it is possible to tweak where countries should focus and even base this on triggers. So, merry christmas, modders :).
....

- Made AI invasions scriptably more unpredictable.

Woot! More moddability is always good - Christmas comes early on Planet HoI :). That area-based priority system sounds very interesting indeed, I'm very much looking forward to playing with that, and I'll give that AI invasion predictability thing a good shake as well. I'm guessing the area priority thing only relates to land areas at the moment?
 
Last edited:
  • 1
Reactions:
There will be "a proper DD" today as well. Coming up shortly!

I also want to point out that all changes mentioned in SteelVolts AI Dev Diaries are part of the free 1.3 Torch patch. Not DLC material, so you'll get this stuff no matter if you buy the expansion or not.
 
  • 13
  • 7
Reactions:
Everything sounds really great!
 
excellent! many thanks for all the hard work! this is probably one of the best games ever made, totally addicted to it. sure it's not perfect yet but it's turning out to be an absolute masterpiece in my opinion. Just one question, I was wondering if you are planning to add more generals to country such as eg Italy... if I were to point out one of the few things Im not totally happy with is the lack of Generals for Italy...so many important generals missing (Rodolfo Graziani, Ettore Bstico, Mario Roatta, Alfredo Guzzoni, Junio Valerio Borghese, Italo Balbo to name a few). Compared to other major countries there's a lack of generals that sort of ruins the immersion when recruiting new generic ones especially in the late game when more armies are needed. Again not a criticism just a suggestion. Keep up the great work!
 
  • 2
Reactions:
- Stabilized AI invasion prio scores. Should result in invasions not swapping units around as much and randomly getting canceled.
  • Under the hood the AI has a priority score for every orders. The invasion score was allowed to depend on variables that shifted from day to day, such as preparation level. This would cause different numbers of units to be assigned to them over time, causing some really bad behaviour. Stabilizing this score has made the invasion AI a lot more stable and reliable.

In 1.3, I think I have seen a bug regarding this a few times already, it also happened in Daniels stream when he plays facist australia. Daniel has taken over New Zealand making the entire common wealth his enemy. He is guarding new zealand with a single division in the north of the island. One of the common wealth nations successfully invade a province in the south of the island but immediately leaves as soon as they enter, although the entire south and north is only guarded by a single division.

To an untrained eye it looks like they do the naval invasion even tho it is not really a high priority anymore, and when its completed they immediately prioritize the forces to something else. Instead of continuing on the very successful invasion they just completed.
 
Last edited:
  • 1
Reactions:
In 1.3, I think I have seen a bug regarding this a few times already, it also happened in Daniels stream when he plays facist australia. Daniel has taken over New Zealand making the entire common wealth his enemy. He is guarding new zealand with a single division in the north of the island. One of the common wealth nations successfully invade a province in the south of the island but immediately leaves as soon as they enter, although the entire south and north is only guarded by a single division.

To an untrained eye it looks like they do the naval invasion even tho it is not really a high priority anymore, and when its completed they immediately prioritize the forces to something else. Instead of continuing on the very successful invasion they just completed.

Thanks for heads up. We will keep our eyes open :)
 
  • 3
Reactions:
I posted it in today's DD, but it better fits here:

1) Not sure if misread that, but is the AI behaviour gone, where Italy f.e. send lots of divisions (50 in one game) to pacific/china theatre if allied with japan and let his own provinces less defended (also for planes and ships)?

Also other way round, where you can see lots of Japanese planes and divisions in Europe theatre.....

2) I found out and read a lot about problems with land based naval bombers (only one attack, no real impact) against ships in seazones. Are there any improvements?
 
  • 1
Reactions: