Is it possible to mod AI Diplomacy and/or the tactical AI?

Can Not

Chieftain
Joined
May 23, 2004
Messages
26
I am aware that there are 2 issues with the AI. First, it can't handle long term military situations after 1UPT and that the AIs/Diplomacy is bad. Are there any mods out that fix this, and are these things that can be "fixed" at this time?
 
Not really.

Basically, we just can't modify relationships between ANY major empires, whether they're AI or human. We can only modify the relationships between major empires and minor ones (city-states) through the Influence system. This limitation effectively cripples any attempt to alter the diplomacy AI. We've got a little more freedom on the tactical side, but not nearly enough.

There are basically four sorts of things we can do to change AI behavior, in general:
1> Modify Flavor values to make the AIs see certain things as more valuable than it used to. This doesn't help with the things you've asked for.

2> Override specific AI behaviors, through pop/push mission commands or DoTask commands. For instance, you can force the AI to move a certain unit into enemy territory, even if it doesn't want to, because YOU know that that unit has some new extra effect when in enemy territory. Or, you can force the AI to slot a certain number of a new type of specialist that adds Happiness, because there's no other way to convince the AI that that specialist type is worth anything. This one could, in theory, be used to improve the tactical AI, but realistically there's just no way to integrate these sorts of overrides well.

3> Selectively and temporarily override the AI's construction actions by locking out undesirable alternatives, through things like the CityCanConstruct() Lua event. Again, doesn't really apply to diplomacy or tactics, but this one has quite a bit of potential for other mods.

4> Add a new layer on top of the existing game, with completely artificial behaviors and effects that have no connection to the existing game's AI. For example, the religious system in my own Mythology mod is purely new, and so I coded all of the AI behaviors in relation to that system myself. Since it's not even remotely tied to the existing game AI, there's no conflict.

As you can see, most of these won't really help with Diplomacy. To really make the sorts of changes we want, we'd probably need the DLL. The reason I qualify that with "probably" is that since Gods and Kings adds some basic espionage systems, it's easily possible that the developers will add additional diplomacy-related Lua functions to the expansion, and if so, we might finally have the tools needed to modify empire-on-empire relations.
 
I've been thinking about this issue...

Keep in mind, I lack a lot of knowledge of game mechanics and programming.

It seems to me there are several things that the player can actively do to provoke the AI nations... declare war, park units on its borders, act maliciously in various ways.

The means is not of great importance... the fact is that all of these actions generate some sort of positive or negative response from the AI civ in question.

I assume, somehow, the game engine produces some numbers from all these factors and arrives at some number, positive or negative, that represents the relationship between the AI and the player or other AI Civs. This would be somewhat similar to the City State values.

So let's say factors A, B, and C contribute numbers to determine the AI relationship to the player or other Civ.

so: A+B+C = X where X is the numerical value assigned to the relationship.

What I would like to see modded in, is somehow another factor, D, can be assigned a value and added to the equation similar to how it operates with Civ IV.

So for instance A="different religion" = -30; B="declaration of Friendship"= +25 and C= "war with friendly minor"=-10; we would get a value of -15.

I would like to see D="influence input by modder"=-30 be factored in as well...so the relationship would be at -45, for instance.

Instinctively, I feel that such a mod ought to be able to be created via the modding tools. The value D is simply an input and does not arise from the game engine... it is inserted into the equation. Since we, as players, can influence AI attitude by various means during the course of the game, we already generate some sort of numerical values for AI influence. It ought to be moddable to insert some sort of "faux" values prior to the first turn which would affect the initial relations... during the course of loading a mod... perhaps in the form of pregame declarations of war or some other mechanism by which the player is already able, via game mechanics, to influence his relations with the AI. We could likewise influence AI/Ai civ relationships via currently available cheats that allow players to switch between civs... so all this could be used in the loading process to create a pregame attitude value.

Summarized:
- players can already influence AI Civ relations
- by modding, we are adding a variable to game generated numbers, not reprogramming core elements.
- this fact could create a window of opportunity for modder to manipulate influence by allowing them create mechanisms to input values affecting influence

Or I could be talking out of my #@!& :).
 
What about how gifting a unit receives only 1 influence point with a CS? Seems the same with AIs. I consider that broken.
 
Back
Top Bottom