From 6402bb52bccc8a2f03ce9828cf83e067629cf957 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 9 Apr 2022 18:07:15 -0700 Subject: [PATCH] FACTO-97: Print base debug now prints to console as well as ingame --- changelog.txt | 1 + libs/AIPlanning.lua | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/changelog.txt b/changelog.txt index b330125..3386b1d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -21,6 +21,7 @@ Version: 3.0.0 - Walls and transport belts no longer provide points to the AI when they are destroyed - Reduced inferno fire damage by roughly ~75% and reduced inferno sticker damage by ~60% - Siege groups should try to settle slightly further from player structures + - AI Debugging states are now printed to console and in-game Bugfixes: - Fixed Krastorio2 on_force_created playerforces being nil - Fixed enemy map scan creating bases unnecessarily diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index b6fb8e7..128792a 100644 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -336,18 +336,20 @@ local function temperamentPlanner(base, evolutionLevel) base.temperament = ((base.temperamentScore + TEMPERAMENT_RANGE_MAX) * TEMPERAMENT_DIVIDER) if universe.debugTemperament then - game.print("Rampant Stats:\naN:" .. base.activeNests .. ", aRN:" .. base.activeRaidNests .. ", dPB:" .. - base.destroyPlayerBuildings .. ", lEU:" .. base.lostEnemyUnits .. ", lEB:" .. - base.lostEnemyBuilding .. ", rL:" .. base.rocketLaunched .. ", bEB:" .. - base.builtEnemyBuilding .. ", iCB:" .. base.ionCannonBlasts .. ", aB:" .. - base.artilleryBlasts .. ", temp:" .. base.temperament .. ", tempScore:" .. base.temperamentScore .. - ", points:" .. base.points .. ", unitPoints:" .. base.unitPoints .. ", state:" .. - constants.stateEnglish[base.stateAI] .. ", surface:" .. base.surface.index .. " [" .. - base.surface.name .. "]" .. ", aS:" .. universe.squadCount .. ", aB:" .. universe.builderCount .. - ", atkSize:" .. universe.attackWaveSize .. ", stlSize:" .. universe.settlerWaveSize .. - ", formGroup:" .. universe.formSquadThreshold .. ", sAgg:".. base.sentAggressiveGroups .. - ", mAgg:" .. base.maxAggressiveGroups .. ", baseState:" .. base.stateGeneration .. - ", baseId:".. base.id) + local strConsole = "Rampant Stats:\nbaseId:".. base.id .. ", aN:" .. base.activeNests .. + ", aRN:" .. base.activeRaidNests .. ", dPB:" .. + base.destroyPlayerBuildings .. ", lEU:" .. base.lostEnemyUnits .. ", lEB:" .. + base.lostEnemyBuilding .. ", rL:" .. base.rocketLaunched .. ", bEB:" .. + base.builtEnemyBuilding .. ", iCB:" .. base.ionCannonBlasts .. ", aB:" .. + base.artilleryBlasts .. ", temp:" .. base.temperament .. ", tempScore:" .. base.temperamentScore .. + ", points:" .. base.points .. ", unitPoints:" .. base.unitPoints .. ", state:" .. + constants.stateEnglish[base.stateAI] .. ", surface:" .. base.surface.index .. " [" .. + base.surface.name .. "]" .. ", aS:" .. universe.squadCount .. ", aB:" .. universe.builderCount .. + ", atkSize:" .. universe.attackWaveSize .. ", stlSize:" .. universe.settlerWaveSize .. + ", formGroup:" .. universe.formSquadThreshold .. ", sAgg:".. base.sentAggressiveGroups .. + ", mAgg:" .. base.maxAggressiveGroups .. ", baseState:" .. base.stateGeneration + game.print(strConsole) + print(strConsole) end end