AI-Uveso (v98) - AI mod for FAForever

0

Hello Gladry,

thanks for posting the log.

warning: [platoon.lua, line:2494] *UnitUpgradeAI ERROR: "bab1302":CanBuild( BROBT1PERI ) failed!

This means the AI tried to Upgrade the Black Ops Hydrocarbon Power Plant to a HydroCarbon Perimeter Monitoring System from Total Mayhem.

Interesting ๐Ÿ™‚

I will include a gamepatch to the next AI-Uveso version in case the original game update function can't handle this.

0

@Uveso
After looking more carfully at the posting options, I now see how I can upload the log file ๐Ÿ˜‰

  • I would like to compress it, but up loader here wont let me.
  • It wants a smaller file than 2Megs, but wont accept compressed.
  • Perhaps if I rename a 7-zip file as another acceptable type?
    RecentGame-51m.7z.log

Here is a game that lasted until minute 51:00

(human observer, all AIX Ai-Uveso, 16 armies)
After looking at the various warnings and Uveso named "errors" (Uveso noted error not Game FAF.exe error)

This line early on in the log

warning: Error running /lua/sim/tasks/EnhanceTask.lua script in CScriptObject at 5d737ef0: ...\gamedata\units.nx2\units\url0001\url0001_script.lua(264): attempt to call method `ChangeMaxRadius' (a nil value)
         stack traceback:
         	...\gamedata\units.nx2\units\url0001\url0001_script.lua(264): in function `CreateEnhancement'
         	...gramdata\faforever\gamedata\lua.nx2\lua\sim\unit.lua(3914): in function `OnWorkEnd'
         	...rever\gamedata\lua.nx2\lua\sim\tasks\enhancetask.lua(80): in function <...rever\gamedata\lua.nx2\lua\sim\tasks\enhancetask.lua:54>

All other warnings or errors seem non EXE related.

 MOD LIST SET TO:
         AA ACU      (fb5b9e30-ab81-40b7-86ce-45c5295e4e30)
         AutoReclaim (dwm) (080b115f-7682-4868-bad7-2a2273386a8d)
         Smart Tactical Missiles       (6BEA1FF0-5D8B-3656-0210-C359C5A5E849)
         Total Mayhem    (62e2j64a-TOMA-3652-01370-146as555a8u3)
         Paragon Sharing       (AF6212F2-66A6-11E9-B57E-A38D0099106D)
         BlackOps FAF: EXUnits     (9e8ee941-c406-4751-b367-e10000019000)
         Paragon Lite    (570bfbf0-6bfa-11e9-b475-0800200c9a66)
         Antares Unit Pack FAF v2.5  (6aa65d2a-5926-3652-0240-1000200c9a09)
         BlackOps FAF: Unleashed       (9e8ea941-c306-aaaf-b367-u00000019000)
         Anti Nuke price v3.1    (a3ec424c-d3d6-4775-9303-9372817f2808)
         AI-Uveso        (62e2j64a-AIUV-0910-89465-146as555a8u3)
         Jaggeds Infrastructure Pack V3.0        (fff6f6c8-248a-11de-8c30-0811211c9x8x)
         Slaugh7ers T2 and T3 Walls  (12345678-9123-4567-8912-slaugh7er00v1)
         Ninja Reclaim Drones    (FEC17324-7392-3652-0180-119A739294E0)
         Experimental Squareshields  (b59081a9-613b-46f1-becd-3b6520615670)
         DefencesExpand v1.0   (6e0851ba-8dde-416a-9d76-20c3bb090z08)
         Nuclear Repulsor Shields        (44844B72-6054-3656-0210-D5FA6066FB5E)
         NoShake       (06E0D4F2-2231-11E3-A9FB-92EE6088709B)
         Missile Tracking        (0fb13852-d03f-48bd-b93c-e29c4d47df02)
         All factions FAF BlackOps Nomads        (EFD32F08-945D-0040-8F33-AFB2E4372DD0)

0

According to my friend, has had it happen multiple times.

When he tries to capture an enemy unit, it blows up.

Other observations/thoughts:

  • I have played many games and haven't had the fighterbomber squad mentioned in v91 attempt to assassinate my commander.

  • Adaptive is always obsessed with air, builds big fleets of gunships but is often slow to attack with them. It seems to always choose the gunship strategy, even when it should be building navy it does a weak job of it, ie: beach/rock on setons.

  • AI likes to build multiple tactical missile launchers (building), far out of range of any enemy base. This is a waste of resources.

  • imho AI builds too many factories, half the time they aren't even being used, I assume because of resource limitations. This could be spent building firebases or getting an earlier experimental.

  • AI always chooses to build nukes, maybe it could sometimes build T3 Arty instead for late game to mix it up.

1

@plasia:

You can't capture a unit from my AI.
It has a selfdestruct function to prevent capturing.

The fighter sniper platoon is not finished and only realised over buildconditions.
(It will need a better and specialized function to do the job better.)

The gunship strategy is always running. its basically a experimental defense formation.
But if no experiemental is in military range its searching for other targets
(I will rework the targetpriorities here)

Tactical missile launchers are defense buildings for an AI.
It will attack land experimental units with it. Also T3 mobile arties that are close to the base.

The amount of factories is wanted. The AI will use mostly 60% of all factories.
But if an enemy is close to the base it will use all factories to spam T1 units.
(panic builders)

Nuke silos are always builded (so the player can see the threat) but are not always loading missiles.
(they are idle/paused most of the time)

Thanks for the great feedback !

0

I found, what I believe to be the code in your platoon.lua for when/whether to update a commander.
However it only seems to check proximity of enemy units and self-distance from base (safety)
I would add an additional check, if any shield has been built at base to put the unit under the shield (I was trying to figure if you had a function for that) before attempting update.

I have seen some situations where many units are approaching, launching missiles or firing at a no-self shield or self repair commander during self update.

Also are there any functions where you can check terrain vs weapon firing track? Example: tank firing into a hill when trying to hit a unit theoretically in range. Or a defense turret trying to hit an approaching unit, but firing is direct and unit is down a slope and can only be hit by missiles/rockets or trajectory weapons.

0

@Gladry

I think I might have a fix for the FAF code in NIX2 compressed code archive.

The error was

...ver\gamedata\lua.nx2\lua\sim\Unit.lua(3067): attempt to call method `bp.BuildCostEnergy' (a nil value)

The original code and my fix.

ORIGINAL:
-----------------------
local scale = math.min(4, math.max(1, (bp.BuildCostEnergy / bp.BuildTime or 1) / 50))

FIX: 
-----------------------
local scale = 4
     if bp.BuildCostEnergy and bp.BuildTime then
           scale = math.min(4, math.max(1, (bp.BuildCostEnergy / bp.BuildTime or 1) / 50))
     end

0

I will rebuild the whole commander function, the last tournament showed how weak it is.
(I am a turtle player and never see the AI ACU fighting)

Yes there is a function to check blocking terrain for weapon fire:

CheckBlockingTerrain()

https://github.com/Uveso/AI-Uveso/blob/master/hook/lua/platoon.lua#L3283
(It's not implemented to the commander function yet)


attempt to call method `bp.BuildCostEnergy' (a nil value)

This means, there is no entry inside the blueprint of this unit to calculate the CreateEnhancementEffects

Just changing the code inside unit.lua is not a good solution.
The function itself is ok, but the blueprint is missing the BuildCostEnergy for an enhancement.

So the blueprint must be fixed, not the function that reads the blueprint value.

0

Thanks for the reply

@Uveso said in AI-Uveso (v91) - AI mod for FAForever:

Tactical missile launchers are defense buildings for an AI.
It will attack land experimental units with it. Also T3 mobile arties that are close to the base.

I am very much doubting how effective this is, it is easy to dodge (I used to do it all the time, I've been liking non-experimental tactics lately). For the very considerable amount of resources it consumes that could be spent elsewhere. Long range defence would be better as T2 static arty.

A trick I used to use to make sorian AI harder back in the day (it loved TML too) was to prevent the building of it. Made the AI noticeably stronger!

Nuke silos are always builded (so the player can see the threat) but are not always loading missiles.
(they are idle/paused most of the time)

This is cool! ๐Ÿ™‚

But the other point was that the AI could occasionally (especially if adaptive or experimental) mix it up and build a T3 arty instead.

0

Well you should have in mind my AI is meant to be played with several mods.
There are slow and hevy experimentals with more than 400,000 healthpoints.
They can't dodge and can be easily killed with tactical missiles.
Also T3 static artillery is mostly useless when you have experimental shields.

But i will increase the buildratio for artillery. They should be as much artillery than nuke silos at least.

Btw, why don't i see you on our AI-Development discord ? ๐Ÿ™‚

0

@Uveso
Hi Uveso,

Yes, fixing whatever unit would be great if the error message mentioned what unit caused the error. ๐Ÿ˜‰

0

@Uveso
Im not sure what version of LUA is being run by FAF, but there is a web page with reference for various versions of LUA.
5.4 version https://www.lua.org/manual/5.4/manual.html#3.4.1

I wonder if someone setup a code to check the wall-clock time, and after xx minutes to force a LUA garbage cleanup, if some of the memory problems would go away.
Although from the format of the parameters, it seems like it might only be callable from C language.

There appears to be a LUA function for also calling "C style" functions, perhaps combine them if it truly is C function.

int lua_gc (lua_State *L, int what, ...);

Controls the garbage collector.

This function performs several tasks, according to the value of the parameter what. For options that need extra arguments, they are listed after the option.

  • LUA_GCCOLLECT: Performs a full garbage-collection cycle.
  • LUA_GCSTOP: Stops the garbage collector.
  • LUA_GCRESTART: Restarts the garbage collector.
  • LUA_GCCOUNT: Returns the current amount of memory (in Kbytes) in use by Lua.
  • LUA_GCCOUNTB: Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024.
  • LUA_GCSTEP (int stepsize): Performs an incremental step of garbage collection, corresponding to the allocation of stepsize Kbytes.
  • LUA_GCISRUNNING: Returns a boolean that tells whether the collector is running (i.e., not stopped).
  • LUA_GCINC (int pause, int stepmul, stepsize): Changes the collector to incremental mode with the given parameters (see ยง2.5.1). Returns the previous mode (LUA_GCGEN or LUA_GCINC).
  • LUA_GCGEN (int minormul, int majormul): Changes the collector to generational mode with the given parameters (see ยง2.5.2). Returns the previous mode (LUA_GCGEN or LUA_GCINC).
0

The version of LUA used by SCFA is a modified 5.0 - which has no I/O functions and no access to the GC controls.

0

About ACU again - any code that can detect whether other AI players also have AIX Omni settings? When AI is playing against other AIX with Omni, don't upgrade ACU with Stealth.

0

@Uveso said in AI-Uveso (v91) - AI mod for FAForever:

Well you should have in mind my AI is meant to be played with several mods.
There are slow and hevy experimentals with more than 400,000 healthpoints.
They can't dodge and can be easily killed with tactical missiles.
Also T3 static artillery is mostly useless when you have experimental shields.

Good to know the reasons, I play mostly vanilla supcom compared to that stuff, I am loving SCTABalance and occasionally we play with blackops, mostly for the upgradeable hydro ๐Ÿ™‚

Btw, why don't i see you on our AI-Development discord ? ๐Ÿ™‚

... I have no excuse!

0

@Gladry said in AI-Uveso (v91) - AI mod for FAForever:

@Uveso
Hi Uveso,

Yes, fixing whatever unit would be great if the error message mentioned what unit caused the error. ๐Ÿ˜‰

Next AI version has a new error message like:

WARNING: Unit [uel0001] has no BuildCostEnergy in enhancement [HeavyAntiMatterCannon] - "Unknown name" - "<LOC uel0001_desc>Armored Command Unit"

So you can see what unit is causing the error.

if you whant to test it on your own use this:

if not bp.BuildCostEnergy then
            WARN('Unit ['..self.UnitId..'] has no BuildCostEnergy in enhancement ['..enhancement..'] - '..repr( self:GetBlueprint().General.UnitName or "Unknown name" )..' - '..repr( LOC(self:GetBlueprint().Description or "Unknown description" ))..' ')
        end
0

@Uveso

Hi Uveso,

Question - better here or in main mods thread? You decide.

I found a mod I liked but with a few bugs.
Your AI automatically uses this mod, if installed.

It is "AutoReclaim-dwm" - A series of auto-reclaiming auto-assisting engineering turrets.

I've made most of the fixes, one problem remains.
WIth every faction, except Cybran, if the unit is upgrading to a higher level (1->2 or 2->3) - choosing [stop] causes the unit to (apparently) self destruct. Cybran begins update, continues update, stops update on demand and reverts back to original before upgrade was attempted.

Self-destruct because before upgrading, or during upgrading - choosing ctrl-period shows that unit and all other engineers.
However after "self destruct" - ctrl-. shows only other engineers.

I have studied the LUA code and .BP definition for the DWM version of Cybran tower. I have used programmer text edtor DIFF tool to compare that to the other faction's towers.
I have edited the other towers to make them as close as possibly the same as Cybran.
Of course Cybran LUA class is CConstructionStructureUnit and UEF is TConstructionUnit and so on. Those difference are expected and left alone.

These do NOT appear to be merge units, so I am unsure if existing class member methods for original units are still called by FAF. By which I mean "original game had cybran engineering unit, so any over-write unit with same unit blueprint name does or does not get benefit of code associated with that unit name.

0

Update 30.Mar.2021(v92)

  • New: Added option for AIx Overwhelm for variable start time and cheat increase (thanks to bergzand)
  • Fix: AI brain will now be deleted after a defeat in a forked thread to prevent errors
  • Fix: PlatoonFormManager is now able to delay equal formplatoons same like buildplatoons
  • Debug: temporary added gamefix for experimental transporters
  • Debug: added log output for missing buildcost on enhancements
  • Debug: temporary removed function TransferUnfinishedUnitsAfterDeath for testing
0

@Gladry:
i have installed the mod and can confirm the destruction.
i will do a check later, maybe i find something.

0

Was playing on some maps, with initial launch area space restrictions, and your AI was creating Crazy numbers of T1 anti-air mobile units. These units were blocking all of your spaces between buildings and paths out of your initial launch area.

Also even after 20 minutes it was still keeping dozens perhaps 50+ T1 anti-air mobile units. Still blocking engineer and other unit movements in your base.

For base defense, does your AI evaluate static A defenses vs static B defenses (Ie different mods) vs mobile units?
Example:
build time + energy/mass cost and DPS + range of xx mobile tanks vs
BT +E/M and DPS + range of yy turrets?

Direct fire vs ballistic units (that can fire over blocking terrain)?

1

Hey @Uveso

It seems I am having trouble using with Nomads. Is this a known incompatibility? Upon ACU drop-in (when playing as Nomads), the mass and energy seem to go nuts. Along with this, the commander starts out with the t3 build suite and it does not produce a crash or any error. This only occurs when Uveso is active, even if there are no AI's in the match. This does not happen when playing as any other faction. It is the only mod active. Nomads works fine when no mods are active. Tried this on multiplayer with a friend and there is an immediate desync. He also has this issue in solo games as well. Any help would be appreciated since I love both the uveso AI and nomads for high cheat level challenges.

Thanks! If you need logs, let me know.