Why won't the AI make nukes or aircraft?

Can't beat the AI? Is it too tame? Discuss the best strategies!
Post Reply
Sanguivorant
Posts: 21
Joined: Mon Apr 25, 2022 12:54 am

Why won't the AI make nukes or aircraft?

Post by Sanguivorant »

Okay, I can understand the AI massing phalanges, pikemen, musketeers, riflemen.

But the AI does not make aircraft, doesn't make nukes and by the modern era it becomes way too easy to take on the AI. Is there a way to change this, or should I look into playing multiplayer?
Ignatus
Elite
Posts: 657
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Why won't the AI make nukes or aircraft?

Post by Ignatus »

Shortly, yes, you should look for playing multiplayer, AI sucks and that won't change soon. (Well, there was an experiment with strong AI playing Freeciv, but that is not going to be supplied with the regular distribution and that was not an AI you can launch on your old laptop.) About aircraft, Freeciv military advisor limits considering military units for build to "simple" types that excludes fueled ones. Also, if nothing has changed since I've looked at it, AI does build helicopters (units losing hp in the open) but does not use them in any way unless it gets UNO wonder to stop them losing hp; yes, that's stupid. About nukes, I don't know; probably for AI a nuke is just a regular missile with 99 strength, and its calculations show it is ineffective in cases when you would apply it. Also, AI does not know that bombardment is different from regular attack ... I can continue long, so return to the start of my post.
Dino the Dinosore
Hardened
Posts: 198
Joined: Sun Dec 31, 2017 3:41 am

Re: Why won't the AI make nukes or aircraft?

Post by Dino the Dinosore »

Can you say more about that "experiment with strong AI"? I have something more powerful than an old laptop and would like to try it out.
Sanguivorant
Posts: 21
Joined: Mon Apr 25, 2022 12:54 am

Re: Why won't the AI make nukes or aircraft?

Post by Sanguivorant »

Ignatus wrote: Tue Jun 17, 2025 3:23 pm (Well, there was an experiment with strong AI playing Freeciv, but that is not going to be supplied with the regular distribution and that was not an AI you can launch on your old laptop.)
Anywhere I can download or use this strong AI? I've seen a few studies and would like to try them out:

https://web.stanford.edu/class/aa228/re ... inal51.pdf

Also, I don't know how to program AI, but this project seems to allow you to:

https://github.com/chris1869/freeciv-bot
Ignatus
Elite
Posts: 657
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Why won't the AI make nukes or aircraft?

Post by Ignatus »

Sanguivorant wrote: Wed Jun 18, 2025 6:45 pm Anywhere I can download or use this strong AI? I've seen a few studies and would like to try them out:

https://web.stanford.edu/class/aa228/re ... inal51.pdf
hehe as I can see all they could is playing in line with builtin Hard AI. I meant another kind of AI, it played much better, but that's not what you can download for free and run at home. About recent development, all that I have heared of is that in Freeciv-Web, there is GPT advice, but afaik not GPT opponents.
Sanguivorant
Posts: 21
Joined: Mon Apr 25, 2022 12:54 am

Re: Why won't the AI make nukes or aircraft?

Post by Sanguivorant »

Guys, I think I found out how to make the AI capable of building planes.

I was looking through the files in /ai/default/aiair.cpp, and it seems like this line of code disables the AI from making airplanes (line 436):

// This AI doesn't know to build planes
if (has_handicap(pplayer, H_NOPLANES)) {
return false;
}

Where can I find this handicap and remove it from the AI? And once I do that, do I have to rebuild from source or how do I get that feature updated?
cazfi
Elite
Posts: 3347
Joined: Tue Jan 29, 2013 6:54 pm

Re: Why won't the AI make nukes or aircraft?

Post by cazfi »

That handicap is set on "restricted", "novice", and "easy" difficulty level AIs.
E.g.:

Code: Select all

/help easy
...
  Doesn't build air units.
...
Higher difficulty levels do not have that handicap.
cazfi
Elite
Posts: 3347
Joined: Tue Jan 29, 2013 6:54 pm

Re: Why won't the AI make nukes or aircraft?

Post by cazfi »

Anyway, it's not hard to get AI to build aircraft (just remove whatever guards there is protecting AI from that), but it would be very hard to get AI to use those aircrafts sensibly once it has built them, i.e., not to lose masses of them to out-of-fuel.
Sanguivorant
Posts: 21
Joined: Mon Apr 25, 2022 12:54 am

Re: Why won't the AI make nukes or aircraft?

Post by Sanguivorant »

cazfi wrote: Mon Jun 23, 2025 7:42 pm Anyway, it's not hard to get AI to build aircraft (just remove whatever guards there is protecting AI from that), but it would be very hard to get AI to use those aircrafts sensibly once it has built them, i.e., not to lose masses of them to out-of-fuel.
How do I remove those guards? I am completely lost in coding changes for the AI, I've spent a few hours looking at the AI codebase and it's honestly confusing as many things are abstracted. Is there a good resource for deciphering how it all works?

From what I have tested, the AI seems to know how to use fighters and stealth fighters really well. That's all I want, for them to build fighters.
cazfi
Elite
Posts: 3347
Joined: Tue Jan 29, 2013 6:54 pm

Re: Why won't the AI make nukes or aircraft?

Post by cazfi »

The problem is in in fuel usage, so look for checks against building fuel using units.
Post Reply