AI-Uveso (v41). New 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: 1139
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 39 times
Been liked: 167 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
Priest
 
Posts: 359
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 54 times
Been liked: 55 times
FAF User Name: Franck

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: 1139
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 39 times
Been liked: 167 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
Priest
 
Posts: 359
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 54 times
Been liked: 55 times
FAF User Name: Franck

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: 1139
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 39 times
Been liked: 167 times
FAF User Name: Uveso

Previous

Return to AI modifications

Who is online

Users browsing this forum: No registered users and 1 guest

cron