How about increasing the cost to build nukes? This would then theoretically push out the first instance of nuking, as well as increasing the gap between rounds of bombing. Say increase the cost of Atomic Bombs by 33%, and Nuclear Missiles by 50%?
The problem with doing this is that the AI's decision-making is done on the basis of Flavor, so if you raise the cost but don't adjust the flavors, then the AI will still build the things just as often as before, which'll suck up even more turns, and therefore cripple it even worse in terms of infrastructure. (And if I do adjust the flavors, then what did I need the increased cost for?) Small upward tweaks are good, and I'll look into that, but I can't take it far enough to REALLY make a difference.
The bigger issue, IMO, is that you've got two nuke units within one tech level of each other. Besides just being kinda pointless in general, this basically doubles up the Flavor values, making it more likely an AI will build one of the two.
So would the AIs be able to understand that nuking someone’s Palace has a lower probability rate of success?
I just don't know. If it was a Lua change then it'd be definitely no, but this IS an already-implemented function in the Buildings table. I just don't know if the AI can tell this defensive bonus exists; similarly, there's an AirDefense modifier to improve a city's defense against air units, which I've already given to the Palace, and I have no idea whether the AI can evaluate its effects. (Since the player can't really tell until after he's made an air attack, I'd lean towards no on this one.)
Even if it deals less damage, nuking someone's capital is STILL worthwhile. It's their capital, after all, it'll be the hardest to conquer normally (thanks to the palace's defense boost), and knocking down its population makes a big difference to the economy (since capital population counts towards EVERY city's trade route income).
Also, what are the parameters regarding nuke defenses for detonations on tiles near cities
None. The defenses only affect how much damage a city takes when being hit by a nuke. They do nothing for anyone NEAR the city, they don't stop improvements from being destroyed, and they don't prevent fallout. SDI does help these, by adding a flat percentage chance that a nuke will be destroyed BEFORE exploding, but that's an empire-wide thing.
I'd tried doing something related to this in my mod. My original goal was that SDI would have a 75% chance of intercepting an Atomic Bomb, a 50% chance against a Nuclear Missile, and a 25% chance against a Planet Buster. This percentage would then be modified by how many Orbital Defense Pods the defender had and how many Geosynchronous Survey Pods the attacker had. I could then go from there and adjust things based on the contents of nearby cities; this is where your comment comes in, since it'd be easier to then expand this to providing nearby units with temporary nuke protection.
Unfortunately, while RunCombatSim triggers for nukes like any other combat, the defender's info (both ID and unit number) are ALWAYS -1. There's no indication of who's being attacked, because nukes attack a map hex and not a unit/city. To make it worse, there's no X/Y being passed, so you can't even figure out the owner of the target hex THAT way, and since nukes are a bombardment unit their X and Y remain the coordinates of their launching city. So, I had to scrap this and just use their existing interception chance stub.
It'd be easy enough to do an after-the-fact cleanup, where if a city with building X has nearby fallout, then there's a X chance each turn that each hex's fallout is cleaned up and the improvement repaired. But this does nothing for the units caught in the open, which would be destroyed.
Dumb question on my part but what was the whole point behind Firaxis implementing the strategic resources game mechanic in the Civ series?
Obviously, I'm not a Firaxis developer. (You can tell, because I comment my code.) But the way I've always understood it, there are three main reasons:
1> Strategic resources limit the number of "offense" military units you can produce. Without them, a player could just keep churning out tanks until he had an unstoppable army, and then roll over everyone else. (This is exactly what'd happen in the earlier civ games.)
2> Most strategic resources are placed in less hospitable areas. Without them, there'd be little reason to settle near deserts, marsh, or tundra. But these are where the most Oil is found, along with many other resources. Hills, too; they're okay production normally, but hills are also where many of the best resources are found.
3> Rarity drives action. You hit the industrial era, where you were planning on putting factories in all of your cities. But wait, you don't have any coal. So, since you just can't afford to NOT have factories (the lack of production cripples you in a wonder race), this forces you to go get some instead of just sitting back in your comfortable little starting area for six millenia. To go get some, you might be able to find some small island to colonize, but more likely, you have to go to war.
Throw enough randomness into the system, and statistically speaking it's practically guaranteed that at least one resource will be like this. The first problem is that going from 6 strategic resources to 9 means that it's even more likely that one resource will suffer from rarity problems, even though I increased the number of spawns by a corresponding amount.
But the second problem is endemic to the core game: the randomness is PURELY random. The game doesn't say "okay, place 10 coal on the map, and they might all be out of your reach", which'd allow situation #3 above. It says "okay, go through each hill hex, and do a 1 in X chance that it has a Large coal on it." You have no way of knowing how many it'll end up with. Then the game places 35 Small deposits (modified for map size and abundance) around the map, but there's no control over how many of those would be on the types of terrains that could have coal, and even if they do then there's no guarantee the coal would be what's placed.
Think of it this way. Go get 30 six-sided dice; each represents one hill in the game. Roll them all; if you get a 1, it has a Coal on it. The math will tell you that you're most likely to have 5 coals on the map as a result. But each individual die is most likely to not be a 1, so the odds are actually not bad of getting significantly less. There's a 0.4% chance of NO coal (1 in 250), a 2.5% chance of 1 coal, and a 7.4% chance of 2 coal. That's more than a 10% chance of having far too little on the map to allow for option 3 above; you can't go get more if there isn't any more to get. And even if there IS an average number, then there's the chance that the five deposits might all be placed on the hills that aren't near you (assuming there are any hills near you in the first place); the game has a small amount of clustering logic, to discourage placing a new deposit too close to an old one, but that only checks within a radius of 3-4 hexes and won't affect empire-wide issues.
So what I did was, instead of rolling 30 dice, I roll 18 and then add 2 automatic successes to the result. Same average number at the end, but less variation, and there's now ALWAYS some on the map somewhere for you to go get if you come up short in your starting area. It still might be distributed badly, to where you wouldn't have any nearby, but you'd at least have the option of trading for it (or bribing a city-state for it, if they're placed right).
I did this for coal, neutronium, omnicytes, and iron in varying amounts. Neutronium, for instance, is almost entirely placed through this flat amount system, while iron just gets a slight boost but is mostly still random. Coal is in between those extremes. The question is whether I should do the same for the other strategics. (Note that water deposits are handled through a separate logic, I'm just talking about land resources here.)
Question: how well do the AIs utilize Great People?
Pretty well, actually. They build the Manufactories and stuff just fine, and I think the confusion you've seen was caused by their activated abilities (Culture Bomb and such). This is part of why I boosted the GP improvement yields; the player was rarely building those, and was mostly using activated abilities, while the AI would build the improvements. I wanted to make sure there wasn't a power disparity as a result.
One thing I've been toying with for a while is to have it so that if you work a tile containing a Great Person Improvement, you gain one Great Person point of the appropriate type. It's actually not hard to do this in Lua; if a city has an Academy within its area, then check to see if the tile is being worked, and if so, add one Scientist point to that city. Repeat for the other types.
But as usual, the AI would have no clue. So I've held off for now.