When will the AI use atomic bombs?

Nope, it was his opening move. Our first war since I stole a worker on turn 7. I was still working on the Manhattan Project so he would have known he had the advantage. I am pretty sure he had exchanged nukes with another AI, but you say that should not have mattered. So I guess you are saying that pattern does not fit the code?

Ah, but remember, that's all just the stuff that feeds into whether or not the AI is willing to send a nuke. Who the AI actually nukes has little to do with who caused the AI to want to nuke someone. If Ghandi was at war with another AI and they'd been nuking each other for a while, Ghandi's nuke check will always pass. When Ghandi declared war on you, his nuke check passed due to the nukes he'd sent to and received from another player, but his nuke targeting code deemed you to be a better nuke target than the other player.
 
If Ghandi was at war with another AI and they'd been nuking each other for a while, Ghandi's nuke check will always pass. When Ghandi declared war on you, his nuke check passed due to the nukes he'd sent to and received from another player, but his nuke targeting code deemed you to be a better nuke target than the other player.

Okay, that makes sense then. But contradicts what you wrote earlier:

Only if you already nuked him or he already nuked you. The roll doesn't happen if either player has already nuked the other one.

So that should have been: Only if someone had already nuked him or he already nuked someone. The roll doesn't happen if either player has already nuked or been nuked.

Correct?
 
So that should have been: Only if someone had already nuked him or he already nuked someone. The roll doesn't happen if either player has already nuked or been nuked.

Correct?

Correct. Honestly, for all the time I've spent with the AI code, I still get caught off guard fairly often. I only just connected the dots that the nuke targeting code does not interact at all with the nuke decision code.
As a side note, the AI will only launch a single nuke per opponent who would trigger a nuke launch. For example, if Ghandi had 2 nukes but only one player would trigger a nuke launch, he will only launch one of those 2 nukes (at you, since you're the better target).
 
I hate that there is no defence against them, I remember in Civ II you could build the SETI Program (I think that's what it was called) to defend against nukes - wish there was something like that in Civ V
 
It was SDI defense, but with some clever tactics, the SDI defense could have been destroyed by a spy and in the same turn you got nuked.

In civ5 you have the bomb shelter, which will help a lot, but the idea is to not let the game go that far, since once the late game units come in to play there is basically little defense against them.
 
SDI Defence, that's the one!! The SETI Program was the search for extraterrestrials or something like that!!
 
Honestly, for all the time I've spent with the AI code, I still get caught off guard fairly often.

I am grateful for all the findings that you share. Many of the code fragments you post would be indecipherable without your English paraphrase of what is going on!

As a side note, the AI will only launch a single nuke per opponent who would trigger a nuke launch.

I have noticed that, good to have you confirm the logic. When I bomb, it is hardly ever just once per turn!
 
Top Bottom