Late-Game Slowdown Fix - Save Repair Tool
Добавить в игру через Steam
Нажмите «Подписаться»
На странице Steam войдите в аккаунт, если потребуется.
Подписаться
О материале
«Late-Game Slowdown Fix - Save Repair Tool» — материал мастерской Hearts of Iron IV. Альтернативная история, фокусы и модификации стратегии. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
Does this sound like your game?
-
Your game was running fine, then after loading a save it became much slower - and never recovered
-
One CPU core is at 100%, the others sit idle
-
Deleting units, ending wars, or just playing on doesn't help
-
A brand-new game runs fine
If so, it might be due to a bug in the supply calculation with foreign docking rights. The tools included here can repair this bug and fix your save.
In one of my games this fix reduced the time of an in-game hour from 1100 ms to 40 ms (30x speedup), without deleting units or annexing states.
Important - read before subscribing
This mod contains no game content! It is a container for save-repair tools, distributed here because the Workshop is where people look. Enabling it changes nothing in game - you can leave it disabled. The tools are in the tools folder inside the mod.
You will find the mod folder under:
Steam\steamapps\workshop\content\394360\3773660511
These tools can fix your save, but they don't prevent the problem from reoccurring again later. If it does, you can just use these tools again. Alternatively, you can use my other mod, Late-Game Slowdown Fix - No New Docking Rights, to disable the granting of docking rights, preventing the issue from surfacing again.
How to use it
There are several versions of the tool (Python, batch, bash+perl), use whichever you prefer and aim it at the affected the save, it will make a fixed copy.
For Windows users without Python, Bash or Perl:
-
Open the tools folder of the mod. The default location of the mod is *C:\Program Files x86)\Steam\steamapps\workshop\content\394360\3773660511[\i]
-
Drag your .hoi4 save onto FixDockingRights.bat. The default location of saves is [i]Documents\Paradox Interactive\Hearts of Iron IV\save games*
-
It tells you if your save is affected by the issue and offers to fix it.
-
A repaired copy appears next to your save as _fixed.hoi4. Start the game, then load that one.
What causes it
When a country grants docking rights, it creates a hidden supply node inside their territory. The game handles that node in an inefficient way - the hourly supply calculation degenerates into a slow scan that can consume an enormous amount of CPU on large maps.
Why it only appears after a reload: It is hard to say without seeing the source code of the game, my guess is that the hidden nodes are handled correctly when they are appended to the supply structure. However, on reload the entire structure is rebuilt and it seems to lead to a broken state.
Checked across three unrelated campaigns: zero affected nodes in every healthy save, at least one in every slow save.
Why cancelling docking rights in game does not fix it
Cancelling the agreement does not delete a node that already exists. A node can even outlive its agreement entirely - one of my affected campaigns had a stuck node belonging to a country with no docking-rights agreement left anywhere in the save.
HOI4 exposes no scripted effect that touches supply nodes at all, so no mod can remove them. Editing the save is the only complete repair.
This is a base-game bug, but mostly shows up in mods
Docking rights is a base HOI4 feature, but this bug mostly shows up in total conversion mods (e.g., OWB). My guess is that it is related to map topology and the base game map is less likely to suffer from this.
Is it safe?
Yes, the script makes a new, fixed copy of your save.
Note that the scripts themselves were authored by AI, but I checked and tested them. You can also just read them yourself if you are worried, they are in plain text.
"This save is not in plaintext format"
The tool needs a plaintext save. If yours is binary it will say so and tell you which of these two applies. Neither is hard to fix. Cause 1 — the save_as_binary setting HOI4 can write saves in a compressed, binary format. The only way to change that is to edit the config file:
-
Close HOI4 completely. The game rewrites this file when it exits, so an edit made while it is running will be lost.
-
Edit:
Documents\Paradox Interactive\Hearts of Iron IV\settings.txt
- Set:
save_as_binary=no
-
Save the file and start HOI4.
-
Load the affected save, then save it again under a new name.
-
Run the tool on that new save.
Cause 2 — Ironman Ironman saves are always binary, whatever that setting says. Continue the save as a non-Ironman game, or save with Ironman disabled, then run the tool on that file.
Note that plaintext saves are much larger (>100MB) so you might want to switch back to compressed saves once you are done.
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.