Hi,
Well, I don't know who is in charge of AI, so I will ask on the forums here. How does the AI currently determine the aggression level against another player based on diplomacy?
I looked at the code Mark sent out to me, and I didn't like the diplomacy stuff too much. I don't know what I was smoking when I cam up with that, but it must have been pretty good stuff. The code right now is kinda bulky, and hard to use. (I even made Laurent go GRRRR in there somewhere using the diplomacy code. )
Other than the code structure, which I will leave unmentioned, one thing that bothers me in particular is this diplomatic state deal. Right now, essentially every pair of civs has a value associated with it:
-1 if the civs are at war
0 if they are in peace
1 if they are in an alliance, and
-999 if they have not had contact yet.
Uhhh yeah. I don't like that for instance because it mixes the concept of agreements with diplomatic states.
So if this won't screw with AI too much, I think it would be in order to revise this thing some.
One idea is as follows: decouple the notion of diplomatic state from the notion of a diplomatic agreement further. Then, we would have only two possible states: war and peace. War is whenever two civs don't have a peace treaty going. The amount of aggression would then be determined by the attitude of the two civs towards each other. If the attitude is real low, then they go for each other's throats, if it is realy good, then they won't really fight each other even though there is no official peace agreement.
The other idea is to bind the diplomatic state to the treaties closer instead, that is, for each diplomatic state treaty, have a corresponding diplomatic state. Then, there would be peace, war, alliance, armistice, temporary cease-fire, and what-not.
And this is where the AI comes in. I think that in terms of AI, the first solution would be best. At any given point in time, it could then check: hey, am I at war with civ such-and-such or not?
o Yes - let's see my attitude towards it. Is it bad? Time to attack. Is it good? Well, I'll let 'em live some more. Maybe I should even offer an official peace treaty?
o No - let's see the other civ's attitude towards me. Is it bad? Maybe I should defend my territory, because hey could break peace. Is it good? Hey, how about I send them a gift?
Another reason I like the simplified war/peace idea, is that it still does not restrict you from coding all kinds of fancy treaties. For instance, I can make a cease-fire treaty, which makes peace between two civs, but keeps their attitudes real low, and expires real fast. Or I could make an alliance treaty which makes peace and boosts attitudes.
Finally, I like the first approach because it makes the game more flexible and configurable, IMO. Here, we can have a choice in each scenario what treaties to include and what to exclude. Maybe we want to have an ancient-times scenario with only the basic peace treaty, and none of the fancy modern diplomatic agreements. We can do that, whereas with the second approach, t would become harder.
What do you folks think? Also, if anyone can suggest anything else, feel free.
Well, I don't know who is in charge of AI, so I will ask on the forums here. How does the AI currently determine the aggression level against another player based on diplomacy?
I looked at the code Mark sent out to me, and I didn't like the diplomacy stuff too much. I don't know what I was smoking when I cam up with that, but it must have been pretty good stuff. The code right now is kinda bulky, and hard to use. (I even made Laurent go GRRRR in there somewhere using the diplomacy code. )
Other than the code structure, which I will leave unmentioned, one thing that bothers me in particular is this diplomatic state deal. Right now, essentially every pair of civs has a value associated with it:
-1 if the civs are at war
0 if they are in peace
1 if they are in an alliance, and
-999 if they have not had contact yet.
Uhhh yeah. I don't like that for instance because it mixes the concept of agreements with diplomatic states.
So if this won't screw with AI too much, I think it would be in order to revise this thing some.
One idea is as follows: decouple the notion of diplomatic state from the notion of a diplomatic agreement further. Then, we would have only two possible states: war and peace. War is whenever two civs don't have a peace treaty going. The amount of aggression would then be determined by the attitude of the two civs towards each other. If the attitude is real low, then they go for each other's throats, if it is realy good, then they won't really fight each other even though there is no official peace agreement.
The other idea is to bind the diplomatic state to the treaties closer instead, that is, for each diplomatic state treaty, have a corresponding diplomatic state. Then, there would be peace, war, alliance, armistice, temporary cease-fire, and what-not.
And this is where the AI comes in. I think that in terms of AI, the first solution would be best. At any given point in time, it could then check: hey, am I at war with civ such-and-such or not?
o Yes - let's see my attitude towards it. Is it bad? Time to attack. Is it good? Well, I'll let 'em live some more. Maybe I should even offer an official peace treaty?
o No - let's see the other civ's attitude towards me. Is it bad? Maybe I should defend my territory, because hey could break peace. Is it good? Hey, how about I send them a gift?
Another reason I like the simplified war/peace idea, is that it still does not restrict you from coding all kinds of fancy treaties. For instance, I can make a cease-fire treaty, which makes peace between two civs, but keeps their attitudes real low, and expires real fast. Or I could make an alliance treaty which makes peace and boosts attitudes.
Finally, I like the first approach because it makes the game more flexible and configurable, IMO. Here, we can have a choice in each scenario what treaties to include and what to exclude. Maybe we want to have an ancient-times scenario with only the basic peace treaty, and none of the fancy modern diplomatic agreements. We can do that, whereas with the second approach, t would become harder.
What do you folks think? Also, if anyone can suggest anything else, feel free.
Comment