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

GSP Jr

Colonel
16 Badges
Apr 27, 2017
1.187
1.078
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron 4: Arms Against Tyranny
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Semper Fi
Description of issue
Invasion Fleet Routes

Game Version
Cornflakes v1.5.4 (1503)

Enabled DLC
Together for Victory,
Death or Dishonor,
Waking the Tiger, All of the above

Do you have mods enabled?
Yes

Description
After obtaining Naval supremacy in all sea areas the army needed for an invasion, planning said invasion, the dumb-ass navy takes a completely different route. If you are going to all that trouble for a overseas landing, it would be really nice if the AI actually followed the route. Please fix this in MtG for goodness sakes, it has been an issue forever.

Steps to Reproduce
1 - Go through the process of setting up invasion. Use one across an ocean with multiple sea areas to traverse,

2 - Launch invasion.

3 - See the difference between the planned and actual routes and hope there is no enemy fleet waiting to ambush you.

Upload Attachment
 

Attachments

  • Hearts of Iron IV Dumb ass invasion route 2.png
    Hearts of Iron IV Dumb ass invasion route 2.png
    3 MB · Views: 20
  • Hearts of Iron IV Dumb ass invasion route.png
    Hearts of Iron IV Dumb ass invasion route.png
    3,3 MB · Views: 18
Upvote 0
I read that, seen it a couple times, just thought if there was a picture instead of a lot of words, and MtG is suppose to be re-doing sea warfare, that maybe this time it would be taken seriously.
Enjoy your posts btw.
I made a gif how your invasion route gets calculated (100 seconds): Hearts of Iron IV Dumb ass invasion route 2.gif
(this data is traced from the running game while a division launched at the starting port)
The top number next to each arrow is the distance travelled up to this point. The second number is the estimate of how far the target is still away (this is the buggy part). The algorithm tries to minimze the sum of the two in each iteration. But the estimate is not even a taxicab metric as I thought in the other thread - it's just (x2-x1) + (y2 - y1), which is why the path loves to move north east.
 
Last edited:
They just should "simply" use that same algorithm that is used to draw the planning arrow and call it a day.

("Simply" set in marks because I don't know how simple that actually is. Depends most likely on the used object hierarchy, I guess)
 
They just should "simply" use that same algorithm that is used to draw the planning arrow and call it a day.
("Simply" set in marks because I don't know how simple that actually is. Depends most likely on the used object hierarchy, I guess)
I don't think it would be more difficult than changing a "false" to a "true" at the right location, because that's what it comes down to in the compiled game. I patched the game locally to confirm it fixes the bug.
 
I made a gif how your invasion route gets calculated (100 seconds): View attachment 415418
(this data is traced from the running game while a division launched at the starting port)
The top number next to each arrow is the distance travelled up to this point. The second number is the estimate of how far the target is still away (this is the buggy part). The algorithm tries to minimze the sum of the two in each iteration. But the estimate is not even a taxicab metric as I thought in the other thread - it's just (x2-x1) + (y2 - y1), which is why the path loves to move north east.

Great find. I hope the team will see your GIF and make the changes @podcat
 
I know this is a bit old, but I just stumbled upon this...

Speaking as something of a programmer myself (willemdafoe.jpg):

1) The system should have an idea of the "straight line" distance from origin to destination.

2) Then, much like the gif, the instant that the distance goes too far "over" the straight line distance, the algorithm should end continuing down that path.

I'm noticing that the algorithm is still considering paths that just really should never even enter into the "smell test". Further, restricting those pathing decisions (and because there should be some "memory") should cut down on the number of cycles it would take the AI to actually calculate a path. I'd imagine that there should be something of not only a weight to distance traveled, but also direction (ie, the AI recognizes that traveling away from where the troops need to be going is adding to cost). Thus, moving 12 at 0 degrees off true is better than traveling 6 at 180 degrees.

Does that make logical sense or am I just off my rocker and making things worse?
 
What really bugs me is after forcing the player to get naval superiority all along the initial route, the initial route is disregarded the second you hit the "go" arrow.
The officer that did that IRL would probably not last long.
 
1) The system should have an idea of the "straight line" distance from origin to destination.
It has this idea but it's not correctly enabled here (e.g. by contrast the drawn invasion arrow is correct)

I'd imagine that there should be something of not only a weight to distance traveled, but also direction (ie, the AI recognizes that traveling away from where the troops need to be going is adding to cost).
There already are two weights on each edge, the second one being the remaining distance to the target. This is not just something the hoi4 devs came up with, it's a standard pathing algorithm. You can read about it on wikipedia.