When will the AI use atomic bombs?

wayneb64

Prince
Joined
Nov 21, 2005
Messages
341
I am near the end of an Immortal game and going after the last AI that needs to be put down, and he is sitting on a handful of bombs which could decimate my force. I have taken out three or four carriers with a couple bombs each and taken a city with a bomb in it, but he has never used one on me.

In the past (not sure if I am thinking Civ IV or earlier Civ V) I have had the AI attack what used to be there own cities with nukes. I have tried to keep my units spread out to keep the losses down, but for whatever reason he has not nuked them.

I am wondering if anyone has figured out any rules to keep from getting blasted.
 

Sayya

Chieftain
Joined
Mar 19, 2015
Messages
32
Whether the AI actually uses nukes against you is dependant on their AI flavor.

http://civdata.com/

In my most recent game, I was fighting Isabella and she had two nukes. She never used them against me in the ~20-30 turns she had them.

She has a Use Nuke flavor of 5, so it could have been anywhere between 3-7.

I went on to declaring war on Ashurbanipal and he immediately nuked me twice.

He has a nuke flavor of 7, which means it could have been anywhere between 5-9.
 

wayneb64

Prince
Joined
Nov 21, 2005
Messages
341
Lots of numbers there, can you explain that a bit? You know their use nukes number already or you looked it up in that chart? What are these ranges you mention and how do I determine that?
 

Sayya

Chieftain
Joined
Mar 19, 2015
Messages
32
Lots of numbers there, can you explain that a bit? You know their use nukes number already or you looked it up in that chart? What are these ranges you mention and how do I determine that?

Okay basically

Every AI has a set flavor for everything. This determines whether they'll be warlike, peaceful, go for technologies, naval warfare, etc.

So you're interested in looking at who's building nukes. So you scroll down to Flavors > Build Nuke, and Flavors > Use Nuke

We can use the first three people as an example: Ahmad Al-Mansur (5 Build Nuke, 6 Use Nuke), Alexander (7 Build Nuke, 5 Use Nuke), and Ashurbanipal (6 Build Nuke, 7 Use Nuke).

The higher the number, the more likely they are to do that action. The lower the number, the less likely.

However there is one caveat: Every game you roll (besides from using Random Personalities), they can be +/- 2 of each number.

So that means Ahmad Al Mansur, who was 5/6, can be somewhere between 3-7/4-6. Alexander who is 7/5, can be 5-9/3-7. Ashurbanipal who is 6/7, can be 4-8/5-9.

That means rarely, but possible, even though Ashurbanipal has a 7 in Use Nuke, he can be a 5. And Alexander who is a 5 in Use Nuke can be more likely to use a nuke on you than Ashurbanipal.

Now if you scan the list you can see some people, like Ghandi, have a 12 Build Nuke / 12 Use Nuke. The maximum for any AI is 10/10 on flavor, so that just means he is a 10 every game for both of these.

Make sense?
 

reddishrecue

Deity
Joined
Nov 16, 2009
Messages
6,228
When the AI can. AIs nuke if they are at war with you and have the necessary tools for the AI to nuke you.
 

Delnar_Ersike

Prince
Joined
Jan 1, 2007
Messages
497
Location
localhost
In the unmodded game, the actual algorithm is actually quite simple: if the AI thinks that it is losing any war projects that it will be destroyed in the war against a player or if its current war projection against a player is lower than in the previous turn, it will generate two random numbers between 0 and 9 inclusive. If its Use Nuke flavor is greater than the results of both rolls, it will launch the nuke. So 10 flavor is 100% pass, 9 flavor is 81% pass, 8 is 64% pass, 7 is 49% pass, 6 is 36% pass, 5 is 25% pass, 4 is 16% pass, 3 is 9% pass, 2 is 4% pass, and 1 is 1% pass. In the unmodded game, flavors can go to 0 (in which case it's 0% pass), but this can cause odd AI behaviors, is values are often divided by flavor values in the C++ code, and we all know that dividing by 0 has... interesting results (in that there shouldn't be a result, but the game still has to generate one).
The reason Ghandi always uses nukes is because even if flavor rolls at the beginning of the game give him -2, he's still at 10 Use Nuke flavor, which means the roll to use nukes always succeeds. Who it targets depends on a different set of algorithms though, and nukes do need to be built (which is an entire different set of algorithms and a different flavor) before they are used.

Additionally, the AI will always launch nukes if either it has already been nuked by the other player or the other player has already nuked it.
 

beetle

Deity
GOTM Staff
Joined
Mar 19, 2004
Messages
6,314
Location
Frederick, MD
pass nuclear non-proliferation?

No, that only effects building more nuke, not using the ones already available.

In the unmodded game, the actual algorithm is actually quite simple: if the AI thinks that it is losing any war, it will generate two random numbers between 0 and 9 inclusive. If its Use Nuke flavor is greater than the results of both rolls, it will launch the nuke.

Nice, thanks for that! That explains much of the behavior I have experienced.

I am wondering if anyone has figured out any rules to keep from getting blasted.

So, from the above, the trick is to move on the AI quickly. See what the AI wants for peace -- if he is asking for cities, then he is under the delusion that he is wining, and will not nuke you.

I am near the end of an Immortal game and going after the last AI that needs to be put down, and he is sitting on a handful of bombs which could decimate my force. I have taken out three or four carriers with a couple bombs each and taken a city with a bomb in it, but he has never used one on me.

My experience is that the AI prioritizes preserving air units over actually using them. Many times I have seen nukes/planes evacuated from an AI city I had under siege when really there was more than enough air power to break my assault. But then sometimes the AI flies a bunch of stuff in just before I take a city.

In the past (not sure if I am thinking Civ IV or earlier Civ V) I have had the AI attack what used to be there own cities with nukes.

I have for sure seen this in V, but maybe not since the 2014 Fall patch?
 

wayneb64

Prince
Joined
Nov 21, 2005
Messages
341
Well Siam did finally start unloading his nukes on me, decimating my elite forces, but also ruining all of what where his own nice cities. It did start after I had taken one nice city and his capitol and was closing in on his other. I must say I think the nukes are OP, especially with no way to counter them accept trying to ban their production.

I think complete destruction in a two hex radius is way to strong, especially with such a long range.
 

Sedwick

Parent, then Civ'er
Joined
Jan 2, 2014
Messages
311
Location
Waukesha, WI
In the unmodded game, flavors can go to 0 (in which case it's 0% pass), but this can cause odd AI behaviors, is values are often divided by flavor values in the C++ code, and we all know that dividing by 0 has... interesting results (in that there shouldn't be a result, but the game still has to generate one).

Well, if they didn't anticipate the possibility of flavor value 0 and it's throwing exceptions, that's just bad programming.
 

Sedwick

Parent, then Civ'er
Joined
Jan 2, 2014
Messages
311
Location
Waukesha, WI

Delnar_Ersike

Prince
Joined
Jan 1, 2007
Messages
497
Location
localhost
Well Siam did finally start unloading his nukes on me, decimating my elite forces, but also ruining all of what where his own nice cities. It did start after I had taken one nice city and his capitol and was closing in on his other. I must say I think the nukes are OP, especially with no way to counter them accept trying to ban their production.
I actually think nukes are quite boring in Civ5 because of the limited supply of uranium on the map, and the fact that AFAIK, nukes destroy nuke units. You cannot really enter MAD situations, since no civ can stockpile enough nukes to completely annihilate one another, and even if they did, the aggressor would win because the first nuclear strike would destroy all of the defender's nukes.
Oh yeah, and there are no global consequences to using nukes: no nuclear winter, no unhappiness from wiping out a bunch of civilians, no automatic triggering of nuclear counterattacks, nothing.

Well, if they didn't anticipate the possibility of flavor value 0 and it's throwing exceptions, that's just bad programming.

It doesn't throw exceptions because they stealthily enclosed divisors in a max() function with 1, but it does really mess up ratios. For example, if expansion flavor becomes 0 for some reason, the AI will never want to settle any cities. Period. Similar things happen for other flavors. It's probably why only Ghandi has any flavors set up that could be 0 with the default randomization settings, and I don't think those flavors are involved in anything vital (like unit production), but nothing's guaranteed for modded civs/leaders, or mods that increase the flavor randomization range.
 

wayneb64

Prince
Joined
Nov 21, 2005
Messages
341
Just curious: Why didn't you sue for peace after taking his cap? What is going on in your game that you need to eliminate Siam entirely?

He is to far ahead of me in the space race, I needed to sack his cities making space ship parts. I now have 5 of 6 capitals and 3 nukes of my own to use on Alexander to my south who is ahead of me in parts but behind in tech. I will either nuke Alexander and take his capitol or finish my ship if Siam doesn't put out another part with one of it's lesser cities.
 

wayneb64

Prince
Joined
Nov 21, 2005
Messages
341
Um, you do know what a nuclear bomb DOES, right? Here's a conservative simulation: http://meyerweb.com/eric/tools/gmap/hydesim.html

I don't disagree that nuclear bombs cause massive destruction in reality, I am complaining about game balance. I overcame massive AI handicaps with an inferior force that I spent all game getting promoted to an elite force killing off the never ending hoards the AI can put out like popcorn, only to have him wipe them all out in one turn with one unit. Since there is no defense against the nukes it's really not 'fair' that they can do such damage at such a long range.
 

beetle

Deity
GOTM Staff
Joined
Mar 19, 2004
Messages
6,314
Location
Frederick, MD
I will either nuke Alexander and take his capitol or finish my ship if Siam doesn't put out another part with one of it's lesser cities.

Thanks for the background. Sounds like a fun game!

I am complaining about game balance.

There have been a few threads about nukes, with the IMHO more persuasive arguments that, if anything, they are underpowered. Personally, I think it is something that the developers got just about right. Most everyone complains, but half think it is too much, and half not enough. Really tough to balance!

I overcame massive AI handicaps with an inferior force that I spent all game getting promoted to an elite force killing off the never ending hoards the AI can put out like popcorn, only to have him wipe them all out in one turn with one unit.

That does suck. The only consolations I can offer is (1) the game is almost over anyway, and (2) the AIs tend to favor Nuclear Bombs over missiles, which leave half your veterans only half-dead. Sorry it did not work that way for you.
 
Top Bottom