AI-Uveso (v87). AI mod for FAForever

Moderator: Uveso

Re: AI-Uveso (v41). New AI mod for FAForever

Postby Uveso » 08 Aug 2018, 17:13

Franck83 wrote:higher priority triggered all the time if conditions are ok ?


That is exactly how it works :)
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: AI-Uveso (v41). New AI mod for FAForever

Postby Franck83 » 10 Aug 2018, 10:43

Hi again Uveso,

Sorry, i have a lot of questions :). But i want to be sure to understand well.

Permanent thread : You said that ACU got it's permanent thread running. But how do you manage different orders sequences at the same time ? If ACU goes more than 50 distance far away from its base, it triggers go back home and clear all others current mission orders. Imagine i want to send my ACU in an offensive mission. If he goes over 50 distance from its base, the sequence orders will be canceled. I think that we should launch this go back to base sequence only after a mission executed. So i'm not sure that a permanent thread is a good option in this situation since it breaks the priority system, isn't it ? We would add this go back to base from other conditions (if AA support is dead, ACU patrol is killed for example or ACU health is under amount percent).

Triggers : so another question is : if i have several triggers (builders) at the same time, do they keep the hand on the current builder mission sequence until the end or a higher priority triggers, don't they ?

ACU eco role : then i would be better if the eco role of ACU stops after the 5-6 min of the game. SInce engineers takes this part of the work (or maybe reactivating ACU eco role if base destroyed). ACU would fit better in harrassing or defending until the tech 3 stage. This is should be more exciting. Last time i played coop, i saw AI ACU quietly reclaiming trees and at the same time its base was being attacked. That was a little annoying.

Specific AI behavior : how can i initiate a specific AI for a unit, so this unit is excluded from the patrol recruting ? Can i add this AI on the unit lua file ?
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: AI-Uveso (v41). New AI mod for FAForever

Postby Uveso » 10 Aug 2018, 16:36

Permanent thread:
Yes this is a ugly solution for controlling the ACU.

If you programm a attack function, then this attack function must break if the ACU is at low health or far away from the base.
If you don't break the attack function then we never reach the "go home" etc functions from the commander behavior thread.
Or your attack function can handle low health etc. then you only need one combined ACU move/attack function that can attack and run home on low health.

Triggers:
If the ACU gets a buildorder it will execute the build until end.
While building, the ACU is not inside the ArmyPool platoon and can't get another buildorder.

In case you break the building with your custom functions inside the commander behavior thread, then you can resume the building with forking the platoon.WatchForNotBuilding function.
(Thats the task from the 2nd part of the behavior thread called "--Call platoon resume building deal")

ACU eco role:
If the ACU is not available for eco building then automatically engineers will do the job. They have just a lower priority then the ACU for the same buildings.
So you can use the ACU for attacking from the start if you want.

In my AI the ACU builds only t1 energy until the first T2 energy building is present.
After this the ACU is free to do anything like enhancing, attacking or hiding.

Specific AI behavior:
Thats easy, you have this already in some builders.
Like the commander initial builder you can add the "PlatoonAddBehaviors" to every platton.
For example this air platton:

Code: Select all
    Builder {
        BuilderName = 'AntiAirHunt',
        PlatoonTemplate = 'AntiAirHunt',
        PlatoonAddBehaviors = { 'AirUnitRefit' },
        BuilderType = 'Any',
        BuilderData = {
            Location = 'LocationType',
            NeverGuardEngineers = true,
        },
        BuilderConditions = {
            { UCBC, 'PoolGreaterAtLocation', { 'LocationType', 4, categories.AIR * categories.MOBILE * categories.ANTIAIR } },
        },
    },
And the corresponding Platoon Template 'AntiAirHunt':

Code: Select all
   PlatoonTemplate {
       Name = 'AntiAirHunt',
       Plan = 'InterceptorAI',
       GlobalSquads = {
           { categories.AIR * categories.MOBILE * categories.ANTIAIR, 5, 100, 'attack', 'none' },
       }
   }


The Builder BuilderName = 'AntiAirHunt', is building a platoon with the template called PlatoonTemplate = 'AntiAirHunt',
The PlatoonTemplate is adding the main thread (AI plan) for this platton called Plan = 'InterceptorAI',
Thats the normal behavior of any platton.

In additional the builder will add a 2nd programm thread to the unit/platoon called: PlatoonAddBehaviors = { 'AirUnitRefit' },
This way we have 2 threads running, the first is the "InterceptorAI" for attacking and the second is "AirUnitRefit" for repair/refuel.

[Edit]
If you create your own PlatoonTemplate then you can add as AI plan every function you want.
Then you don't need the PlatoonAddBehaviors and you only have 1 thread running.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: AI-Uveso (v41). New AI mod for FAForever

Postby Franck83 » 11 Aug 2018, 07:55

Ty a lot uveso, this is really interesting. I will start with micro AI behavior and progress step by step.
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: AI-Uveso (v41). New AI mod for FAForever

Postby Uveso » 13 Aug 2018, 17:40

Can't wait to see the first steps from your ACU AI :D
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: AI-Uveso (v41). New AI mod for FAForever

Postby Uveso » 24 Aug 2018, 15:58

All AI mods can now be used with the normal (release) game version. (3697)
( http://forums.faforever.com/viewtopic.php?f=2&t=16597 )
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: AI-Uveso (v41). New AI mod for FAForever

Postby DeathStorm » 05 Sep 2018, 14:36

Hey, First of all very nice work!

It works a lot better then the Sorian AI which hase some problems since last big patch we figured. Your AI does well on my newly created map and game speed drop is mainly unit count based.

I worked together with Svenni_badbwoi to make a map based on a moon crater. The result is in this post:
http://forums.faforever.com/viewtopic.php?f=53&t=16661&p=167251#p167251

Svnni had a look on the markers and said it was ok. I tried to apply the rule of even distance to a not path able area. What do you say.
I just noticed, that i did only connect the markers for one small side path on one side. And the AI doesn't get along with it well so in my working version i disconnected them again.

What about naval it appeared to be ignored by your AI.

However playing with your AI i noticed that one path is not used (at the beginning) by the AI (upper lower path). Would you know how to enable this for the AI. Later in the Game it is used by the AI.

And is there a way to reduce spam? My map is designed for drops and strong mobile troops which microed to use terrain. Of course micro is something which is not in the ai by now, but is there an AI which creates small strong attack groups?

You should not be able to see my replay since I modified some things :<
DeathStorm
 
Posts: 7
Joined: 04 Sep 2018, 14:41
Has liked: 4 times
Been liked: 3 times
FAF User Name: DeathStorm

Re: AI-Uveso (v41). New AI mod for FAForever

Postby JonnoHR31 » 17 Sep 2018, 13:17

Love that someone is creating a new Ai, good work!

When you get to the ACU coding, is there any chance of making the Ai capable of properly utilising the all factions mod? Currently all Ai's that spawn with 4 ACU's only ever build units with the faction that they've been assigned, while the other 3 ACU's just plod around aimlessly. No idea how hard this would be, but it'd be awesome to play a difficult late stage game against an Ai throwing 4 combat ACU's (especially with blackops) at you with experimentals from all factions.
JonnoHR31
Crusader
 
Posts: 12
Joined: 09 Dec 2016, 16:40
Has liked: 7 times
Been liked: 1 time
FAF User Name: JonnoHR31

Re: AI-Uveso (v41). New AI mod for FAForever

Postby Uveso » 18 Sep 2018, 03:48

@DeathStorm:

Yes naval needs some improvements. (But basic naval builder are already in)
Land units are almost ready, and i am working right now on air units.

Sure its possible to reduce spam. The Adaptive AI is only building as much units as the enemy has. Also the Experimental Ai is focussing on ... Experimentals :)

At th moment i am really short of time, but next week we can have a talk @Teamspeak³. maybe with Sven ?!?



@onnoHR31:
Thank's a lot!

Can you post the exact name of the mod? I will take a look at it.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: AI-Uveso (v41). New AI mod for FAForever

Postby JonnoHR31 » 19 Sep 2018, 13:23

Just called "All Factions" and in the description says "Spawns the ACU's of all factions You need to turn on pre-build units for this mod to work"

If you can get it to work then no, thank you! :D

EDIT: Oh and the Blackops one is called "BO ACU All Factions", see attached.
Attachments
2.JPG
2.JPG (14.94 KiB) Viewed 3578 times
JonnoHR31
Crusader
 
Posts: 12
Joined: 09 Dec 2016, 16:40
Has liked: 7 times
Been liked: 1 time
FAF User Name: JonnoHR31

PreviousNext

Return to AI modifications

Who is online

Users browsing this forum: No registered users and 1 guest