Overuse of Nukes

civ editor11

Ruler
Joined
Jan 24, 2009
Messages
999
Location
U.S.
If you give the AI any nukes via WorldBuilder they have a tendency to use them right away is there a way to fix this? I've been trying to make a cold war mod, but I can't do it without the AI destroying me in under a turn with there nukes. I find this a real problem with the AI which needs to be fixed for many scenarios to work. So is there any viable way to do this or should I just give up on trying to make this work. If you just tell me where and what i ned to edit I could do it myself I just need it fixed in any way possible.
 
If you give the AI any nukes via WorldBuilder they have a tendency to use them right away is there a way to fix this? I've been trying to make a cold war mod, but I can't do it without the AI destroying me in under a turn with there nukes. I find this a real problem with the AI which needs to be fixed for many scenarios to work. So is there any viable way to do this or should I just give up on trying to make this work. If you just tell me where and what i ned to edit I could do it myself I just need it fixed in any way possible.

Really? In games I play, the AI are very hesitant to use nukes. They often won't use nukes until someone else already has, usually me.

I can see the use of restraining nukes for a scenario, but in reality, using nukes is a good thing for the AI (aside from the global warming.) It means that they are seeing the tactical advantages of using a nuke and destroying an enemy (unless they are misusing them on one or two individual units, not a city or large stack.)
 
When they have over a hundred it is devestating to everyone they dislike. When you're the people they dislike you do this and hope someone manages to fix it so you don't die horribly every time you play.
 
so you don't die horribly every time you play.

I thought the point of Better AI was to get the AI to be a better (hopefully, one day better than the human) player. If the AI is managing to crush you, and it isn't getting a handicap bonus of some sort, I fail to see the problem.
 
Is there a reason why you are giving nukes to the AI via world builder?
 
@ Cybah: I'm making a Cold War scenario it wouldn't be right not to give them large amounts of nukes.

@ Afforess: The point is in real life the Soviet Union wouldn't of blown the US, UK and NATO into oblivion like the AI is doing. I was hoping for a slight level of realism on this part. That is why I'm asking for help. I know a little bit about C++ so I can probaly do it if you just tell me where to go in the DLL for it.

Where is the code where the AI decides to build and launch nuclear weapons?
 
@ Afforess: The point is in real life the Soviet Union wouldn't of blown the US, UK and NATO into oblivion like the AI is doing. I was hoping for a slight level of realism on this part. That is why I'm asking for help. I know a little bit about C++ so I can probaly do it if you just tell me where to go in the DLL for it.

The Soviet Union was never technically at war with the USA.

Although I understand your need for realism for a scenario; I don't think that's Better AI's goal. Unfortunately, I don't know where the functions for nukes are.
 
In fact I'm not sure if the AI actually has separate code regarding use of nukes. My impression in game is that the AI treats nukes as long range ( in case of ICBM ) expendable bombers or something like that and not like RL humans treated them during cold war... said in other way, IMHO the AI treat nukes as any other weapon while in war.

And Afforess has a big point. The game assumes that while in war the AI will use everything in hand, WW II style. That is not the status that US and USSR had between 1945 and 1989 and the game does not have a AI strategy that reflects that. You would probably need to create a new AI strategy to recreate that in a minimally realistical fashion.

P.S On a related issue: The AI has any conscience of Global warming? I surely don't think so and never saw any code reagrding that.... With more nukes flying around ( atleast it is my impression on modern wars in better AI ), that is a big issue....
 
Where and how would I add a new strategy for the AI. Sorry I'm new to the SDK. Am I going to need to learn new parts of C++ or what?
 
do they start with war in your mod? I see no reason why the AI should keep the nukes and get destroyed with those nukes in their cities.
 
No they don't start at war they start at peace with bad relations with the USSR or US.
 
P.S On a related issue: The AI has any conscience of Global warming? I surely don't think so and never saw any code reagrding that.... With more nukes flying around ( atleast it is my impression on modern wars in better AI ), that is a big issue....

Conscience? Once Nukes get let out of the bag, who cares about Global Warming? You (or the AI) should be able to grab a domination or conquest victory pretty easily once they have nukes. The planet can go to pieces, as long as the AI wins.
 
Remember that global warming is not only a consequence of nukes since 3.13. Also, there are a lot of mods that have nukes appearing roughly in the middle of the game. To end, nukes aren't necessarily going to bring a dom or conquest victory to any side ;)
 
To end, nukes aren't necessarily going to bring a dom or conquest victory to any side ;)

Your right. We need to teach the AI to stockpile enough (2 per enemy city) before going all out. Then the planet doesn't matter. :lol:

Edit:
On a more serious note though, do the AI take into account the heavy negative reactions other leaders have before launching nukes? If not, they should.
 
If you want to change it so the AI doesn't always fire its nukes, you would need to make adjustments to CvUnitAI::AI_ICBMMove(). This is where the AI decides what to do with both its ICBMs and tactical nukes.

I'd say you'd want to add some logic to keep the AI from calling AI_nuke() or AI_nukeRange() under some conditions ... what exactly depends on what you want the AI to do. You might also consider changes to those two functions and AI_nukeValue() to adjust where the AI sends them, and whether it considers it worthwhile to launch them.

Once the AI is at war, has built ICBMs, and is Furious with a target, it will let them fly as it stands.
 
Once the AI is at war, has built ICBMs, and is Furious with a target, it will let them fly as it stands.

Just skimming over the code, and I think my fears were confirmed. The AI does not consider the fact that launching nukes have ramifications. It should definitely consider the environmental consequences. Perhaps only consider them a little if the AI is going for a domination or conquest victory, but if the AI is going for Space Race or another victory, the AI should be very cautious about nukes. After all, if it is in the game for the long haul, and not a conclusive victory, it shouldn't want all that global warming.

Also, why does the AI need to be Furious. If it is nearing a conquest victory, and has some enemy stacks coming from a cautious or annoyed player, it should still be able to launch nukes. If I can launch nukes at my friends (when it's advantageous to me) the AI should be able to, too.

Also, the AI doesn't appear to factor in that if it is friends of the friends of the player it plans to nuke, that it will anger those friends of the victim a lot.
 
I think in the event of MAD, nuclear winter is going to be a much bigger threat than global warming, but yes, the AI should have some concept of negative consequences... in particular, the AI should be hesitant because once a nuke has been used, all bets are off.
 
Since the global warming mechanics target land indiscriminately I don't see any real point in the AI being worried about it, especially in deciding whether or not to use a nuke. Easily the biggest thing to consider is the negative diplo ramifications with other leaders in the game and whether they or the enemy also have nukes. I think a lot of people who build nukes like to play out a MAD scenario but if the AI doesn't even recognise the enemy has nukes then it sorta makes nukes a bit less fun.

I am not aware what goes into the decision to use nukes but even if it is Furious with its target it should only use them either in desperation (real possibility of being wiped out) or on a sufficiently large strategic target (a SoD of maybe 15 or more units for a tactical nuke), or a key city for an ICBM. If used properly nukes have the potential to be a hugely strategic instrument, but if the AI is only treating them in a similar fashion to something as simple as a guided missile then definitely the AI could be improved if its use of nukes improved.
 
Yeah, I agree ... the AI should be way less trigger happy and play more of a MAD scenario, it's more realistic and the tension of will they or won't they use their nukes would also be more fun.

I'm thinking it basically needs a hesitancy to be the first to launch nukes under many circumstances, and then a variable minimum threshold so it only sends them at high value targets at first ...
 
Back
Top Bottom