AI-Uveso (v112) - AI mod for FAForever
-
Update 27.Jan.2021(v90)
- Fix: Function CheckValidMarkerPosition() optimized to prevent autogenerated markers on land/water cliffs
- Fix: Platoon microing function was sometimes using a wrong platoon center position.
- Fix: Platoon microing function could not handle modded units with only missiles or long range weapons.
-
Update 08.Feb.2021(v91)
- New: Added strategy for NukeSub defense.
- Fix: LUA Error at gameend when an AI was defeated (destroying now buildermanager before brainconditionmonitor)
- Fix: Renamed Function hook for Platoon-, Factory- and Engineerbuilder to prevent a crash with other AIs
- Fix: Removed forced debug key binding ['Ctrl-q']
- Fix: Initial basebuild failed in case the cheatfactor was higher than 1.7 (energy/mass builder)
- Fix: Removed the destination as waypoint from the pathfinding function. (engineers no longer block the build area)
- Fix: Added NutCracker AI to debug functions menu.
- Opt: Platoons with experimentals are now switching a bit earlier to the next waypoint to prevent bumping units.
- Opt: Cybran shields will now upgrade way earlier than before.
- Opt: Added ACU sniper platoon (13-15 fighterbomber -> directattack ACU)
- Opt: AI Ecomanager is now optimized for better game speed.
- Opt: AI can now also recover its base if the ACU is not available (fighting)
- Opt: Adaptive AI now also working with omniview off (on is still better)
-
Was really enjoying a match with v91 just then, unfortunately it crashed 53 mins in.
I've uploaded replay and stuff here: https://nextcloud.playsia.pro/s/wRLYecWoRG2CnDP
If there's another log or something that would help let me know.
Was playing on White Fire, AIx Adaptive (1.2x). Only other mod was Supreme Score Board.
-
Hello plasia,
i viewed the replay and continued the simulation without any errors.
Can't say what happened. -
Oh, thanks for looking, it just sim locked for us, we could still chat with eachother. My friend said something similar happened in a game he played by himself, so as it wasn't a one-off I said I'd report it.
-
Yes, please always post any error you have seen.
(Here in the forum or in our Discord channels)I run the game on every day in a endless loop to test unusual or rare errors.
Its the way how i code and test my AI.You can also do some stability test with my AI in case you have changed something or to be sure that all is working.
Create a skirmish game with 2 AIs and set yourself as observer (in FAF you can be an observer in skirmish games)
Then go to options and set Debug Endless game.
Now after starting the game it will run until the end and start the game session automatically again.
It will aso post the restart into the gamelog, so you can view how often the game was restarted and how long a single game lasted. -
I can't sear it was Ai-Uveso issue.
I have had game crashes before but not like this "crash".
Crash effect- all units on screen stop moving
- Mouse still active
- Mouse can hover over any unit and see the info box pop up
- Units can be selected and orders given, they dont move of course, or build, etc.
- map scrolling works, map zoom in out works
- F10 menu works (cant save of course) - Did not try exit to windows but end game did not work
- I checked the game log - see below
At 28 minutes the following showed up in log
This was the FINAL "debug: Gametime: 00:28:00" message.
I don't know but this message occured somewhat down into the log from gametime:
warning: [platoon.lua, line:2494] *UnitUpgradeAI ERROR: "bab1302":CanBuild( BROBT1PERI ) failed!I did not post all the remainder of the log.
There were log entries when I tried un/pause game and when I alt-tabbed out and back.debug: Current gametime: 00:28:00 info: M: [####################] E: [#################~~~] - BuilderPriority = 1000 - SelectedBuilder = U3p Air Scouts debug: Gametime: 00:28:00 --- Unit: 3167 --- Platoon: 685 --- FPS: 30 --- Memory: 999.9M / 1.117G --- Speed: +0 / -3 --- SimSpeed: 08% ( 60 Game = 712 System Seconds ) debug: Entity: 21028 --- Prop: 04042 --- CScriptObject: 70622 --- CTask: 39292 --- CTaskThread: 37306 --- CLuaTask: 03558 --- CDecalHandle: 17731 --- ReconBlip: 03352 info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 250 - SelectedBuilder = U2A Air Fighter info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 15400 - SelectedBuilder = U-T3 Gate 3 info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 1500 - SelectedBuilder = U3 AirFactory AA info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 1500 - SelectedBuilder = U3 AirFactory AA info: M: [########~~~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [####################] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U3p Air Scouts info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 SubCommander RAMBO info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 SubCommander SIMPLECOMBAT info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 350 - SelectedBuilder = U3A Air Fighter ratio info: M: [####################] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U3p Air Scouts info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 17830 - SelectedBuilder = U1 Mass 1000 8+ info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 17810 - SelectedBuilder = U1 Mass 1000 10+ info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [#######~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 875 - SelectedBuilder = U2 Ground Defense always info: M: [#######~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 875 - SelectedBuilder = U2 Ground Defense always info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 500 - SelectedBuilder = U2 Air Transport info: M: [####################] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U3 Air Scout info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 500 - SelectedBuilder = U2 Air Transport info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [####################] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U3p Air Scouts info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 350 - SelectedBuilder = U3A Mobile Artillery info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 19000 - SelectedBuilder = U1 PanicZone Mobile Arty Force info: M: [#####~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 16600 - SelectedBuilder = U1 Sea Factory 1st info: M: [############~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 17878 - SelectedBuilder = U2 Mass Adjacency Engineer info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 16600 - SelectedBuilder = U1 Sea Factory 1st+ info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 19000 - SelectedBuilder = U1 PanicZone Tank Force info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 500 - SelectedBuilder = U2 Air Transport info: M: [############~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 SubCommander CLOAK debug: * AI-Uveso: BuildSACUEnhancements: no enhancement found for (url0301) = "xxx" debug: * AI-Uveso: BuildSACUEnhancements: no enhancement found for (url0301) = "xxx" debug: * AI-Uveso: BuildSACUEnhancements: no enhancement found for (url0301) = "xxx" info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 SubCommander RAS info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 19250 - SelectedBuilder = UC CDR Attack Military info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [############~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 19250 - SelectedBuilder = UC CDR Attack Military info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [#####~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U3 Air Scout info: M: [#######~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 17880 - SelectedBuilder = U1 Air Factory Cap info: M: [#######~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 15000 - SelectedBuilder = U2 Shield Ratio info: M: [#######~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 15000 - SelectedBuilder = U2 Shield Ratio info: M: [#######~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 160 - SelectedBuilder = UTM1 HEAVY Gunship 1st info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U3 Air Scout info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 18500 - SelectedBuilder = U1 Engineer noPool land < 1 info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 18500 - SelectedBuilder = U1 Engineer noPool land < 1 info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 350 - SelectedBuilder = U3A TorpedoBomber info: M: [#####~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 18500 - SelectedBuilder = U1 Engineer noPool land < 1 info: M: [#####~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 18500 - SelectedBuilder = U1 Engineer noPool land < 1 info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 16200 - SelectedBuilder = U3 Mass Fab info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 19000 - SelectedBuilder = U1 PanicZone Mobile Arty Force info: M: [############~~~~~~~~] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U3 Air Scout info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [#########~~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 19250 - SelectedBuilder = UC CDR Attack Military info: M: [#############~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Gunship EXPResponse info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 19250 - SelectedBuilder = UC CDR Attack Military info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 SubCommander ANTIAIR info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 17878 - SelectedBuilder = U2 Mass Adjacency Engineer info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 350 - SelectedBuilder = U3A Mobile AA MIN debug: * AI-Uveso: BuildSACUEnhancements: no enhancement found for (url0301) = "xxx" debug: * AI-Uveso: BuildSACUEnhancements: no enhancement found for (url0301) = "xxx" debug: * AI-Uveso: BuildSACUEnhancements: no enhancement found for (url0301) = "xxx" info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [##########~~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 SubCommander STEALTH info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [####################] E: [####################] - BuilderPriority = 17500 - SelectedBuilder = U1 Sonar info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [######~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 17850 - SelectedBuilder = U1 Mass 1000 6+ info: M: [######~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 16600 - SelectedBuilder = U1 Sea Factory 1st+ info: M: [####################] E: [####################] - BuilderPriority = 1000 - SelectedBuilder = U1R Land Scout info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 500 - SelectedBuilder = U2 Air Transport info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 17810 - SelectedBuilder = U1 Mass 1000 10+ info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 16200 - SelectedBuilder = U3 Mass Fab info: M: [###~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 17830 - SelectedBuilder = U1 Mass 1000 8+ info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Air info: M: [##~~~~~~~~~~~~~~~~~~] E: [####################] - BuilderPriority = 345 - SelectedBuilder = U3E Air Fighter EXPResponse info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 15400 - SelectedBuilder = U-T3 Gate 3 info: M: [###########~~~~~~~~~] E: [####################] - BuilderPriority = 18400 - SelectedBuilder = U3 Engineer noPool Land info: M: [###################~] E: [####################] - BuilderPriority = 16600 - SelectedBuilder = U1 Sea Factory 1st+ warning: [platoon.lua, line:2494] *UnitUpgradeAI ERROR: "bab1302":CanBuild( BROBT1PERI ) failed!
-
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.
-
@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)
-
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.
-
-
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 !
-
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.
-
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
-
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.
-
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.
-
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 ?
-
@Uveso
Hi Uveso,Yes, fixing whatever unit would be great if the error message mentioned what unit caused the error.
-
@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.1I 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).
-
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.
-
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.