Overuse of Nukes

rolo,

There is nothing in the linked game that suggests any player possessing nuclear weapons should have worried about GW before launching. So it doesn't at all answer my question...
Can you show me a single game where any player, human or AI, had to give much consideration to GW in regards to nukes and not doing so seriously damaged their chances of winning the game?

I'm not denying that global warming happened and I appreciate that there are situations where bringing on global warming can be a problem. However, assuming one uses nukes for a good reason (important strategic targets as I keep saying) then this will always dominate any GW consideration.

I guess what I'm really asking you is to be more explicit in exactly how you think GW is going to factor into the decision. My position is that the use of nuclear weapons is so destructive and that diplo penalties (as well as damaged tiles due to fallout etc.) are so severe that GW considerations are dwarfed in comparison and that wanting to factor them in is an ideal that isn't really going to achieve anything.

At the moment, an AI doesn't even know how to specialise cities. Do you realistically think that trying to teach it to figure out whether global warming would have a worse than average or better than average impact on them is going to achieve anything material that would make the programmer think, "Wow, I just made a substantial improvement to the AI that was worth my time"?
 
One could implement tit for tat style behaviour in an AI.

The AI would have to put forward ultimatums. "If you enter my territory, I will nuke you", "If you destroy any of my units, I will nuke you", "If you attack any of my cities, I will nuke you", "If you use nuclear weapons, I will nuke you".

It doesn't have to fire off every nuke it has to follow through on such a threat. Nor does it have to follow through on its threat, or only nuke if it earlier made a threat.
 
I liked the idea of letting the AI know about diplomacy policies for using nukes, and I thought I would investigate the code for this. After investigation, it looks like the AI uses diplomacy to help decide which city to nuke if it is at war with two enemy civs, and will only nuke civs they are furious with. Neither of these restrictions apply to tactical nukes. So, the Incans nuked CivFanCSS partly because his cities looked more valuable, but also because they were furious with him, and perhaps more furious with him than their other enemies.

There's room for an interface improvement here: when you consider going to war with a civ, check to see if they have nukes and their post-war relationship status will be Furious. If it will, pop up a message from the military advisor saying "The Incans are threatening to nuke us if we declare war on them! Really declare war!?". That will make the current implicit threat explicit, and make the AI appear more intelligent even if it behaves the same. However, we can also improve the AIs behaviour.

There is already code for determining the value of relation bonuses to the AI in CvPlayerAI::AI_eventValue, which calculates an integer called iDiploValue. The main logic is "if we like this player then value positive attitude, if however we really hate them then actually value negative attitude". Relations with powerful leaders are valued more than relations with weak leaders. Additionally, we value diplomacy modifiers at 1/2 if Aggressive AI is checked. Here is the key line:

Code:
iDiploValue += ((iOtherPlayerAttitudeWeight + 50) * kEvent.getAttitudeModifier() * GET_PLAYER(kTriggeredData.m_eOtherPlayer).getPower()) / std::max(1, getPower());

This seems like a good basis to calculate the diplomatic damage from nuking someone. We also need to include the damage from the loss of the hammers involved in building the nuke. This captures the "Fleet in Being" factor. However, the hammer cost would not be applied for ICBMs in threatened cities, nor for tactical nukes in cities/forts when facing a nuclear-armed enemy, nor for tactical nukes in the water. In those cases we are more likely to use our nukes lest we lose them next turn.

Then, when we are looking for suitable targets in CvUnitAI::AI_nuke and CvUnitAI::AI_nukeRange, we need to ensure that we only consider targets that do more damage than the diplomatic and hammer damage we are taking by using the nuke. This can be done by setting iBestValue at the start of the relevant loops. If we don't find any appropriate targets, then we look again next turn.

We also have an inconsistency in the existing code. The code that calculates the best target for ICBMs uses CvUnitAI::AI_nukeValue, whereas the code that calculates the best target for tactical nukes uses its own inline code. For example, ICBMs take into account city culture, whether they previously owned the city, will not nuke neutrals, and ignore all units in the squares around a target city, including friendly units. They should both use the same logic (preferably in the same function).

As well as consolidating the nukeValue code in a good way, we could make further tweaks. Nuking any improvement currently gives +1 value (to ICBMs) and +10 value (to tactical nukes). However, plainly a town on a railroad should be given a higher value than a mere road. I think we can use calculateImprovementYieldChange() to calculate this. We should also reduce values to account for SDI or nuke shelters. We should also be able to get the AI to move its units away from an enemy city that has a high nuke value, nuke it, and then move units in. This would imply doing nuke calculations first. Additionally, when tactical nukes are loaded into unmoved submarines, their "range" should include the movement of the submarine, so the AI can move a sub and then launch its nuke.

If the code gets slow, we can optimise by considering all ICBMs in a single operation at the beginning of each turn. Currently the nuke value calculations are repeated for every ICBM the AI possesses.
 
You make several good points there, MartinHarper. The valuation that you mention seems fairly logical and the inconsistency between the two types of nukes needs to be fixed. There's a lot that can be done to improve the use of nukes.
 
MartinHarper -

I agree with many of your comments, I had looked through the nuke code and noted some of the same needs. Thanks for the diplo valuation starting point, that's very helpful.

Coordinating actions between different unit types (ie, having troops move away from a city, nuking the city, then moving the troops back) would be a new level of coordination for the land unit AI, only the BBAI naval AI tries to do this kind of coordination currently! Not sure quite how to handle that, will think about it.
 
Coordinating actions between different unit types (ie, having troops move away from a city, nuking the city, then moving the troops back) would be a new level of coordination for the land unit AI, only the BBAI naval AI tries to do this kind of coordination currently! Not sure quite how to handle that, will think about it.
That kind of coordination is sorely needed. Otherwise we will never see a AI using their spies to revolt a city, as humans do so frequently, just for another example of how useful it would be.... either way , you need to get this kind of coordination to use nukes in a minimally efficient fashion, because, like I said before, nukes work far better in pairs ;)

@Martinharper

I agree with most of what you sugested ... in fact I sugested something along those ines in the last page ;) .... great minds think alike or fools seldom differ :D

About the nuke function: it is clear that having 2 nuke functions in the same game for nukes that don't behave so diferently is stupid and most likely a big oversight of the devs. But IMHO we should not use CvUnitAI::AI_nukeValue as it is for template... besides all the defects you already mentioned, that function is just for nuking cities ( atleast it is how I read it ). The best use you can give to nukes most of the times is by nuking enemy SoD in field and it looks like no one thinked on that while making this function ( that is probably why they made the tac nukes funcion diferent ... must see the tac nukes funcion... care to say where it is? ).... it looks that the devs only thought on using ICBMs for nuking cities :p In fact, IMHO it looks that all the AI logic as it is regarding nukes is too much directed towards nuking cities.....
 
Definitely a far more useful function to work with than the ICBM code, I reckon ;) Even if because it assumes that you may want to nuke something else than cities :D
 
I neglected to mention in my first post that the Incan's continent was divided by a small strip of coast title, thus really dividing in in two. I gifted Shaka 30 units at once and he took two cities on the smaller Inca continent that they had won in a war around 1100 AD. The Incan's power ratio with me was 1.1 and they had a lot of resources and modern conv. units. They actually had me beat by 1 tech (because of ROM Encyclopedia project) so using their three ICBMS was really suicide.

Like I said in the first post, they should have expected a nuclear counter attack and waited until the last minute to fire off their three nukes or waited for me to use nukes assuming I would refrain from using them to avoid the diplo penalties.

The targeting was kind of bad as well.. the attack on my carrier fleet was correct, but the attack on my Capitol was a mistake seeing that they only had three nukes. They should of saved the other two nukes to counter my invasion force if it ever showed up, or to supplement their own invasion.
 
I understand this is a bit off-base, because you all are talking about "how" the AI should use these, and in what cases. But, something that is a bit simple & would help ease the title of "overuse" of nuclear weapons, that I use successfully in my games:

#1 - You have to consider - when you build units...such as swordsmen and you take them on an attack. Say you attack a city with 7 catapults, and 12 swordsmen. Well, you're not really using "7 catapults, and 12 swordsmen" - you are seiging the city with thousands of people - as each unit is scaled down for obvious reasons. This is not true with Nuclear weapons. In this game - 1 tactical nuke/ICBM = 1. And the cost to build them is relatively small. With the cost being so small, its no wonder the AI/human player builds up mass reserves of them. The solution I propose, to ease this:

#2 - Make the costs x10 to build them. That makes the weapon a MAJOR investment. Now, instead of 3 turns to build, it takes 30 turns. This will scale the weapons down a bit. The superpowers will still be able to build some throughout the duration of the game...but less ICBMs/tactical nukes, and there will be less catastrophic events of mis-using them. I know its simple, but I've played Civ for a long time with using this and the regular unit-cost, and this simply makes the game a bit more enjoyable as the AI is not really a threat to drop 25 ICBMs on me or the other AI in 3 turns.
 
#2 - Make the costs x10 to build them. That makes the weapon a MAJOR investment. Now, instead of 3 turns to build, it takes 30 turns. This will scale the weapons down a bit. The superpowers will still be able to build some throughout the duration of the game...but less ICBMs/tactical nukes, and there will be less catastrophic events of mis-using them. I know its simple, but I've played Civ for a long time with using this and the regular unit-cost, and this simply makes the game a bit more enjoyable as the AI is not really a threat to drop 25 ICBMs on me or the other AI in 3 turns.

Yeah, but it isn't as fun or realistic. I mean, the US during the cold war had some 6k (or more) nuclear warheads, and rumors have it that the soviets has upwards of 8k warheads.

Nor does it solve the problem. The point is to teach the AI to behave better, not handicap it...
 
That kind of coordination is sorely needed. Otherwise we will never see a AI using their spies to revolt a city, as humans do so frequently, just for another example of how useful it would be....

Be careful what you wish for ;) That was on the list for the next version already.
 
Nor does it solve the problem. The point is to teach the AI to behave better, not handicap it...

I know, as I said - I know the point is to fix the AI. But, since at the moment the AI does not use them well - it is better to give everyone fewer. Fewer = less things to screw up. Until it is fixed in the code...always is better to give the AI less things that they can screw up. And everyone having less ICBM - lets face it...as a human - it would not exactly be beneficial to us to build multiple ICBM/tactical nukes at 20-30 turns/weapon. So that gives the human less to overwhelm the AI with as well.
 
I know, as I said - I know the point is to fix the AI. But, since at the moment the AI does not use them well - it is better to give everyone fewer. Fewer = less things to screw up. Until it is fixed in the code...always is better to give the AI less things that they can screw up. And everyone having less ICBM - lets face it...as a human - it would not exactly be beneficial to us to build multiple ICBM/tactical nukes at 20-30 turns/weapon. So that gives the human less to overwhelm the AI with as well.

I think a lot of people like nukes too much to welcome a massive nerf like that.

I always figured that elements of the game that had considerable development effort go in (art effects in this case) shouldn't be relegated to such a minor role. It's how I make sense of things like tribal villages being on by default. It baffles me when people argue that things like random events and villages should be off by default because it's like asking the developers to hide all the features in the game.
 
I know, as I said - I know the point is to fix the AI. But, since at the moment the AI does not use them well - it is better to give everyone fewer. Fewer = less things to screw up. Until it is fixed in the code...always is better to give the AI less things that they can screw up. And everyone having less ICBM - lets face it...as a human - it would not exactly be beneficial to us to build multiple ICBM/tactical nukes at 20-30 turns/weapon. So that gives the human less to overwhelm the AI with as well.
In fact it would be the exact oposite ... sure you would see less stupid nuke attacks from the AI, but they would be more damaging for the AI, because it would more hammers to the sink per mishandled nuke ( remember that the Ai does not save units for a better day during war, so they would launch a 5000 hammers ICBM in the same way they launch a 500 ICBM now ( that is, now, at the better target in range ).... ) . Anyway the nukes at the eyes of the AI are already terribly overpriced as they are now ( 2,5 cost of mechs, that give the same power per unit ), so putting more hammers in them would probably make the Ai cease doing them altogether.... that would surely handicap them vs a human :p
 
Jdog already talked about splitting the power value in land, sea and air power. Maybe nuke power should have a separate value so that the AI can also focus on that part of its power.

Coming back to this point...

If an AI has a good mix of nukes and units, and is facing an enemy without nukes, then it may find that it's "land" power is slightly lower, but its "nuke" power is much higher. In this situation, though, it should continue to build a good mix of nukes and units, rather than building more units and fewer nukes. Enemy nuke power is surely relevant to tactical decisions, but the only impact it should have on build orders is the relative value of bomb shelters and the SDI.
 
Coming back to this point...

If an AI has a good mix of nukes and units, and is facing an enemy without nukes, then it may find that it's "land" power is slightly lower, but its "nuke" power is much higher. In this situation, though, it should continue to build a good mix of nukes and units, rather than building more units and fewer nukes. Enemy nuke power is surely relevant to tactical decisions, but the only impact it should have on build orders is the relative value of bomb shelters and the SDI.

In general, knowing the enemies power in a certain area will help you decide how to counter that. In other areas that means trying to acquire similar values, in nuke power it would mean focussing more on nuke defence when the enemies nuke power is higher. It could for instance increase the value of SDI enabling technologies or increase the value of bomb shelters. It's just one of those things which will help the AI make better decisions.

I agree that an AI should balance its conventional and nuclear forces. These power values will also make it easier to create that balance.
 
Do you think we should let the AI 'cheat' in finding out how its enemy's power is weighted, or should we make the AI scout with planes and such to get that information?
 
Do you think we should let the AI 'cheat' in finding out how its enemy's power is weighted, or should we make the AI scout with planes and such to get that information?

I don't mind it cheating a little, since the AI lacks a memory, and forgets what troops I had in a city after it's scout moves on.
 
Back
Top Bottom