[DEPRECATED VERSION] HoI4 to Stellaris Converter

  • 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.
Status
Not open for further replies.

PTSnoop

Freelance Vexillographer
74 Badges
Apr 25, 2014
426
74
  • Victoria 2: Heart of Darkness
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Magicka
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2: A House Divided
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Pre-order
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: Reapers Due
  • Hearts of Iron III: Their Finest Hour
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis IV
  • Hearts of Iron III Collection
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Hearts of Iron III
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Cities: Skylines - Natural Disasters
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings III
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
[MODERATOR EDIT]: Since this mod here hasn't been updated for quite some time, this thread has been locked.

If you still wanna use a HoI4-Stellaris converter mod, please refer to the supported/updated version. Thanks!
----------------------------------------------------------------



They said it couldn't be done.

Well, no, actually what they said was that it *shouldn't* be done. They said a Hearts Of Iron IV to Stellaris converter was unneccessary, that people could easily just create their own custom human race inside Stellaris with whatever ethos and backstory they wanted, and that a custom HoI4-to-Stellaris converter would be a lot of work for something actually quite pointless.

And, um, they were completely right. But hey, everyone needs a hobby!

---

Latest release:
DOWNLOAD

Older releases:
0.3A
0.3
0.2A
0.2
0.1A
0.1

The converter needs a human-readable save file, rather than the compressed ones HoI4 creates by default. To generate human-readable save files, you'll need to open up 'Documents\Paradox Interactive\Hearts of Iron IV\settings.txt' with a text editor, and change 'save_as_binary=yes' to 'save_as_binary=no' before saving. Or alternatively, you can use Ironmelt to decode them.

Also, to get this to work, you'll also need the Visual Studio 2017 C++ redistributable:
https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads

Instructions:
- Download the zip file and extract it somewhere.
- Open up configuration.txt. Add your own paths to your save file, HoI4 install directory (or Vic2-to-HoI4 mod), and Stellaris mod directory.
- Run Converter.exe .

Source code github links coming once I figure out what the forum policy is on github links and where they are/aren't allowed.

---

Screenshots:

index.php

index.php

index.php

index.php


---

( Original post: )

20180130212452_1.jpg


20180130214943_1.jpg


20180130215044_1.jpg


20180130222529_1.jpg


---

Features:
- Picks out the top few nations after the WW2 peace conferences and gives them their own exoplanet colonies to start from. Bigger / more industrialised countries get better planets, weaker nations get extra difficulty-setting-style penalties.
- Simulates a halfway-plausible timeline between the end of WW2 and the 2200 Stellaris start date. Possible futures include Cold Wars between major powers, nuclear war making Earth uninhabitable, climate change making Earth a bit less hospitable in a few different ways, and/or bureaucratic overhead keeping Earth as an early-space-age Primitive Civilization while the other nations bestride the heavens. Or maybe Earth is perfectly fine and is happily governed by whoever most emphatically won HoI4.
- Supports Vic2-to-HoI4 converted games, including ones that were converted from EU4 and CK2. Karlings in space, anyone?

Known limitations:
- Really not very well tested at all.
- No, seriously. I've only tried this out on the handful of Vic2 save files I've got lying around. If something goes wrong for you, please send me a copy of your log file and save file and/or Vic2-to-HoI4 mod so I can have a go at getting it fixed.
- Name lists get generated for each of the converted empires, but all the actual humans get their names from the default human name list instead. The only way around this would be to create separate human species with different name list - but then humans don't recognise each other as the same species. To get around this, I put a few lines in the backstory about mass migrations breaking down ethno-national boundaries. This makes more sense for freedom-loving democracies than for lebensraum-dominating fascist states, I suppose - but then maybe the ideals of the Reich got a bit lost-in-translation over hundreds of years.
- Ship names and planet names are generated from the HoI4 ship name lists. But converted games don't have those yet (everyone just uses the generic ship names), so at the moment Vic2->HoI4->Stellaris games don't have any planet names. I'll probably push some changes ot the Vic2-to-HoI4 converter at some point to address this.
- 64-bit Windows only at the moment. Linux support should be trivial, but I've not tested it yet.
- No converter frontend support yet. It shouldn't be too hard to add this, though.
- I'm planning to tie this in with the HoI4 to DEFCON converter - once I finish actually writing it.
- Probably won't work with the 2.0 update for a while.
 

Attachments

  • HoI4ToStellarisConverter_0.1.zip
    25,7 MB · Views: 36
Last edited by a moderator:
  • 2Like
Reactions:
I saw the github repo go live and was just waiting for the threads! I also immediately thought 'this could use frontend integration', and was gratified to see you'd thought of it too. As far as that goes, you should just need to create your own edited copy of SupportedConvertersDefault.xml and provide a HoI4toStellarisDefaultConfiguration.xml or whatever you call it. It's pretty straightforward, actually!
 
I demand a screenshot of space Nazis!
 
You... beautiful... madman...

Now you did it.
Now you made me.
Start a CK2 campaign that should be somewhere around the end of HoI4 by the time you update this for 2.0 ;)
 
I have a problem and I don't know what to do. Can anyone help me with it? Its my output:

Parsing configuration
Save file: C:\Users\kub-k\OneDrive\Dokumenty\Paradox Interactive\Hearts of Iron IV\save games\Tutaj.hoi4
HoI4 location: C:\Program Files (x86)\Steam\steamapps\common\Hearts of Iron IV
Stellaris mod path: C:\Users\kub-k\OneDrive\Dokumenty\Paradox Interactive\Stellaris\mod
Running from: C:/Users/kub-k/Desktop/coś/HoI4ToStellarisConverter_0.1/
Parsing save file...
Traceback (most recent call last):
File "naive_parser.py", line 72, in ParseSaveFile
File "d:\python35\lib\codecs.py", line 321, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd9 in position 39: invalid continuation byte
Carrying on regardless.
Parsing save data...
Traceback (most recent call last):
File "Converter.py", line 91, in <module>
File "Converter.py", line 24, in __init__
File "naive_parser.py", line 79, in ParseSaveFile
File "naive_parser.py", line 156, in ParseSaveData
IndexError: list index out of range
 
Thanks, werd713. That save file has revealed no less than three serious bugs in the converter!

- First up: by default, HoI4 save files are compressed, in a basically-unreadable format. For HoI4 to output human-readable (and converter-readable) save files, you'll need to open up 'Documents\Paradox Interactive\Hearts of Iron IV\settings.txt' with a text editor, and change 'save_as_binary=yes' to 'save_as_binary=no' - or use Ironmelt to decode them. Because I set the settings flag ages ago, I forgot to add any instructions about this - or add any code to return a halfway sensible error message! My bad.

- All the save files I'd tested on had at least one world war. As far as I can tell, your save file hasn't - so when trying to work out who won, the converter was getting confused and dividing by zero.

- I'm apparently still not handling unicode special characters in name lists properly, and my if-all-else-fails-just-remove-the-accents code isn't properly picking up the Polish l-with-stroke.

So thanks for the testing data. I've written a quick fix for bug 2 and an at-least-it'll-build clunky workaround for bug 3, and edited the top forum post to say something about the save_as_binary thing. The fixes will be in the next release. But for now, I've also run your save file through my a-bit-more-fixed version of the converter, and attached the output to this post.
 

Attachments

  • tutaj.zip
    108,7 KB · Views: 16
Hello. I have a problem too, but another one (i suppose). Could you help me too?
 

Attachments

  • output.log
    2,4 KB · Views: 11
Just a head up this is a ck2 to hoi4 game so that may have something to do with it, it says conversion is complete but when I launch the game I cannot find any of the countries, idk any help would be great.
 

Attachments

  • output.log
    29,9 KB · Views: 14
  • U73_1951_02_21_01.hoi4
    20,8 MB · Views: 5
Im super excited to try this out!! I follow the instructions (correctly to my knowledge) and i still get an error...
attached is my Output log and my HOI4 save file.. what could the problem be?
 

Attachments

  • output.log
    730 bytes · Views: 14
  • CONVERT.hoi4
    41,6 MB · Views: 7
What happens if you do a world conquest in Hearts of Iron and then convert? Do you start on Earth?

Yes - or if it looks like you're sufficiently far ahead that you're going to take over the world, then you start off in control of Earth and everyone else starts off with other planets.

Hello. I have a problem too, but another one (i suppose). Could you help me too?

Looks like you've fallen afoul of the same unicode-namelist bug werd713 was having problems with. Hopefully the next release should work fine (I'll try to get it pushed out in the next few days).

Just a head up this is a ck2 to hoi4 game so that may have something to do with it, it says conversion is complete but when I launch the game I cannot find any of the countries, idk any help would be great.

A few possible things, depending on what you mean when you say you can't find any of the countries.
- If you're loading up Stellaris, clicking New Game, but not seeing a species-list entry for "Converted From HoI4" (it should be just above the United Nations of Earth), then it's possible you've not loaded the mod. Make sure you've got it selected in the Stellaris launcher.
- If you've started the game, not unpaused yet, and you can only see the Earth without any of the new countries - then that's expected behaviour. When you unpause the game, you'll get an event asking you which country you want to play as.
- If you've chosen an empire, but you can only see yourself and not any of the other human empires - then that's expected behaviour too. I wondered about adding some event code to give you all contact with one another, but I figured it would be closer to the vanilla game if you had to go and find them yourself (and, I wanted to get a release out before 2.0 came along and broke everything).
- If you've been playing for a while, but you've still not met any other human empires - then it's possible they're still there, and you've just not met them yet. I've tried to keep the human empires quite spread out, so you've got room to expand without banging into one another. Then and again, it's also possible the converter's not worked properly. One way to check is to open up a console and run the command "observe" - this'll let you see exactly where everyone is. If you're really alone in the universe, let me know and I'll start thinking through exactly why that might happen.

Im super excited to try this out!! I follow the instructions (correctly to my knowledge) and i still get an error...
attached is my Output log and my HOI4 save file.. what could the problem be?

NothingButRye: I've found the problem. Normally, the converter looks at the climate of your capital city to work out what climate of planet to give you (so Space Russia gets an arctic planet, Space France gets an alpine planet, Space Tanzania gets a savannah planet, etc). But Hearts of Iron IV/map/strategicregions/167-New Guinea.txt has no weather data, so the converter doesn't know what type of planet to assign, and crashes. Should be an easy fix, I just need to add a default option. I'll get it out in the next update (in the next few days).
 
New release: version 0.1A.

Download

New features:
- I've included Rob's Variable Earth Climates mod. If global warming or nuclear winter destroys the Earth's climate, Earth will still look like Earth rather than a random arid/arctic/whatever planet.
- Better support for absolutist/anarchocapitalist/syndicalist governments.

Lots of small bugfixes:
- Better unicode handling. The converter should hopefully no longer crash when trying to write out special characters into namelists.
- Dynamically created nations (Nationalist Spain, Vichy France, etc) should now have the right names.
- Earth will no longer sometimes rename itself.
- If your capital is in a region with no HoI4 weather data, you'll now get an arid planet rather than a converter crash.
- No more ship or planet names with numbers in. German planets will no longer be named after U-boats.
- Stellaris will no longer occasionally crash when trying to hand Earth over to newly-created empires.
 

Attachments

  • HoI4ToStellarisConverter_0.1A.zip
    40,8 MB · Views: 29
Not yet. Just gave it a try, and there's a few issues to sort out.

- The current parser is having a few problems with some of the modded state-history files - mostly easy fixes, coming in the next release.
- But more seriously, there are some close-speechmarks missing in the modded countries_l_english.yml (eg. line 1717, CRO_communist_DEF:0 "The Croatian Socialist Republic) which are causing my yml parser serious bother. For testing, I've gone through the files and fixed them by hand, but for a long-term fix I should probably have a word with the Millennium Dawn devs about this.
- Several countries (I noticed PRC and RAJ, but there are probably others) don't have ship names in common/units/names . Possibly there's some internal logic to what to fall back to, but for now the converter is just generating empty lists.
- Apart from that, the only big outstanding problem is that the Stellaris converter doesn't understand most of the new ideologies and government types, and is falling back to generic isolationists. Really, I should create a separate config file for this to make it easy for people to add their own.
- Oh, and the generated history had "2024: First man on the moon".

So nothing insurmountable there, but a few things that need fixing at my end and a few more things that will probably need modding by hand afterwards.
 
New release: version 0.2.

DOWNLOAD

New features:
  • Full support for Stellaris v2.0! The converter will now output mods for the Cherryh update.
Screenshots:

20180224210534_1.jpg


20180224210223_1.jpg

20180224210343_1.jpg

20180224210156_1.jpg


Known limitations:
  • Any newly-created empires will immediately gain full communications with all fallen empires. There's no disestablish_communications event effect, so there's no real way around this. (Maybe I should just add a few lines to the generated histories about this, to make this look deliberate - something about first-contact by radio telescopes in the 2150s or something.)
  • I've had another go at getting the empire-specific name lists working, but no success so far. The rumours that species will recognise each other if they have the same portrait and name were apparently exaggerated.
  • Mod support could still be better. At the moment, the converter only supports one mod at a time - and it needs to be a sufficiently large mod, with its own replacements for all the required HoI4 files. (Also, I should probably stop hardcoding government types and separate them out into their own file, to make it easier to support big mods like Millennium Dawn and Kaiserreich.)
  • I've got a sneaking suspicion that some rarer countries still won't work properly. Depending on what tag the Franco-British Union takes, it may well go back to thinking of itself as just France or the UK. And I don't know where the People's Republic of China is getting its ship names from, so it's likely the converter won't know either.
  • As always, more testing required. If you have any non-working HoI4 saves (or just any sufficiently interesting ones!) then please send me a copy of your log file and save file and/or Vic2-to-HoI4 mod.
 

Attachments

  • HoI4ToStellarisConverter_0.2.zip
    40,8 MB · Views: 20
I've just finished going through a normal Mega-Campaign with the WTWSMS mod for CK2, and I think I've tried just about everything I can do to get this mod working, and before I try to delve into code, I thought I'd might try to lodge a post here to see if this save file, or the converter can be fixed. Help would be much appreciated!
 

Attachments

  • output.log
    1,8 KB · Views: 10
  • CONVERTTHIS.hoi4
    3,1 MB · Views: 5
Status
Not open for further replies.