Hearts of Iron IV · Frontlines AI · Setup guide How to set up Frontlines AI for Hearts of Iron IV

Two downloads, one switch in the game launcher, and one setting in Gaming AI. No third-party mods, no API key, and nothing to downgrade.

Start at step 1

Tick each step off as you finish it. Your place is saved on this device.

What you need

  • Hearts of Iron IV on SteamOn Windows. The current version, and no DLC is needed.
  • Windows 10 or 11Frontlines AI and Gaming AI are Windows only.
  • The Gaming AI appIt runs the AI model for Frontlines AI, so there's no API key to set up. Free to install: get it from the home page. Conversations use Vigor, from 99¢.

Step 1

Install Frontlines AI

Frontlines AI comes in two parts. This step installs the app: it runs next to the game, carries your messages to Gaming AI and shows the conversation window. The next step adds the mod itself to Hearts of Iron IV, through the Steam Workshop. You need both.

Download Frontlines AIThe Windows installer, free, about 107 MB

It's the same download as the button at the top of the Frontlines AI page, and it always fetches the newest version.

The Frontlines AI page on gamingai.software with the Download Frontlines AI button

Run the installer

Run SentinelSoftware.FrontlinesAI-win-Setup.exe once it's downloaded. It installs Frontlines AI and opens it for you when it's done.

The console: leave it open

Frontlines AI opens as a console window with Gaming AI across the top, a few start-up notes and the release notes. The last line should read Frontlines AI is up to date: it checks for a newer version every time it starts.

The Frontlines AI console with its start-up notes, release notes and the line Frontlines AI is up to date

Minimize it, don't close it. The console is Frontlines AI running. Close it and the conversation window goes with it. It's also the first place to look if anything goes wrong, since it logs what it's doing.

“SetProcessDpiAwarenessContext() failed: Access is denied.” If you see this line, ignore it. It's a display-scaling notice from the window toolkit, not an error, and it doesn't affect anything.

Step 2

Subscribe on the Steam Workshop

The mod is the part that goes into Hearts of Iron IV. It adds the AI Diplomacy action you'll use to open talks. Steam installs it for you and keeps it updated.

Frontlines AI on the Steam WorkshopFree, about 700 KB

On the Workshop page, click the green + Subscribe button.

The Frontlines AI page on the Hearts of Iron IV Steam Workshop, with a Diplomacy News screenshot and the Subscribe button

The button turns to Subscribed, and Steam confirms the item has been added to your subscriptions.

The Subscribed button and Steam's note that the item has been added to your subscriptions

“Some games will require you to relaunch them.” If Hearts of Iron IV or its launcher was already open, close it and start it again so Steam can download the mod.

Step 3

Add it to your playset

Subscribing downloads the mod. The game only loads it once it's in the playset you play with, and switched on.

  1. Start Hearts of Iron IV from Steam. The Paradox launcher opens.

  2. Go to Playsets in the menu on the left. Pick the playset you play with from the dropdown at the top, or make a new one just for this. Ours is called AI.

  3. Click Add mods, find Frontlines AI and add it.

  4. Check the switch next to it says Enabled.

    The Paradox launcher's Playsets page with the AI playset selected and Frontlines AI in it, switched to Enabled

Play with that playset. The launcher plays whichever playset is selected at the top. If you switch back to one without Frontlines AI, the game starts fine and the AI Diplomacy action simply isn't there.

Running other mods? Frontlines AI is built and tested on the base game. Smaller mods sit alongside it, but big overhaul mods change things it relies on, so combining it with one may not work. If something behaves oddly, try a playset with Frontlines AI on its own.

Step 4

Connect Gaming AI

This is the step that matters most. Frontlines AI sends every message to Gaming AI on your PC, on Gaming AI's own custom port.

Select the custom port

Open Gaming AI, go to Ports, and under Custom port click Copy and use next to 57775. The card switches to In use.

The Ports page in Gaming AI with the Ollama, Kobold and OpenAI presets above, and the Gaming AI custom port, 57775, marked In use

Not one of the presets. The Ollama, Kobold and OpenAI cards are for other mods. Frontlines AI wants the custom port, 57775.

Load a model

Open the AI Models page in the sidebar and load the model you want. Start with a budget model to test your setup without spending much Vigor, then switch to a balanced model for the rest of your campaign once everything works.

New to Gaming AI? Grab the 99¢ pack and try a few models. They behave very differently at the negotiating table, and it's worth finding one you like before you commit to a long campaign. Keep Gaming AI open the whole time you play.

Step 5

Check your settings

With Gaming AI and the Frontlines AI console both open, press Play in the launcher. When Hearts of Iron IV starts, the Frontlines AI Settings window opens over it. Press F1 any time to show or hide it. Two tabs are worth a look before your first game.

Connection: the lamp should be green

The Connection tab shows the port Frontlines AI is sending to, 57775, and a lamp beside it. Green, with Gaming AI is answering, means the two are talking and you're set.

The Connection tab of Frontlines AI Settings: Gaming AI port 57775 with a green lamp and Gaming AI is answering

Not green? Check Gaming AI is open, with the custom port in use from step 4, and that the port numbers match in both places.

Gameplay: it has to find game.log

Frontlines AI follows the game through the log Hearts of Iron IV writes as you play. On the Gameplay tab, the first box is your Hearts of Iron IV documents folder, and underneath it should say Found logs\game.log with a green lamp. It fills itself in, so you normally don't need to touch it.

The Gameplay tab: the Hearts of Iron IV documents folder with Found logs\game.log, the game install folder found automatically, and the Game Link options
  • Game install folder: leave it blank. Frontlines AI finds your Steam install on its own and reads each country's flag from it.
  • Log check interval: how often it checks the log. 250 ms is a good default; lower is snappier, higher is lighter on the PC.
  • Show this window when Hearts of Iron IV starts: untick it once you're set up if you'd rather it stayed out of the way. F1 still brings it back.
  • Let the AI close the channel when talks turn hostile: leave it on for envoys who can walk out on you.

If you change anything, click Save. The bottom of the window says All changes saved once it's done.

Step 6

Open talks

You're ready. Start or load a game, pick a nation and open its diplomacy screen the usual way. At the top of the Actions list you'll find a new one: AI Diplomacy. Like the game's other diplomatic actions, it costs political power.

The diplomacy screen for the Dominion of Canada with AI Diplomacy at the top of the Actions list

Click it and the correspondence window opens, headed with that nation's flag and name. It starts empty. Type your opening message in the box at the bottom and click Send: their envoy reads it and writes back.

The Frontlines AI correspondence window for the Dominion of Canada, saying No correspondence, write below to open talks, with a message box and Send button

Say what you want, and what you'll give for it. Envoys argue their own government's case and don't give ground for free. A clear offer gets a clear answer: yes, no, or terms of their own.

That's everything

Go sit down with an envoy and make them an offer the peace conference never could. We hope the guide was easy to follow, and that the war ends on your terms.

Setting up another game? See all setup guides.

Troubleshooting

The problems people hit most, and what fixes them.

The conversation window doesn't appear over the game.

Check the Frontlines AI console is still open: it's the app running, and its windows close with it. If you closed it, open Frontlines AI again from the Start menu. Also check the lamp on the Connection tab of Frontlines AI Settings (F1) is green.

The lamp in Frontlines AI Settings isn't green.

Frontlines AI can't reach Gaming AI. Open Gaming AI, go to Ports and click Copy and use under Custom port, so 57775 is in use. Then check the Connection tab in Frontlines AI Settings shows the same port, and keep Gaming AI open while you play.

It says it can't find game.log.

On the Gameplay tab, click Browse next to the documents folder and pick your Hearts of Iron IV folder under Documents\Paradox Interactive. If OneDrive backs up your Documents folder, it's under OneDrive\Documents instead. The game only writes game.log once it has run, so start Hearts of Iron IV once if the folder is empty.

There's no AI Diplomacy action on the diplomacy screen.

The mod isn't loaded. In the Paradox launcher, check the playset selected at the top has Frontlines AI in it, switched to Enabled, and press Play from there. If it isn't in your mod library at all, check you're subscribed on the Workshop and restart Steam so it downloads.

I closed the console window.

That's Frontlines AI itself, so the conversation window went with it. Open Frontlines AI again from the Start menu and leave the console open, minimized if you like, while you play.

The console says SetProcessDpiAwarenessContext() failed: Access is denied.

Ignore it. It's a display-scaling notice from the window toolkit, not an error, and Frontlines AI works normally.

Do I need both the download and the Workshop mod?

Yes. The Workshop mod adds the AI Diplomacy action to Hearts of Iron IV. The app you download is what carries your messages to Gaming AI and shows the conversation. One without the other does nothing.

How do I update Frontlines AI?

You don't have to. The app checks for a new version every time it starts, and the console says Frontlines AI is up to date once it has. Steam updates the Workshop mod by itself.

Does it work with other mods, or in multiplayer?

It's built and tested on the base game, and it's single-player only for now. Big overhaul mods change things it relies on, so combining it with one may not work. Tell us in Discord which mods you'd like it to work with.

Which AI model should I use?

Start with a budget model to check everything works, then switch to a balanced model for your campaign. Models behave very differently in conversation, so it's worth trying a few with the 99¢ pack.

Still stuck?

Frontlines AI is ours, so problems come straight to the people who build it. Open a ticket and we'll sort it out with you, and tell us in Discord which mods you want it to work with.

Frontlines AI is made by Gaming AI. Hearts of Iron IV is a trademark of Paradox Interactive AB, and Gaming AI is not affiliated with, endorsed by or connected to Paradox Interactive. Steam is a trademark of Valve Corporation. The game's name is used here only to describe compatibility.