I've trained AI to use fighters against ground units

FearSunn

Warlord
Joined
Dec 10, 2017
Messages
277
Finally, I've found the way how to mod AI to use fighter class air units to attack ground targets.
In this short video biplanes actively and effectively attack infantry and a tank:
(sorry for video quality and audio seems out of sinc. I am crap at capturing videos)
 

Aristos

Lightseeker
Joined
Dec 11, 2001
Messages
3,912
Location
Deep inside...
@FearSunn I have another question: would you please pass the lines of code/settings to make those damned planes fly faster, as in your video? What did you modify to achieve that?
 

FearSunn

Warlord
Joined
Dec 10, 2017
Messages
277
@FearSunn I have another question: would you please pass the lines of code/settings to make those damned planes fly faster, as in your video? What did you modify to achieve that?
Oh I am sorry. The faster speed you see is something unexpected from video capturing software I used. This actually my first screen capture video I've made in my life :) And probably the last one.
 

Aristos

Lightseeker
Joined
Dec 11, 2001
Messages
3,912
Location
Deep inside...
Oh I am sorry. The faster speed you see is something unexpected from video capturing software I used. This actually my first screen capture video I've made in my life :) And probably the last one.

Argh! Oh well, looked to good to be true, I have been searching for the stupid lines since forever, as the planes fly in slow motion even with fast movement enabled... anyways, I hope you can really improve the AI use of air units, as they are now, it's just non-existent...
 
Joined
Feb 7, 2018
Messages
2,959
Argh! Oh well, looked to good to be true, I have been searching for the stupid lines since forever, as the planes fly in slow motion even with fast movement enabled... anyways, I hope you can really improve the AI use of air units, as they are now, it's just non-existent...

I'm now envisioning a worse case scenario, where the AI starts building and flying planes all over the place, for no particular cause or effect other than to slow down the game as you watch in slow motion as the AI bombs an enemy city with 0 health for the 14th turn in a row ...
 

Aristos

Lightseeker
Joined
Dec 11, 2001
Messages
3,912
Location
Deep inside...
I'm now envisioning a worse case scenario, where the AI starts building and flying planes all over the place, for no particular cause or effect other than to slow down the game as you watch in slow motion as the AI bombs an enemy city with 0 health for the 14th turn in a row ...

The slow motion with fast movement enabled is just another bug that will never be addressed by FXS, and to make things worse, they seem to have made the speed variables hidden this time (for civ 5, the code was accessible, I have a little personal mod that makes the planes zoom around to avoid this problem, and there is also a public mod for the same).
 

Patine

Deity
Joined
Feb 14, 2011
Messages
9,021
Finally, I've found the way how to mod AI to use fighter class air units to attack ground targets.
In this short video biplanes actively and effectively attack infantry and a tank:
(sorry for video quality and audio seems out of sinc. I am crap at capturing videos)
Now you've taught the Civ VI AI to do what every other iteration of Civ game AI has long been trained in, and that some - like Civ II, notoriously, make such "locust cloud" raids of fighter units against land armies ad nauseum if they're in stock. Such a slow learner Civ VI is...
 

FearSunn

Warlord
Joined
Dec 10, 2017
Messages
277
I hope you succeed in creating a mod with this feature!
My expectation is Firaxis is also working on the issue to fix it with pre-expansion update. In that case this modification will not be needed.
At least until then I am not making it public.
 

bumpyglint

Chieftain
Joined
Aug 19, 2016
Messages
60
Nice job! But I didn't understand if you created a Mod with this feature or not, are you working on it?
 

chrisgatt7

Prince
Joined
Mar 26, 2013
Messages
395
@FearSunn: Nice! Can you look at making the AI players try to use Aircraft Carriers too, please?

I second this !!! Airacft carriers are key in global defense !!

I know this is a bomber but ... the AI bomber was positioned next to my tank for 25+ turns of pure war did it decide to attack
 

Attachments

  • 6DAD8CF0-7FB7-41D2-90CA-4E6F47B48040.jpeg
    6DAD8CF0-7FB7-41D2-90CA-4E6F47B48040.jpeg
    2 MB · Views: 187
Last edited by a moderator:

FearSunn

Warlord
Joined
Dec 10, 2017
Messages
277
Now THAT is a very high expectation... I used to have it for the first 6 months after release. Now I don't have any, anymore.
It would be outrageous if air combat issues (fighter class AI, carriers) is not touched with upcoming update. I just cant imagine this glaring AI holes could be further ignored by devs.
Anyway I will proceed with testing current modifications and will report here about the progress. The problem with testing AI is that it requires a brand new game to be started to take effect. Probably game engine cashes all AI data on creation and ignores further changes.
Btw could anyone suggest me ingame screen capturing software for better video results?
 

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
10,912
Location
France
In my simple tests vanilla fighters (and modded bombers with the "UNITTYPE_AIR" <AiType> added) do attack your units, but I don't have R&F, is this an issue with the expansion only ?

Personally I use OBS for video capture.
 

FearSunn

Warlord
Joined
Dec 10, 2017
Messages
277
In my simple tests vanilla fighters (and modded bombers with the "UNITTYPE_AIR" <AiType> added) do attack your units, but I don't have R&F, is this an issue with the expansion only ?

Personally I use OBS for video capture.
My tests are made with R&F. Havent played vanilla since RF release. Never seen unmodded fighters attack ground units with RF.
 

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
10,912
Location
France
quick test, Civ6 without R&F:

only change to units being:
Code:
INSERT OR REPLACE INTO UnitAiInfos
            (UnitType,        AiType)
    SELECT    UnitType,     'UNITTYPE_AIR'
    FROM UnitAiInfos WHERE AiType ='UNITTYPE_AIR_SIEGE';

else the bomber would not attack.
 
Top Bottom