Why won't the AI make nukes or aircraft?
-
- Posts: 21
- Joined: Mon Apr 25, 2022 12:54 am
Why won't the AI make nukes or aircraft?
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?
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?
Re: Why won't the AI make nukes or aircraft?
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.
-
- Hardened
- Posts: 198
- Joined: Sun Dec 31, 2017 3:41 am
Re: Why won't the AI make nukes or aircraft?
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.
-
- Posts: 21
- Joined: Mon Apr 25, 2022 12:54 am
Re: Why won't the AI make nukes or aircraft?
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
Re: Why won't the AI make nukes or aircraft?
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 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
-
- Posts: 21
- Joined: Mon Apr 25, 2022 12:54 am
Re: Why won't the AI make nukes or aircraft?
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?
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?
Re: Why won't the AI make nukes or aircraft?
That handicap is set on "restricted", "novice", and "easy" difficulty level AIs.
E.g.:
Higher difficulty levels do not have that handicap.
E.g.:
Code: Select all
/help easy
...
Doesn't build air units.
...
Re: Why won't the AI make nukes or aircraft?
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.
-
- Posts: 21
- Joined: Mon Apr 25, 2022 12:54 am
Re: Why won't the AI make nukes or aircraft?
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.
Re: Why won't the AI make nukes or aircraft?
The problem is in in fuel usage, so look for checks against building fuel using units.