AI focuses

本页面所适用的版本可能已经过时,最后更新于1.8
Hstar讨论 | 贡献2020年8月15日 (六) 16:33的版本 (merge from offical wiki)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)


AI focuses balance competing interests in several aspects of the game such as being more or less careful with attacks or prioritizing one field of research over another. Every AI country has a value for each of the focuses with higher values making the country focus more on that characteristic.

Focus Types

Defensive

Multiplied with PLAN_VALUE_TO_EXECUTE, defensive focus increases the threshold to execute battle plans. It increases the research priority of RADAR, construction and artillery among others. It defaults to 50 during peace, 100 when being in a defensive war and 0 when being in an aggressive war. France has a +50% bonus due to Édouard Daladier's Stout Defender trait.

Aggressive

Aggressive focus decreases the threshold to execute battle plans, making the AI more likely to activate risky plans. It increases the research priority of synthetic refineries, motorization and armor. It defaults to 50 during peace (fascist countries 75), 0 when being in a defensive war and 100 when being in an aggressive war. Italy has a +50% bonus due to the Vittoria Mutilata national idea.

War production

War production focus increases the research priority of industry and electronics techs to a lesser extent. It defaults to 10 during peace (fascist countries 30) and 100 when at war.

Military advancements

Military advancements focus increases the research priority for various advanced military techs like jets, night vision, nuclear etc. It defaults to 25 times the number of research slots (capped at 100) when at war and is reduced by 25% when at peace.

Peaceful

Peaceful focus increases the research priority for industry and electronics. It is 100 when at peace, 0 when at war.

Naval

Naval focus increases the research priority of naval doctrines by a large amount, marines and ship technologies to a lesser extent. Countries with dockyards have a default value of number_of_dockyards + (convoys_in_use + imported_resources)/5, capped at 100. This is reduced by 25% when at peace. Countries without dockyards default to -999.

Naval air

Naval air focus increases the research priority of carrier plane variants and naval bombers. The default value is 20 times the number of carriers, capped at 100. This is reduced by 25% when at peace. Countries without carriers default to -999.

Aviation

Aviation focus increases the research priority of air doctrines by a large amount, paratroopers and plane technologies to a lesser extent. The default value is 10 times the number of airports, capped at 100. This is reduced by 25% when at peace. Countries without airports default to -999.

Military equipment

Military equipment focus increases the research priority of infantry technologies by a large amount, artillery and support equipment to a lesser extent. The default value is 75 when at peace, 100 when at war.

Historical focuses

This focus doesn't have a value attached to it, but the AI will follow the national focuses in the specified order if historical AI focuses is enabled.

Modding

Focus factors

Each of the AI focuses can be changed with a matching country specific modifier called ai_focus_<x>_factor that gets applied after the default calculations above. E.g. ai_focus_naval_air_factor = 0.5 adds a 50% bonus to the naval air focus of the country.

Research weights

The /Hearts of Iron IV/common/ai_focuses files controls how much the AI focuses affect which kinds of research and national focuses.

Each focus name can be postfixed with a country tag to make a specific focus setup for a country, i.e. ai_focus_aviation_GER.

Here is a generic example:

<focus> = {
    research = {
        <technology category> = <weight>
    }
}

Historical focuses

To add historical national focuses, you add a ai_historical_focus_list_<tag> that contains the national focuses the AI should prioritize. This system has been somewhat super-seeded by AI strategy plans which allow for historical focus lists but also deviating from them when basic assumptions are broken.

Here is a generic example:

ai_historical_focus_list_<tag> = {
    ai_national_focuses = {
        <national focus>
    }
}