[...] I was wondering if you could release a K-Mod 1.31 Debug DLL. I'm not sure how much work would be involved, so if you are too busy that's OK. Thanks!
Well, to be honest it would be very little work for me to do, but I'd rather not become committed to doing that little bit of extra work. I think it's best if other modders use the source code to make their own debug version if they are trying to get something working for their mod. -- But if you do find a bug in the K-Mod dll, I'd be happy to fix it - even if it doesn't actually effect K-Mod itself.
@Pleiadian, Thanks for your feedback. Regarding the AI's use of ICBMs, that certainly is something that needs a bit of work. So far, I've only made significant changes to the probability of the AI building nukes. I haven't really done anything with how they are used - and by the example you gave, it sounds like they really could use some more guidance... That's definitely something that I intend to look into at some point. (Not necessarily soon though.)
I'm not a coder but looking at CvTeamAI::AI_noWarAttitudeProb it seems to me that the vanilla code has been altered by BETTER_BTS_AI for the AI to, as you say, pursue its victories ruthlessly.
Personally, I don't like that change and I would revert it to the vanilla code, but if possible I'd like a confirmation of this before doing that.
Thanks.
You're more or less right; the effect of the noWarAttitudeProb thing was changed by the BBAI mod, and I've more-or-less kept their changes for that part of the AI. But old effects from the xml values have not been completely overruled; they still have a very significant effect.
-- To be honest, I think the original functionality was very poor; and the current functionality is only marginally better.
Here's how the system works, roughly speaking:
- Each turn, the each AI player does some checks to decide whether or not they should consider war. I don't mean war with a particular foe, but just any kind of war. The checks are mostly just random.
- If the above checks pass, the AI will evaluate the benefit of war with each other civ that they know; but each civ has a probability of being completely skipped over in these checks, randomly. The probability of being skipped over is determined by AI_noWarAttitudeProb.
- The AI will then start preparing war against whichever team was evaluated to be the best war target. If all teams were skipped, then they won't prepare war against anyone.
That's how the system works in the both original BtS AI and in K-Mod. But here's what's different in K-Mod:
- In the original BtS AI, AI_noWarAttitudeProb was simply given by the raw numbers found in the xml files. The BBAI mod changed this to subtract 30% to value for all targets if the AI was using the strategy called AI_VICTORY_CONQUEST4 - a strategy which basically means that the AI player is 100% focused on getting a conquest victory. K-Mod has kept this BBAI change.
- In the most recent version of K-Mod, the evaluation function for potential war targets which pass the attitude test have been completely rewritten, and the original code has been disabled. The old version (which was mostly original BtS code, but with some minor BBAI tweaks) basically just added up populations and power and some other arbitrary numbers. It didn't have any kind of consistent scale; it made no attempt at being a cost-benefit analysis; and the value it returned was always a positive number. By contrast, new version used in K-Mod v1.31 attempts to weigh up the potential spoils against the economic costs of training units and so on. It tries to do this in a balanced kind of way such that if the war is deemed to be unwinnable, or simply not worth the cost, then the evaluation function would return a negative number - and when this happens (when the value is negative), the target is excluded from consideration for war.
At this point it is worth mentioning that the target evaluation function also has some strong dependance on attitude towards the target - so that noWarAttitudeProb is not the only time attitude affects the probability of war.
Ok. So... with all that explained, there are just two more things I want to say:
Firstly, the reason I said I didn't like this system is that to me it seems mostly random and arbitrary. Ideally, the AI would consider war against everyone on every turn (and only decide to actually go through with the war plan if the value of war was positive). It seems silly to me that the AI can simply completely ignore the very best war targets just because it got a couple of unlucky random dice rolls. If the evaluation function worked correctly, it could include all of the necessary probabilities and personality adjustments required to just check every potential target every turn.
However, implementing this ideal from the current state of the code is not an easy task, and it isn't even something I intend to do (for various reason that I won't go into at the moment).
Secondly, the -30% from
AI_VICTORY_CONQUEST4 is completely necessary if you want the AI to ever be able to get a conquest victory. Otherwise, there will (almost) always be some team somewhere that the AI simply refuses to ever go to war with; and therefore conquest would be impossible. So if you want AI players to actually try to win the game, then there simply
must be some way to overrule the usual 0% chance of declaring war at
friendly.
Again, let me just reiterate that the 'noWarAttitudeProb' is not the only effect attitude has on war probability. Attitude is taken into account in the evaluation function itself; and so if you are friendly with a nasty-looking war-mongering civ who is en-route to a conquest victory, then it's actually pretty unlikely that you'll be their first target - unless you are a particularly tantalizing target.
The question of whether or not AI players
should try to get conquest victories is an entirely separate issue. I've made the decision that in K-Mod, the AI will indeed consider going for that kind of victory, and thus they need to be allowed to backstab their friends in order to get that victory.
Short version:
The xml values are not ignored, but they are no longer the only part of the no-war probability. If they were the only part of the no-war probability, then the AI would never be able to win a conquest victory. I don't intend to revert this change.