1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

AI-variant without fuzzy-logic

It is now possible to switch to an AI-variant that uses hand-written heuristics for decision-making rather than the FuzzyLite-engine. This is configurable in nkai-settings.json via the new parameter "useFuzzy".
This commit is contained in:
Xilmi
2024-07-07 22:44:52 +02:00
parent aa891cb8b1
commit 7b407b6432
5 changed files with 76 additions and 28 deletions

View File

@@ -30,7 +30,8 @@ namespace NKAI
maxpass(10),
allowObjectGraph(true),
useTroopsFromGarrisons(false),
openMap(true)
openMap(true),
useFuzzy(false)
{
JsonNode node = JsonUtils::assembleFromFiles("config/ai/nkai/nkai-settings");
@@ -69,6 +70,11 @@ namespace NKAI
openMap = node.Struct()["openMap"].Bool();
}
if (!node.Struct()["useFuzzy"].isNull())
{
useFuzzy = node.Struct()["useFuzzy"].Bool();
}
if(!node.Struct()["useTroopsFromGarrisons"].isNull())
{
useTroopsFromGarrisons = node.Struct()["useTroopsFromGarrisons"].Bool();