Troubleshooting is the identification of the cause of crashes, bugs or other problems.
Overview
In general there are two kinds of errors: fatal and non-fatal.
Fatal errors occur when the game cannot load a vital piece of data and cannot operate without it present. This causes a crash to desktop (CTD). When fatal errors occur, an exception will be printed to the exceptions.log. Typically these errors occur during the loading process or when a specific action is taken in game.
Non-fatal errors occur when the game encountered invalid data or broken syntax. These errors are almost always printed to the error.log.
Testing
Performing testing is vital to debugging a mod. Typically this is done via the in-game console with commands.
These are useful console commands for modders:
Command | Usage |
---|---|
reloadfx all | Reloads most of the effects used in the game, such as fog of war, the HDR and opacity of country borders, ect. |
reload texture | Reloads most of the textures used in the game, such as leader portraits, technology icons, etc. |
reload localization | Reloads most of the localization used in game, such as event titles and descriptions. |
reload defines | Reloads the defines files from /Hearts of Iron IV/common/defines/. |
reload focus | Reloads the focus trees in /Hearts of Iron IV/common/national_focuses/. |
reloadoob | Reloads the starting OOB file for the specified tag. |
reloadtechnologies | Reloads the technology files. Will cause a crash if an error is encountered. |
reloadinterface | Reloads the interface files (.gui). |
tdebug | Activates the debug tooltips, displaying important information such as state ID, province ID, etc. |
event | Fires the specified event immediate for the current player country. |
nocb | Removes restrictions on diplomatic actions. |
observe | Places the player into the observer slot, allowing the game to pass without player input. |
aiview | Displays the AI priorities when hovering over specific buttons, such as technology. |
tag | Switches the player to another country. |
update_loc | Reloads the specified localization key. |
updateequipments | Reloads the equipment files in /Hearts of Iron IV/common/units/equipment/. |
updatesubunits | Reloads the unit files in /Hearts of Iron IV/common/units/. |
research_on_icon_click | Activates research on click, allowing you to click on technologies to research them instantly. |
Focus.NoChecks | Removes the trigger checks for focuses. |
Focus.AutoComplete | Activates instant completion for focuses. |
set_country_flag | Sets the specified country flag for the current country. |
add_ideas | Adds the specified idea to the current country. |
Log files
The game stores various log files in your HOI4 user folder: (Windows: \\Documents\Paradox Interactive\Hearts of Iron IV\logs\
, Linux: .local/share/Paradox Interactive/Hearts of Iron IV/logs
). These are overwritten every time the game is started.
To enable full error logging, add the -debug
launch command via Set Launch Options in Steam.
File | Description | Usefulness |
---|---|---|
ai.log | Prints the AI choices undertaken. | Medium |
ai_trace.log | Prints the AI movements undertaken (divisions, ships, air, etc.) | Low |
error.log | Prints the various non-fatal errors. Many errors can be ignored, although almost all errors relating to files in the common folder should be fixed. | High |
exceptions.log | Prints the stacktrace when the game crashes to desktop. | Low |
executedcommands.log | Prints the internal commands uses by the player and AI. | Low |
game.log | Prints the actions taken by countries in game. Useful when the crash is due to a specific action. | High |
graphics.log | Prints the graphical errors relating to positions, rivers and trees. | Low |
memory.log | Prints the memory used during setup. Useful for crashes during the loading process, to see when the game crashed. | High |
message.log | Prints the session info for the current session. | Low |
postedcommands.log | Low | |
random.log | Prints times for gamestate changes. | Low |
receivedcommands.log | Prints the internal commands received by the player in multiplayer. | Low |
sentcommands.log | Prints the internal commands sent by the player in multiplayer. | Low |
setup.log | Prints the completion of setup loading for each part of the process. Very useful for discovering which file may be causing a crash. | High |
system.log | Prints the system information HOI4 is loaded on. | Low |
system_debug.log | Prints interface errors. | Medium |
text.log | Prints asserts on localization keys. | Medium |
time.log | Prints the time it takes for the various loading steps to complete, and the tick interval. Very useful for crashes during the loading process, to see when the game crashed. | Medium |
文件 | 效果 • 条件 • 定义 • 修正 • 修正列表 • 作用域 • 本地化 • on action • 数据结构 (标记, 临时标记, 国家别名, 变量, 数组) |
脚本 | 成就修改 • AI修改 • AI focuses • 自治领修改 • 权力平衡修改 • 剧本/标签 (游戏规则)• 建筑修改 • 人物修改 • 修饰性TAG修改 • 国家创建 • 军队修改 • 决议制作 • 装备修改 • 事件修改 • Idea修改 • 意识形态修改 • 军工商修改 • 国策制作 • 资源修改 • Scripted GUI • 科技制作 • 单位修改 |
地图 | 地图 • 省份 • 补给区域 • 战略区域 |
图形图像 | 界面 • 图形资产 • 实体模型 • 后期特效 • 离子效果 • 字体 |
装饰性 | 肖像 • 命名列表 • 音乐 • 音效 |
其他 | 控制台指令 • 故障排除 • 模组结构 • 成就代码分析 • Mod相关 • Nudger修改 |