Main Menu

Hearts of Iron IV

Started by Ian C, May 13, 2016, 01:07:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

acctingman

I SO want to like this game, but I struggled with it, however, I'm sure it's because this was my first foray in the genre.

glen55

Quote from: sandman2575 on December 07, 2016, 03:22:55 PM
Also -- and I'm not a programmer so this is speculation -- I have to believe that programming the AI for HOI is vastly more difficult than EU. Not saying that EU is a simple game -- it's anything but -- but the sheer number of complex things the AI in HOI has to manage is staggering. Thus I'm not surprised Pdox has struggled to create a good AI for HOI -- but I really wish they'd make improving it the priority. I frankly don't care too much about national focus trees and the other stuff this new expansion is offering. It feels like just so much window dressing -- very nice to look at, but hardly essential.

Exactly. Fix the AI and I will probably buy all the expansions. Don't and I may never play it again.
Things are more like they are now than they have ever been before.
  - Dwight D. Eisenhower

bboyer66

Quote from: sandman2575 on December 07, 2016, 03:22:55 PM
Also -- and I'm not a programmer so this is speculation -- I have to believe that programming the AI for HOI is vastly more difficult than EU. Not saying that EU is a simple game -- it's anything but -- but the sheer number of complex things the AI in HOI has to manage is staggering. Thus I'm not surprised Pdox has struggled to create a good AI for HOI -- but I really wish they'd make improving it the priority. I frankly don't care too much about national focus trees and the other stuff this new expansion is offering. It feels like just so much window dressing -- very nice to look at, but hardly essential.

I have been saying this for a while now.  Why put all these bells and whistles into the game, when the AI has no idea on how to utilize them. We are up to HOI IV and the Japanese still have no clue what they are doing.

FlickJax

Quote from: bboyer66 on December 07, 2016, 06:08:49 PM
Quote from: sandman2575 on December 07, 2016, 03:22:55 PM
Also -- and I'm not a programmer so this is speculation -- I have to believe that programming the AI for HOI is vastly more difficult than EU. Not saying that EU is a simple game -- it's anything but -- but the sheer number of complex things the AI in HOI has to manage is staggering. Thus I'm not surprised Pdox has struggled to create a good AI for HOI -- but I really wish they'd make improving it the priority. I frankly don't care too much about national focus trees and the other stuff this new expansion is offering. It feels like just so much window dressing -- very nice to look at, but hardly essential.

I have been saying this for a while now.  Why put all these bells and whistles into the game, when the AI has no idea on how to utilize them. We are up to HOI IV and the Japanese still have no clue what they are doing.

I don't think they had much of a clue at the time, poking a bear like they did...

sandman2575

Quote from: bboyer66 on December 07, 2016, 06:08:49 PM
I have been saying this for a while now.  Why put all these bells and whistles into the game, when the AI has no idea on how to utilize them.

The ironic thing is, Dan and the dev team specifically said this was one of the big goals going into HOI4 -- to only implement features the AI could handle. It was the main reason they gave for getting rid of the CnC/OOB structure -- Dan said the AI just couldn't handle it, so out it went.

I was pretty strongly against that decision at the time -- and still do miss the OOB -- but in the end, I accepted the reasoning behind it.

Overall, I have to say, I think Dan and his team did an amazing job putting HOI4 together. I think 4 improves on 3 in many, many areas. The problem is, all the improvements in the world aren't worth much if the AI is bad and the game is just completely unchallenging, and hence, not much fun...

Ian C

AI Updates immanent:

https://forum.paradoxplaza.com/forum/index.php?threads/hoi4-dev-diary-cosmetic-tags-art-gameplay-and-ai.987053/

https://forum.paradoxplaza.com/forum/index.php?threads/hoi4-together-for-victory-ai-update-2.987492/


Full parts quoted:

QuoteAI improvements #1

The other day I ran a poll on twitter and 630 people voted for us to do special smaller AI diaries, so we will be kicking this off by including the first part by @SteelVolt here, but after that he will be posting them separately up until release (next one on friday). Initially he will be going over the patch changelog step by step (the whole log will get revealed the day before release, but I figured I'd point out where the stuff is coming from already :) ), so over to him:

Hey everyone!
This time around we thought we would tell you about AI fixes and improvements by looking at some points in the changelog and go a bit deeper into what they actually mean.

First of all, working on a game like Hearts of Iron is a real adventure. So many interacting systems leads to butterfly effects all over the place, sometimes in unexpected ways. And in no other area is this more clear than AI. Fix one thing, and something else becomes a problem. I will be sharing some stories from the trenches over these diaries, And I thought I would start with one from when we were working on Sunflower. When working with the balance of units in Africa (I think we can all recall those massive wars being fought in the deserts of north Africa). Making the AI a lot less interested in sending units there did indeed make them not put all their troops there. What we saw in our hands off runs the following days was that Germany struggled really bad with taking Europe. A lot more than it had before. It turned out that when the Allies no longer cared about Africa, they would send almost all their forces immediately into France to help them push back Germany. This even included Australia.
So in a sense, I am playing a super complex game of whack-a-mole with the code.

Anyway, since this is the first of these to focus on the changelog, I thought it would be a good idea to take a look at some of the straight up bugs that has been taken care of.

- AI now attempts to recover when units are unable to reach desired front location.

    It turned out that encircled AI units tended to become overly passive. This was due to them playing it too safe and not being able to find a secure path back to the main front. Expect them to fight back a bit more now.


- AI no longer ends up in strange state where they are assigned to a root order but not a following attack order.

    Reassignments could sometimes lead units to get stuck not being assigned to an advancement order. Since they were not flagged as unassigned (they were, after all, assigned to the root order), and given that orders often ends up being split, this was not always evident. This would improve the AI's ability to attack in general.


- Fixed strange bug in AI order assignment that left units assigned to a group but not an order.

    The underlying cause is not as related to the previous one as it may seem, and the effects were even more dire. The tricky part here is that due to how the game works internally, some actions must be resolved in a central update loop before others can be done. This means that the AI is forced to set up their stuff in steps, but due to that the last steps changes MAY be outdated, the code to manage all this easily becomes a bit hard to follow. The fixes for this in particular should make the AI behave more reliably in relation to the plans it makes.


- Made sure AI is capable of calling subjects into wars even if they are not in a faction.

    Another really basic one. Turns out the AI would not even bother considering calling in countries to wars if they were not in the same faction. There are, however, countries that CAN be called into wars that do not follow this rule: puppets. While most puppets are set up as being part of factions, at least before wars happen, this slipped under the radar for quite a while. The notable exception is Japan and its early war with China.


That's it for round one, and I have to tell you I am really stoked about getting the update into your hands. If your pet peeve was not covered in this text, just relax and wait for the other ones. The next will be more about bug fixes, and after that I will go into improvements.

Next diary (that isnt about AI) will go over achievements, some UI improvements and the full patch log with changes!

And don't forget today's World War Wednesday stream starting at 16:00CET on www.twitch.tv/paradoxinteractive. We'll be showing you Together for Victory features and answer as many questions about the expansion as we can during the stream.
You can pre-order Together for Victory here! If you are an owner of the Expansion Pass you'll already get it (together with the next 2 expansions). Owning Together for Victory will also grant you new forum avatars and an unique icon! (actually people with just base game will also get a few new ones as of today)

AI improvements #2

   

    Hello again!

    It is already time for another AI mini diary, going into some more detail about points in the changelog for the upcoming Together for Victory update!

    (To read part one, scroll to the end of the last DD, which can be found here.)

    Todays story from the trenches relates to one of the seemingly basic AI features that is a hell of a lot harder than it seems; balancing the divisions between the orders. A human can do this without much thinking, given our superior pattern recognition capabilities. The AI is not as lucky, and has to do some educated guesses based on what numbers are available in a given situation. The code for doing this has grown in phases since about two years back, in some sences almost uncontrolably so due to chasing a good enough state for deadlines. After a while, what easily happens with such systems is that parts of the code "fix" problems that are no longer problems. Indeed, more than just making the code unnecessarily complicated, it can cause new bugs.
    This is exactly what happened with this system. It can roughly be divided into three steps, and after some failed attempts at fixing some bugs related to it, I ended up ripping out and rewriting the entire step two, reducing the size of it by about 30%. This also meant that I could remove about 20% of step three. The result has been that the system is easier to read, debug and maintain, even though it lead to some new bugs related to the rewriting. I still see cases where the behaviour is not 100%, but the overall performance of it appears a significant improvement, and the AIs ability to recover from strange situations is a lot better.

    - Fixed bug where AI would keep swapping a fighter with land equipment at the top of the list for all eternity.

        If you ever observed the AI (sorry about observer mode still not being a guarantee), you may have noticed at least some countries getting stuck swapping the two top lines if they were a fighter and some land equipment. A fairly basic code booboo that has now been resolved, resulting in a positive impact to AI production.


    - AI should now be capable of using rockets.

        Exactly what it says. The problem here was that rocket bases, though internally represented as air bases, are kept in a separate list from the regular air bases. Just including that list when considering missions should mean AI can now use their sometimes ample supply of rockets.


    - Fixed overflow that cause some countries to not build planes causing USA to end up with 0 strategic bombers.

        Yet another basic one. When implementing features it is easy to just look that the standard cases, and thus miss the late game edge cases. In this case the USA wanted strategic bombers so much that the number overflowed and became a ridiculous negative number in stead.


    - Made sure released AI countries don't get stuck building nothing.

        Again, pretty basic. A flag was not set, and the AI was never run for released countries. But who releases a country without playing as it, anyway? ;P


    That covers some more of the fixes that has been made for the AI. As before; I have more to tell you about so hold off on worrying about your favourite AI bugs ;)
    Next time I will be talking about some of the improvements, though when it comes to AI the line between what is a bugfix and what is an improvement is very blurry.
     



sandman2575

That's encouraging.

Things I really wish they'd prioritize fixing:

1. AI building 100s and 100s of useless divisions. Need much fewer divisions based on templates that bear some resemblance to ww2 reality.

2. Related to this:  AI spamming expeditionary forces. When I see Venezuelan divisions helping protect the German fatherland, or Japanese fighter wings help protect the airspace over Vichy France (and have seen those things more than once) -- well, let's just say it's a bit immersion-breaking

3. For God's sake -- *NERF air combat*!!! Even on conservative engagement settings, you lose hundreds of aircraft in the span of days. In my recent playthrough as Germany, the invasion of Poland alone cost me several hundred fighters -- simply fighting against the (apparently awesome) Polish airforces. Yes, they lost similar numbers, but it's ridiculous in the extreme that the airforces you spend years building up from 1936-39 vanish in the course of a few weeks simply due to routine combat.

4. Naval combat. What can one say, and where to begin? It remains a complete mess. Unescorted cruisers and battleships massacring u-boats. Enough said.

IronX

It really makes you wonder why they release their games in this shape. Surely they knew how bad the AI was in certain areas and that the community would call them out on it.

glen55

The one that made me quit is when you try to use the battle planner, your lines would continually readjust themselves with units always peeling off to go from one end of the line to the other, such that you would never get the bonus for a fully-planned order. Made the battle planner useless.
Things are more like they are now than they have ever been before.
  - Dwight D. Eisenhower

Skoop

Quote from: glen55 on December 09, 2016, 01:34:54 PM
The one that made me quit is when you try to use the battle planner, your lines would continually readjust themselves with units always peeling off to go from one end of the line to the other, such that you would never get the bonus for a fully-planned order. Made the battle planner useless.

They want you to buy dlc that improves the ai I bet, that's how it went with hoiIII.

sandman2575

Quote from: glen55 on December 09, 2016, 01:34:54 PM
The one that made me quit is when you try to use the battle planner, your lines would continually readjust themselves with units always peeling off to go from one end of the line to the other, such that you would never get the bonus for a fully-planned order. Made the battle planner useless.

Yup, this is a major headache. I love the battle planner in theory, but clearly it needs some further tweaking in order to be truly useful.

Ian C

AI Update #3 is up:

https://forum.paradoxplaza.com/forum/index.php?threads/hoi4-together-for-victory-ai-update-3.988100/

QuoteHi everyone!
It is me again; your friendly neighbourhood AI developer. Today I will move on from focusing on bugs to looking at what we consider improvements, though as I stated at the end of the last diary the line between the two is very blurry when it comes to the AI.

This is the third installment of these mini diaries, and if you missed the other you can check out #1 (scroll to the bottom of that diary) and #2 respectively.

But to kick it off I thought I would tell you yet another story from the trenches.
We often run the game hands off over nights to see how it progresses for various countries, such as how the Japan vs China conflict works out. Some months before release I found an overnight had gotten a very surprising result: Italy had annexed almost the entire Soviet Union, while Germany had completely opted out of any Soviet territories. If any country beats Soviet Union, it does certainly NOT tend to be AI Italy, so something was clearly up. Going back in the autosaves we could see that it was indeed Germany pulling the most weight in the war, so the conclusion was that something unintended was going on in the peace conference. Letting the game run through the peace conference the crazy result was easily reproduced; Italy would consistently take Soviet territory, while Germany opts out and thus pass on their war score to Italy. So the question remained: why?
After a little digging I found that the fascist peace conference AI was set up to want to take neighboring territory, but be very reluctant with non-neighboring areas. But clearly Germany must have been neighboring Soviet? Well...in a sense. They had indeed defeated Poland before taking on the Soviet Union, but they were only occupying Polands states, since Poland had joined the Allies, which had of course not yet capitulated. Since we separate ownership and control of areas, and the neighboring check looked specifically at ownership (after all, Germany was not guaranteed to get to KEEP Poland), they ended up ignoring Soviet areas as NOT connected to their own areas, while Italy had annexed Romania in an earlier war and considered their areas as connected by land to Soviets.

The peace conference AI has since been refined to avoid silliness like this, but it does serve to illustrate how you need to keep a lot of different potential situations in mind when designing and programming AI. And this is far from the most complicated systems.

Today I will introduce something brand new; my work on encriclement AI!

- AI now attempts to detect and react to many encirclement opportunities, both against itself and against enemies. Includes evacuating dangerous areas and cutting off bottlenecks.

    Detecting potential encirclement situations is a really hard problem. A human, with her superior pattern recognition abilities, can take a glance at a map and point out such situations in practically no time at all. A computer, not so much. The thing is that you need to consider the relation between at least five or so provinces to detect the smallest encirclements, and for large ones the number gets really big. Computers are inherently bad at considering more than one relation at a time. While the approach for narrower bottlenecks and larger encirclement patterns is somewhat different, and particularly the latter is not 100% accurate, but where to draw the line between potential encirclement is not always clear anyway. The type of reaction varies a bit depending on the situation detected, but all in all the AI is better at countering attempts at encirclement and to try to act on opportunities they get. Though there is of course room for some improvement I must say I am quite happy with the number of situations the AI is actually able to detect with relatively few false positives. I hope this makes the game both more challenging and engaging for you!



Of course, I cannot only leave you with only one point, even if it is a big one, so I will also use this diary to talk a bit about defensive AI.

- Split up AI garrison order in two: home area and other areas.

    For a country like Germany, using a single garrison order is fine. For a country like the Soviet Union or even France, they risk having units sent around the world, not doing much to help at all, just because the order mechanic is attempting to balance the units inside the order. Not to mention how strangely balanced the spread becomes due to area around the capital typically gets too few units while far away areas ends up with too many. Splitting up the order greatly improves the AIs ability to defend. The units move around less withing each order, and the AI can balance between oversea areas (or...you know...Siberia) and the area around its capital.


- AI is no longer using all types of garrison locations.

    The AI can and does indeed make use of this new feature. In many situations it is a waste of units to garrison everything you possibly can. While being on the offensive, garrisoning your forts can typically be wasteful if not all ports are covered to defend against potential invasions.


And that is all for today. Next time (which is probably going to be wednesday) I intend to be talking about boats and boaty related stuff. Until then, I am getting back to work on more improvements for future updates.


sandman2575

"- AI now attempts to detect and react to many encirclement opportunities, both against itself and against enemies. Includes evacuating dangerous areas and cutting off bottlenecks."

I'm kind of amazed (and dismayed) that things like this are only being added to game 6+ months after release.... :(

HoodedHorseJoe

Quote from: sandman2575 on December 13, 2016, 10:52:24 AM
"- AI now attempts to detect and react to many encirclement opportunities, both against itself and against enemies. Includes evacuating dangerous areas and cutting off bottlenecks."

I'm kind of amazed (and dismayed) that things like this are only being added to game 6+ months after release.... :(

Well, not that I know a lot about game development, but I imagine when you're first coding things like AI, you give it a bunch of tools in the hope that it will 'naturally' use those to pull off strategies like encirclement. I mean, you want it to be able to defend itself properly and react to player behaviour right? My best guess is that they took an all-purpose approach initially.

When obvious gaps show up though, you then specifically code in behaviour for specific action-sets without breaking what you've already done - which is what we have now. I wouldn't say it's a case of them not thinking of it, it's just that they now have to code in that specific behaviour because - for whatever reason - it's not reacting naturally to this stuff.

Battles in HoI 4 can be quite hectic with a lot of factors that need to be taken into account all at once - it's probably quite hard to test for this stuff.

Just my thoughts anyway.

Communications Director
Hooded Horse

We are a publisher of indie games with strategic and tactical depth. 28 projects and counting, come check out our portfolio on Steam, GOG, and the Epic Games Store!

You may have seen me around in previous roles such as editor of Wargamer.com and Strategy Gamer.

sandman2575

That's a fair point, and I definitely don't underestimate just how difficult it must be to program an AI for a game as complex as HOI4. What worries me, is that Pdox may have built a beautiful, groundbreaking ww2 game that is simply beyond AI's capabilities to play effectively.