M28AI Devlog (v148)
-
Hi maudlin27
Thank you for your detailed feedback. I have gone through your response, and I appreciate the clarification you have provided on various issues. I’ve also taken your suggestion to prepare a replay showcasing one specific issue observed with the M28 AIX Overwhelm rate.Replay Details:
In the attached replay, you can observe the following anomaly:AIX Overwhelm rate inconsistency: In the replay, many of the factories themselves fail to respond to the overwhelm multiplier properly. In the later stages of the game, there are also instances where production power seems to get applied without any observable incremental increase. Additionally, energy and mass extractors seem to receive a partial benefit, but the benefit applied is inconsistent and varies across different buildings.
I believe this has to do with how the multiplier is handled in relation to newly constructed buildings, which may not be adjusted correctly.Reference to FACN Platform Fix:
About ten years ago, I was working on a similar AI system for the FACN platform (similar to FAF but based in China, forked from an older version of FAF). At that time, while facing a similar issue with adaptive AI not applying overwhelm and cheat buffs accurately to new buildings, I managed to implement a fix to resolve it on that platform.Here is an example of how I approached it in Unit.lua under Unit = Class(moho.unit_methods):
lua
OnStopBeingBuilt/--------------Enable AIX Detection Thread
if ScenarioInfo.type ~= 'campaign' then
local AIBrain = self:GetAIBrain()
if string.lower(AIBrain.BrainType) ~= 'human' and self:GetAIBrain().CheatEnabled then
if ScenarioInfo.Options.AdpAI ~= 'off' then
self:ForkThread(self.CheckAutoAIbuff)
end
end
end
Additionally, I implemented a periodic check function to ensure proper multiplier adjustments:lua
CheckAutoAIbuff = function(self)
if not self:IsDead() then
if ScenarioInfo.type ~= 'campaign' then
local AIBrain = self:GetAIBrain()
if ScenarioInfo.Options.AdpAI ~= 'off' then
local refreshTime = (tonumber(ScenarioInfo.Options.AdpAI) * 60)
if not nextRefresh then
nextRefresh = refreshTime
end
if string.lower(AIBrain.BrainType) ~= 'human' and self:GetAIBrain().CheatEnabled then
local timeSecs = GetGameTimeSeconds()
RemoveCheatBuffs(self)
if timeSecs < nextRefresh then
SetupAICheatS(AIBrain,self,AdpCheatMult,AdpBuildMult)
elseif timeSecs >= nextRefresh then
if (AdpCheatMult <= 1000) and (AdpBuildMult <= 1000) then
AdpCheatMult = AdpCheatMult + (AdpCheatMult/2)
AdpBuildMult = AdpBuildMult + (AdpBuildMult/2)
end
SetupAICheatS(AIBrain,self,AdpCheatMult,AdpBuildMult)
nextRefresh = nextRefresh + refresh time
end
end
end
end
self:ForkThread(self.AIXWaitUnit)
end
end
This was one of the approaches that I found effective for resolving the inconsistent multiplier application for newly constructed buildings. However, with the passing of time, I no longer recall all the intricate details of this solution and how specifically it was implemented, which makes it challenging to apply the same exact logic to the current FAF system.FACN Lua.nx2 File:
To support your investigation, I will include a FACN lua.nx2 file for your reference. This might provide useful insights during the repair process. Unfortunately, I could not attach the entire file due to its size (over 1GB). In this version of the AI system, I had successfully addressed the issue of inaccurate multiplier application on new buildings. However, as mentioned earlier, some of the finer details of that implementation have since been lost, and I’ve found it difficult to map this solution onto the FAF environment.Additional FACN Code (for Health Scaling):
Regarding AI scalability, I had implemented a setting in FACN that allows the AI to have X times the normal health. This feature, when combined with the proper adaptive AI system configuration, can allow the AI’s health to increase progressively over time. Below is the relevant code that implements the health multiplier, which can be adapted further for dynamic health growth.Example from Unit.lua/SetupAICheat:
lua
if ScenarioInfo.Options.AIMultHP ~= "off" then
AISetMaxHealth = tonumber(ScenarioInfo.Options.AIMultHP)
unit:SetMaxHealth(unit:GetMaxHealth() * AISetMaxHealth)
if EntityCategoryContains(categories.COMMAND, unit) then
unit:SetHealth(unit, unit:GetMaxHealth())
end
unit.HealthM = tonumber(ScenarioInfo.Options.AIMultHP)
end
Supporting function in Unit.lua:lua
function setupHealthMultiplier(unit, Mult)
unit:SetMaxHealth(unit:GetMaxHealth() * 10)
unit:SetHealth(unit, unit:GetMaxHealth())
end
This code ensures that AI units can initially have a health multiplier (X times their normal health). To achieve the goal of having dynamic health growth over time, you can combine this multiplier setup with a proper adaptive AI configuration that adjusts the multiplier periodically. The health multiplier would then increase as game time progresses, allowing AI units to scale effectively in longer or more challenging scenarios.Regarding Other Mentioned Issues:
As for the other points I previously raised (such as the behavior of naval battles, air attacks, and misuse of ASFs), I haven’t encountered those issues again as of this response. Should any of those issues arise in future matches, I’ll make sure to record the replays for further analysis and share them with you for a better evaluation. I look forward to understanding how these can be improved further.Replay Settings:
M28: 1.0*1.0M28AIX Overwhelm rate: 0.1
M28AIX Overwhelm interval: 0.5
M28AIX Overwhelm limit: 10.0
Mods included:
M28AI v145
All Faction Quantum Gate V2.0 (created by jayTac)
Map:3v3 Durex v10 Hotfix
lua(FACN) (2).zip 3v3_durex_v10.v0005.zip lastgame.zip -
@kagurazakanana said in M28AI Devlog (v146):
3v3 Durex v10 Hotfix
Do you have a copy of the map you used? I can't find it on the FAF map vault
Edit: Although doing a sandbox test of AIx overwhelm to check if it was adjusting the build rate I realised the implementation was only adjusting resource generating units, so the build rate adjustment should be fixed in the next version. If you still run into issues after this then post a replay (and the map if it's not on the vault) with an example unit and timestamp illustrating the issue and I can look into further.
-
v147 Update
8 changes, mostly relating to minor bugfixes, including:- Fixed a bug with AIx overwhelm not increasing the build rate of units
- M28Land should consider building non-land experimentals occasionally late-game to give it a small bit of variety
- Fixed a couple of bugs that could result in air factories not building units in rare cases
Acknowledgements
- Fearghal – replay which contained a number of niche errors
- Kagurazakanana – Highlighting that M28’s Aix overwhelm modifier wasn’t adjusting build rates
- c04spoon - LOUD replay where M28 overextended
-
v148 Update
13 changes, including:- Naval AA units should be more likely to retreat from enemy units
- Fixed a bug where naval units would think they were always outranged by the enemy
- Subs should prioritise shield boats and then other subs
- Low ranged skirmisher units should be more aggressive when lacking intel if the ACU is nearby
- 4 MOD specific changes, including support for mods that require a build rate for factory units, building PD if it can be built on water in LOUD, and having M28 make use of the Blackops experimental aerial fortress
Acknowledgements
- c04spoon - Naval replay prompting a number of this update's changes
- Vortex - Replay where M28 failed to support his ACU with land units