Thursday, April 12, 2012

[REL-FA]Duncane AI Patch (plus extra AIs) updated 22Nov09

[:1]Duncane's FA AI Patch



(Plus Air/Land/Naval AIs, NoTech/Swarm AI, Fortress AI and Null AI)



Version: 2.6.2

Latest release: 22Nov2009



Compatibility:

FA only, patch 3598 and above (including 3599 and 3603). I believe it will also be compatible with Sorians AI mods for FA due to the way that he has hooked the main files, but if you want a clean test then please run them independently of each other.



This mod can also be installed without impacting online play providing no AIs are present in the game. If there are going to be AI's all players must have this mod installed and have the same version.


Requires:
Sorians either AI support mod which is included in the download or Sorians Lobby Enhancement mod. If you have Sorians AI pack and Lobby enhancement please don't copy the AI support mod to the game data folder.




Description:


You may remember me as the person that did the DuelAI mod for Supcom (that sounds a bit Troy McClure?!). Well I had indicated that I wasn't going to do a AI for FA as I felt the included FA AI's were fairly good as practice, but after discovering a few things with the stock AIs that quite annoyed me I decided to take a look at the code.



I really appreciate the standalone AI Sorian has released already and look forward to the massive improvements he will make in the future. At the same time I felt the standard AIs are fairly well done and have a large number of tactics already built in - they just need a bit of love in places ;-)



So this release is really just about fixing the few minor (and major) problems that annoy me about the stock FA AI's. Hopefully you will find the changes mean that you can use them in your games.



Also the stock Rush AI in FA includes a number of sub AI's. These are an Air rush, Land rush and a Naval rush AIs. This mod breaks these sub AI's out into their own selectable AI's and AIx variants. These focus on major air, land and navy forces respectively.



As I always, I'm really keen for any feedback you might have. When describing a problem please indicate the type of AI (Rush, Tech etc), if the cheat was on and the map it was on. Also let me know of any other issues you have seen with the stock AI's.



To install download the file, unzip and place the *.scd files in your FA gamedata folder: "C:\Program Files\THQ\Gas Powered Games\Supreme Commander - Forged Alliance\gamedata"



(01_aisupport.scd not required if you have Sorians AI or Lobby Enhancement mod installed).


Download:


http://members.iinet.net.au/~dionysus/misc/AIFix.zip



[NOTE: For other AI modders every line of code changed from the FA base has a #DUNCAN comment on]



Fixes:



- Cheat option for AIx is now 1.4 times not 2 times speed. I find this is the optimal level to play against and be like a high level player without being too hard or unfair.

- Should now be compatible with Sorians Cheat Options Mod.

- Build order improved to match community standard so a land factory is built first (unless full naval map).

- Will now go for more hydrocarbon spots and earlier in the game.

- Will not use larger map "Balanced" rush AI on 5km maps.

- Will not use "Naval" rush on 10km or less maps that are not island based.

- "Land" Rush will now at least build some T1 air units

- Doesn't over build T2 power and neglect other T2

- T2/T3 engineers don't head out to build distant mass ex's or build mass storage... that's a job for a t1 engineer!

- Added T2 PD and TMD for ACU defense at main base

- Land experimentals should now correctly select targets and not stay static

- Units guarding base don't go too far to attack units. This hopefully helps on maps with civs.

- Cybran AI will now produce Hoplites

- Fix typo for some PD items in expansion bases.

- Added TML, shields to T2 expansion bases.

- Scouts should use their cloak/stealth.

- AI was working on several major T4 projects at the same time. Should now only work on one at a time.

It should now only build one exp/gate/arty at a time.

- Shouldn't build T3 fabs until at least 3 T3 power gens due to new balance for fabs.

- Should now build/upgrade only one omni. Only really need one plus some T2 radar.

- Should only upgrade one radar at a time.

- Engineers heading to protected enemy mass points without a guard force. Will now send some guards.

- Mobile shields/stealth too common at T2, reduced to lesser percentage.

- Engineers should now be reclaiming more often.

- The AI Builds too many transports. Reduced to reasonable levels.

- Wont build too many air platforms when going for land units

- Should now produce the megalith.

- Changed GuardBase to not return to centre of base to prevent bunching of units

- Should build shields after other defenses

- Will now select Naval rush more often on large island based maps

- Improved CZAR behavior. Its beam wont fire all the time.

- AI will now build attack boats for Aeon

- Naval bases will not over build naval factories

- Commander will now run away sooner.

- Commander attack range extended. The ACU will now be play a bit more offensively.

- Commander wont leave so many items unfinished when defending base from attacks.

- AI should now produce percivals.

- AI will now self destruct mobile t1 units when it reaches the unit cap. This should improve long game sim speed performance.

- AI will now only kill a few T1 units when it reaches unit count

- AI will reclaim T1 once enough T3 power. Reduces base clutter and helps with unit cap.

- AI will now use custom AI plan on Setons Clutch to improve sim performance (select Rush or Adaptive)

- Added improve Tech AI plan for small maps

- TMLs should now launch correctly and have improved targeting of structures.

- Limited the number of expansion bases the AI can build. This increases long game performance significantly.

This is now based on the number of AI's and players on the map.

- Tweaked land expansion base sizes and engineers from Naval expansions. This also helps performance.

- Improvements to land platoon AI selection on island based maps to prevent bunching.

- Will not over build land units on island maps

- Naval platoons will now form and attack much sooner

- Naval units will now path correctly.

- Interceptors now return home after attacking.

- Interceptors will not attack partially completed planes.

- Added BuildManager Thread clean up to address sim speed issues (thanks to Sorian!)

- AI will now use transports more effectively on island maps.

- Fixed groups of stuck engineers.

- Expansions will now be built further away and closer to the enemy's base.

- Tweak adaptive AI tactic selection on 10km maps (now chooses between Balanced, Land Rush, Tech Rush)

- Added builder for Amphibious tanks for Naval AI

- Added tweak to the HuntAI that should hopefully stop it shooting into the side of hills.

- Wont build a Quantum gate too early.

- Reduced the max number of nuke lanchers.

- AI should build rader sooner.

- Commander should now assist experimental builds.

- Increase Novax priority for UEF and fix targeting.

- Allied AIs should no longer steal engineers (Thanks to Sorian for his EngineerManager fix)

- Commander will now use some upgrades such as gun and T2 engineering, shield, stealth, cloaking and regen field.

- AI will now cleanup platoon threads to improve simspeed

- Engineers will not travel in odd paths to reach close locations.

- Nuke subs will now use nukes.

- Added Air/Naval/Land AI types based on Rush AI sub types.

- Improved response to enemy experimentals

- Fixed firebase location finder

- AIBrain threads now destoryed when AI is killed. Improves simspeed.

- Turtle AI no longer stalls.

- T3 fixed arty now aims correctly and built more often

- Bombers will now attack land experimentals

- Fix factory manager to not start threads for duplicate factories

- Increased ASF priority

- Fatboys should no longer get stuck in the water

- AI now builds paragon.

- SMD now built sooner.

- Experimentals will now be supported by other units

- T3 bombers will now have fighter escorts

- The AI will now place shields, SAMS and power plants in better locations

- Support for custom units (as per Sorians thread).

- AI should rebuild better after losing its base

- Fix engineer capture bug

- Fix for AI sending empty transports.

- AI will now use Ghetto Gunships

- Includes NoTech AI that doesn't tech up at all.

- Includes Swarm AI that doesn't tech up til it reaches the unit limit.

- Includes a Null AI that does nothing.

- Increased engineering stations.

- Engineers will repair unfinished and damaged structures

- Torpedo bombers now used by all AI types.

- AI will now use transports and experimentals on maps with no markers.

- Experimentals will group to attack at late stage of a game.

- Includes Fortress AI that focuses on defense only.





*|||**************Reserved************************



No reason... just everyone else does it and it looks cool ;-)



[EDIT]



I thought a a use for the second post!



Check out my other AI mods...:



Swarm AI

An AI that focuses on LOTS of T1 units and wont tech up till it reaches near the unit cap. Also the thread includes a NoTechAI that never techs past tech 1.



Null AI

An AI that does nothing. Doesnt sound useful but people use it to play themselves.



AI Ally Control

Allows a player to take control of an allied AI player to give orders or to take units. Also allows a player to give units to an AI ally.





A full list of my mods for SC and FA is here:

http://forums.gaspowered.com/viewtopic. ... 949#258415|||First.



(this way I can look cool too if this AI gets really popular ;))|||Ha...



Also gives me a chance to make a point... this isnt a new a AI.. it just updates the stock standard FA AI's.|||I wonder if it is just me, but any kind of engineer can get stuck.

It happens to

any Ai archetype

custom AI or not

cheating or not

on retail map blasted rock and probably others



You dont seem to mention it on your bug list.



it happens usually to mex engineers :

-when a few of them moving to build the same mex .

-sometimes for no obvious reason .



My bet is that they have trouble with the pathfinder thing included in ProcessBuild, and/or something with the thread ping pong between ProcessBuild and WatchForNotBuilding.

I have been fiddling with this but with no complete success it just seemed to mildly reduce bug happening for commander but it still happened eventually, I thought Sorian or you having better knowledge of the old building procedure and lua language may have a better insight than i do.



it happens also to commander

when commander has to shoot at ennemy unit while having a buildqueue, but sometimes these 2 conditions are not enough to cause the bug,



When the building in the queue to build next is completed before they can get in range looks similar to what engineer do with mex.



it can not come exclusively from commander custom behaviour since it happens to platoons where these custom behaviours are not loaded same as in platoon where the custom behaviours are loaded.|||Yeah I've noticed that too... basically 3 or 4 engineers head to a mass spot, one engi gets there first and builds the mass ex and then when the others get there they just stop and do nothing for ages.



I will add it to the list.|||Version 0.2 release....



Just a few minor changes.



I think I have the stuck engineers thing fixed ... if an engi failed to build (cause another one had finished it or got their first) it wasnt removing that item from its build queue.



Also I move some items to resolved (Im sure they are working now), but put the AttackForceAI use back to testing as although it makes attack formations better I think it has a tendency to bunch units up at the AI's base. Also I move the TML bug back to unconfirmed as I havent been able to reproduce it.|||thats most intresting news duncane and will save we a lot of trouble i am not too comfortable with the language at the time and fixing these function cluster was above my skill.



as for the Attack function glitch i havent noticed it myself i dont use the behaviour in my platoons and recognising a platoon during runtime is nearly impossible with the completed AIs since they have so many difrent platoons they can form.



But it reminds me of the way the base manager handles idled unit in case of emergency defense. It takes control of the bots around and use them to defend himself after denfense has been succesfull it never releases the bots and keeps them in base cluttering the whole place. It seems that if platoons are formed it can pick bots amongst these. but A single glitch in just any behaviour function result in bots stalled that will stay forever in the heart of the base. Things adding up the base becomes so squeezed with bots that it probably cause sane behaviour function to stall too because of stalled pathfinder.



when i have time i ll try to narrow down the function(s)/causes responsible for this base clutter. But if you look forward to fix or replace Attack Ai you might find it has something to do with this aspect of the AI i just described and maybee these two things share a common fix.|||Ahh.. the "dueller" has returned in another form... :lol:



I agree with your assesment of the stock AI for FA- it shows a lot of potential and is just hampered by the bugs described all over the forums.



Best thing is - we now start getting that AI diversity again. These "fixed" FA aI's and Sorians Ai set.



Fun times ahead 8)



Keep up the good work|||Will this AI work with Sorian "installed" ?|||FSNSUPCOM|||Thanks duncane for working on the AI :)



This game needs it pretty bad IMO. Especially when the AI just builds a bunch of guys and parks them in a random location then performance of the game just seems to drag.|||It should work with Sorians pack installed with a couple of issues...



Firstly Sorian has modified some functions in the base AI and these will alter the behaviour of the stock AI's, but that's probably fine as these are generally Sorian fixing a bug.



Secondly I have alter the base platoons. This is good in one way as I think I fixed a bug that meant the AI wasnt producing hoplites, but bad in another as I have changed the HuntAI use to AttackForceAI in places and this will effect Sorians AI platoons as well. I currently reviewing that change and may alter it so its not so global.|||Ajunta|||Version 0.3 release.



Only a minor update. I have moved the change for the attackforce platoons out of the main land platoons file so it doenst interfere with Sorians AI. This should mean you can use his AI pack installed along side these stock AI fixes.



I still havent managed to get the AI to stop bunching up groups of units in its base, but I think the AI used to do this before any of my changes so it must be some core issue. Still looking.|||Quote:|||Thanks



Im actually quite happy with the 0.3 release.



I also made a minor change in it that I think DID help with the bunching of units at the AI base. In AttackForceAI when it ends it calls ReturnToBaseAI, but you can disable this with a build in option in the platoon data (NeverMerge=true). It seems to help although I still need to test it more.|||- Too many T1 expansion bases?



Play 1v1 against ai on setons, leave his base un-attacked until he decides to nuke you (about 40 minutes in), then go murderize him. You'll find lots of little bases with t1 factories, also largely undefended.|||Thanks... I have move that to a confirmed bug.



Setons is a good example of where it builds too many expansion bases as its a land bridge map.



Basically I need to somehow reduce the number of exp bases it builds.



Anyway ... its on the list.|||0.5 released.



I have made further changes to the attack platoons and also changed the Guardbase function so units dont bunch up in the AI base.



The AI engineers should now reclaim much more often which gives them a mass boost.



I have made some other minor tweaks to defenses and also put a fix in so the AI produces a Megalith (haven't tested this yet as I don't usually see games run that long).



The big bugs currently are that sometimes bunch of engineers get stuck doing nothing and also the number of T1 expansion bases seems a bit excessive.|||how does this ai coincide with sorian's? I know you said they should be compatible, but just wondering... When i pit the normal ai (this mod installed, so assuming it means your ai) against sorian's, they do almost exactly the same thing. 13 minutes into the game, and the score is tied at 13.5k. kinda freaky.



....





oh, i also just played open palms ai vs ai, your 0.5 vs sorian's 0.8.2. game started out both sides doing almost the same thing. after a while sorian gained map superiority, but didn't take advantage. sorian didn't build any shields. duncan built t4 bots and won easily against sorian's mostly t1 army. i didn't see very much pd on either side, only saw one t2 pd on duncan's base.|||Hello Duncane,



I have noticed that in games, when playing using your AI, that some of the enemy units end up being shown as grey boxes. Now I am not saying it has anything to do with your AI, because I remember this happening in supcom also.



I wish to know if you know if this was fixed in FA, because it doesn't look like it was, since I am getting this problem still. I have a screen shot if you want to see what I mean. The grey boes are exactly like they would appear on radar, before you find out what they are, using a spy plane.|||Dragon Fly, That doesn't sound like anything to do with the AI. I have never seen anything like that in game? I would check your graphics card drivers are up to date.



Lord Kailen, The new FA AI bases all the AIs off of common builders and platoons of units - each of the AI just gives preference to certain situations. Sorian has also based his AI off of these common stuctures as well. This means in theory its possible for two different AI's to make nearly similar choices. Also many of the bugs we have fixed are common to both and we have both tweaked the early build order to better match what a real player would do.



In regards to the open palms game .... I have particularly tweaked the AI's to produce shields and some defense at base (TMD, T2 AA). If it only built 1 T2 PD then it probably had other better choices at the time. Also T1 PD is much better in FA... it should of at least built some of these at out lying points or bases.|||yes, it did build t1 pd at various places. i suppose i didn't mention it because i've gotten used to skipping t1 pd (i normally play uef, and uef t2 pd is very useful).



i suppose my comment about the shield and pd and experimental units your ai built were a comment showing a current lack in sorian's. his tactic failed. as your ai lost ground to his superior numbers of t1/t2, you hunkered down inyour base behind shields and built experimentals. he never built t2 shields, no t2 pd, nothing fancy, just lots of power gens and little units, some t2. got owned by the first ythotha.|||hi duncane



i installed your 0.5 fixes



what i noticed that is very unfortunate eearly game..



the rush and adaptative Ai try repeateadly to build expansion base and expansion base defense right in the middle of other Ais, player base very early T1.



While one may say it is not such a bad idea to spread out as early as possible since it enables to rebuild mex very efficiently around the new expansion bases.



It does not seam such a good idea to build right under the nose of an ennemy commander there is no way a commander is going to be built a point defense and a factory in the middle of its base doing nothing. that might work in the backdoor of an ennemy base or at its doorstep though.



the second idea is that in the case of a small map and against rushing Ai or opponents a base built early t1 is very vulnerable if not garded by a lot of units or a commander and it is a very risky bet to invest so much mass in something that might not live long enough to build more than 5 bots all of which will be ran over all alike anyway while ennemy platoon will come in for routine patrol.



Even at early T1 i think it would be more advisable for an Ai even a rushing one to concentrate fire power and industrial power at a more restricted number of locations a big bot output and bots waiting to be assigned to a platoon is always a goodenough defense when there is no commander to straighten things out with ennemy platoons.

No comments:

Post a Comment