What would be the best way to make the AI less stupidly aggressive?

Afterburner

Warlord
Joined
Mar 13, 2005
Messages
140
I just started playing this again, and have been reminded about how much I hate how braindead the AI's aggression levels are.

* AI declares war because I don't have enough units built to satisfy what IT thinks I should have
* AI attacks my cities
* AI loses because the few units I have are more than enough to repel an AI invasion
* AI eventually sues for peace, with a warscore of 200-to-0.
* AI waits 15 turns or so before starting the whole business over again

Two of my neighbors in my current game have done this a dozen times each by now. It is ridiculous, and I am wondering if there is some way to change this behavior by editing an XML file.
 
Not via XML, but it's possible to do via lua. In Rising Tide, the logic by which AIs decide how much they like you and how they will engage you is modable in DiplomacyAI.lua, to be more precise, in the CalculateOpinion and CalculateApproach functions. The default functions only check for fear and respect with no regards for the actual situation on the map, so you could easily mod in a strength check to make them not attack you if they're extremely weak for example.

At least in theory this should work, but I never really tested how well these values work out in an actual game and whether they're taken as "musts", or whether they're just a consideration for the AI system that is hardcoded in the C++ code which isn't accessible.
 
Not via XML, but it's possible to do via lua. In Rising Tide, the logic by which AIs decide how much they like you and how they will engage you is modable in DiplomacyAI.lua, to be more precise, in the CalculateOpinion and CalculateApproach functions. The default functions only check for fear and respect with no regards for the actual situation on the map, so you could easily mod in a strength check to make them not attack you if they're extremely weak for example.

At least in theory this should work, but I never really tested how well these values work out in an actual game and whether they're taken as "musts", or whether they're just a consideration for the AI system that is hardcoded in the C++ code which isn't accessible.
Thanks! Is there a quick and dirty lua tutorial or guide somewhere? I have never heard of lua before now, so I haven't the faintest idea how to mess with it. But I'm a quick learner if I have a good guide.
 
I learned the basics by watching some Youtube Tutorials and then went on to do some simple "Learning by doing" as needed to work stuff into my mods. Don't remember which videos I watched, but Lua isn't a very complicated language, so there probably isn't that much a teacher could do wrong if you're just looking for the basics.
 
Top Bottom