 |
|  |
 |
|  |
 |
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:17
|
|
I read the interview, although i did not went further in the thread.
It really is explanatory.
Still i have some question. But i am aware the simplicity of them. Any experienced AI modder can help.
So far only 2 of them.
1) Richard Explain some strategies like defense, careful and agressive start. Still what about the major 6: Default, Scientist, militaristic, Economic, Ecotopian and Diplomatic. When they are enacted? Seems self-explanatory, but it inst. First i thought it had something to do with the civ or the personality of the leaders. I looked over the files and nothing to connect!
So, Could someone explain me when those strategies are triggered?
2) Same thing about the STRATEGY_ATTACK, STRATEGY_SIEGE and STRATEGY_DEFEND. When are they triggered? They just complement specific parts of the major ones in specific situations?
Last edited by Pedrunn on 01-03-2002 at 04:23
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:17
|
|
quote: Originally posted by Pedrunn
I read the interview, although i did not went further in the thread.
It really is explanatory. |
The rest of the thread contains some interesting stuff as well, when you have the time you should read that as well (if you weren't planning on doing so already).
quote: 1) Richard Explain some strategies like defense, careful and agressive start. Still what about the major 6: Default, Scientist, militaristic, Economic, Ecotopian and Diplomatic. When they are enacted? Seems self-explanatory, but it inst. First i thought it had something to do with the civ or the personality of the leaders. I looked over the files and nothing to connect!
So, Could someone explain me when those strategies are triggered? |
I'm afraid I don't know the details of this from the top of my head, but I'm fairly certain they're related to the personalities.txt file. Wes or Dave or someone might know more about this...
quote: 2) Same thing about the STRATEGY_ATTACK, STRATEGY_SIEGE and STRATEGY_DEFEND. When are they triggered? They just complement specific parts of the major ones in specific situations? |
We don't know exactly when they are triggered (yes, they complement the major strategies in specific situations). We've run some tests for the MedMod in the past but the results were inconclusive. Personally I'm in favor of disabling those strategies altogether and adding a bunch of new ones, which can be controlled from SLIC. This way we would know and understand exactly what is going on and thus make a much better AI. I don't have too much time to play around with it myself though...
|
|
|  |
 |
|
WesW
|
 |
Florence, Al., USA
Jan 1970 time: 23:17
|
|
I agree with Peter regarding the Attack, Defend and Seige strategies. Either they are not used at all, or only for a few turns immediately after war is declared.
One good way to tell would be to alter the unit readiness levels. When I first started the Medpack II, I set the readiness levels to alert for the personality types, and to war for the 3 war strategies. If I remember correctly, I never did see the AIs at war readiness. I set the readiness settings to war for the personality types before long since they needed to be at war to fight barbarians in the early game. (There was a strategy setting in Ctp1 which only lasted for the first 100 or so turns, and had a default setting of war for everyone, along with increased expanison and exploration settings.)
In both games, the theory seemed to be to set up a "code structure", for lack of a better term, which contained code for all of the "neat ideas" that the designers wanted to try out. Then when they started play-testing, they altered, added to, or cut out pieces of this structure as they went along. Unfortunately, there does not seem to have been someone tasked with making sure that these changes did not conflict with or mess up other parts of the code.
In short, there was no Sid Miere or Brian Reynolds who built the game from the ground up as a labor of love and kept a picture of the overall game in his head (or on his desk).
So, in closing, just because the code is there does not mean it is used or that the AI will know how to deal with it should you activate it using slic. This is what worries me in activating the terraforming code that we are debating in another thread.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:17
|
|
Hi, Pedrunn
quote:
First i thought it had something to do with the civ or the personality of the leaders. I looked over the files and nothing to connect!
|
You were right first time. In civilisation.txt, each civ can have either a male or female leader and in both cases the leader is assigned a personality as in:
PHP:
GREEK #2
{
CIV_LEADER_NAME GREEK_LEADERM_NAME
CIV_LEADER_NAME_FEMALE GREEK_LEADERF_NAME
CIV_PERSONALITY_MALE "PERSONALITY_CEASAR"
CIV_PERSONALITY_FEMALE "PERSONALITY_TELLER"
Suppose that the game has decided that the Greek leader is male so that it assigns him the CEASAR personality. It then constructs the strategy he's going to use based on the data in personalities.txt:
quote:
PERSONALITY_CEASAR {
Exploration: Medium
Expansion: Maximum
Discovery: Military
Conquest: Agressive
Trustworthiness: Lawful
Alignment: Neutral
|
The last three flags are diplomacy things and about all we know about them is:
quote:
// This describes the liklihood that the AI will attack. This can
// also be considered the disposition of the personality.
Conquest: Agressive, Neutral, Passive
// This describes how likely the AI will be to violate agreements
// and follow through on threats. It also specifies how the
// regard of an AI will be changed by the dishonest actions of
// others.
Trustworthiness : Chaotic, Neutral, Lawful
// This describes in general terms the methodology used by an AI
// to accomplish its goals and whether or not the AI cares if its
// actions cost the regard of other empires. Evil actions might
// include killing settlers, the use of slavery and the first
// strike launch of nuclear weapons. The regard consequences of
// an evil act will be less for an evil empire than a neutral or
// good one.
Alignment : Evil, Neutral, Good
|
The programmers had plans to expose more of the diplomacy system but the company dropped the game before they could do it.
The first three flags, though, link directly to strategies.txt. The Discovery one is basic: it means that the Greek leader will essentially pursue the MILITARIST_DEFAULT strategy. But that's not all, if this was all there was to it the AI would only have 5 strategies: STRATEGY_SCIENTIST_DEFAULT, STRATEGY_MILITARIST_DEFAULT, STRATEGY_ECONOMIC_DEFAULT, STRATEGY_ECOTOPIAN_DEFAULT, and STRATEGY_DIPLOMATIC_DEFAULT.
(BTW, STRATEGY_DEFAULT is the data that initializes the game for a human player. When you start the game the computer has to have some data to go by, this is where it comes from. It's also inherited by the Barbs.)
So the other two flags, Exploration and Conquest, are used to refine these 5 basic strategies. How? Well, a strategy is just a bunch of data and Locutus or Lou Wigman (who I believe has years of experience in DataBase Programming) can probably describe this better than me, but here goes.
As Richard explained,
quote:
In the personalities.txt file (again) each personality has a Exploration: setting. If Exploration: Minimal is set, then
STRATEGY_EXPLORE_NEAR is used, Exploration: Medium loads STRATEGY_EXPLORE_FAR and STRATEGY_EXPLORE_WIDE is loaded by
Exploration: Wide.
If the Exploration: Wide or Maximum [? I think he meant Medium] are set, then STRATEGY_AGRESSIVE_START is used, otherwise STRATEGY_CAREFUL_START is loaded, btw.
|
In the above example, then, the game will initialize the Greeks with the MILITARIST_DEFAULT strategy and then load STRATEGY_EXPLORE_WIDE, STRATEGY_SETTLE_COMPACT, and STRATEGY_AGRESSIVE_START. The data in these strategies 'overwrite' (this is a metaphor, it's probably some sort of database union operation) the corresponding data in STRATEGY_MILITARIST_DEFAULT so that this latter overwritten data is in fact never used. After the overwriting, the resulting set of data constitutes the Greek's current strategic state.
The same applies to the other personalities. It seems to be a rather odd way of doing this (there's only 9 personalities, so they could have just had 9 default personality strategies) but it allows for some extensibility. In the Alex scenario, Tony Evans defined three new personalities:
PHP:
PERSONALITY_ALEXANDER1 {
Exploration: Minimal
Expansion: Minimum
Discovery: Military
Conquest: Passive
Trustworthiness: Lawful
Alignment: Good
StrongGreeting DIP_GREETING_FIRST_FOREIGN_1
WeakGreeting DIP_GREETING_FIRST_FOREIGN_2
Description PERSONALITY_CEASAR_DESCRIPTION
ThreatFollowThrough 0.9
}
PERSONALITY_ALEXANDER2 {
Exploration: Minimal
Expansion: Minimum
Discovery: Military
Conquest: Neutral
Trustworthiness: Neutral
Alignment: Neutral
StrongGreeting DIP_GREETING_FIRST_FOREIGN_3
WeakGreeting DIP_GREETING_FIRST_FOREIGN_3
Description PERSONALITY_DEGAULLE_DESCRIPTION
ThreatFollowThrough 0.7
}
PERSONALITY_ALEXANDER3 {
Exploration: Medium
Expansion: Average
Discovery: Military
Conquest: Agressive
Trustworthiness: Chaotic
Alignment: Evil
Description PERSONALITY_STALIN_DESCRIPTION
StrongGreeting DIP_GREETING_FIRST_FOREIGN_4
WeakGreeting DIP_GREETING_FIRST_FOREIGN_4
ThreatFollowThrough 0.5
}
and then assigned them to the scenario's various AI players. (In a somewhat devious way: you have to go to the scenario's civ_str.txt to find out that, e.g., Australia is actually the Persian Empire.)
All the other strategies in strategies.txt are loaded in special situations where again they overwrite the data in the AI player's current strategic state and constitute a transition to a new strategic state. Unfortunately, as Locutus mentioned about the war strategies, we really don't have any idea of what triggers these transitions.
There is one comment that Richard made about the defense strategies:
quote:
At the beginning of each turn, the Maximum Threat for an AI is computed, and as the threat increases, the minimum garrison in each city increases. Essentially this is a way to make sure the AI protects its cities with more units when things get more dangereous later in the game. If you add a new strategic state that is triggered every turn (with a priority > 1000 or so) which redefines the garrison counts, then you can use your own system. I forget the actual threat levels and don't have the code available right now to check when each level is invoked.
|
The problem here is that I don't think there's any SLIC function that returns this "Maximum Threat" so we'd have to write our own. Assuming we did this, we could then put whatever data we wanted into those defense strategies and put in a handler like:
code:
HandleEvent(NextStrategicState) 'LoadDefenseStrategies' pre {
int_t MaxThreatVal;
MaxThreatVal=GetThreatTo(player[0]);
if (MaxThreatVal<100) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_NONE),1500);
}
elseif (MaxThreatVal<300) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_VERY_LOW),1500);
}
elseif (MaxThreatVal<500) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_LOW),1500);
}
elseif (MaxThreatVal<700) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_MEDIUM),1500);
}
elseif (MaxThreatVal<900) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_HIGH),1500);
}
else{
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_VERY_HIGH),1500);
}
}
But we're not stuck with using the strategies that are already there in strategies.txt. Joe's document "AI Modification via SLIC" contains what is actually a good (although very condensed) description of how we can use SLIC to get the game to use our own strategies. I think Martin G and player1 did some stuff along these lines but I can't remember where.
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:17
|
|
quote: Originally posted by WesW
I agree with Peter regarding the Attack, Defend and Seige strategies. Either they are not used at all, or only for a few turns immediately after war is declared. |
This is good idea. The Ai must be more agressive after declared war. Too bad we are not certain about that and how long it last. Maybe a slic to control that would be good.
quote: Originally posted by Peter Triggs
Suppose that the game has decided that the Greek leader is male so that it assigns him the CEASAR personality. It then constructs the strategy he's going to use based on the data in personalities.txt: |
I got that from Martins explanation. But can i add new personalities? and remove old ones? If so, do we have to do somethimg before besides change the CIV_PERSONALITY in civilisation.txt.
quote: Originally posted by Peter Triggs
The programmers had plans to expose more of the diplomacy system but the company dropped the game before they could do it. |

quote: Originally posted by Peter Triggs
(BTW, STRATEGY_DEFAULT is the data that initializes the game for a human player. When you start the game the computer has to have some data to go by, this is where it comes from. It's also inherited by the Barbs. |
You mean the Barbs change Strategy over the time?
quote: Originally posted by Peter Triggs
code:
HandleEvent(NextStrategicState) 'LoadDefenseStrategies' pre {
int_t MaxThreatVal;
MaxThreatVal=GetThreatTo(player[0]);
if (MaxThreatVal<100) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_NONE),1500);
}
elseif (MaxThreatVal<300) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_VERY_LOW),1500);
}
elseif (MaxThreatVal<500) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_LOW),1500);
}
elseif (MaxThreatVal<700) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_MEDIUM),1500);
}
elseif (MaxThreatVal<900) {
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_HIGH),1500);
}
else{
ConsiderStrategicState(player[0],StrategyDB(STRAT
EGY_DEFENSE_VERY_HIGH),1500);
}
}
|
And what about the hard-coded defense change. It became unusefulwith thiscode. As i compare it from Richard Meyer Explanation, they both work exacly the same.
quote: Originally posted by Peter Triggs
But we're not stuck with using the strategies that are already there in strategies.txt. . I think Martin G and player1 did some stuff along these lines but I can't remember where. |
I have seen those threads
quote: Originally posted by Locutus
Personally I'm in favor of disabling those strategies altogether and adding a bunch of new ones, which can be controlled from SLIC. This way we would know and understand exactly what is going on and thus make a much better AI. I don't have too much time to play around with it myself though... |
Agreed. But only by disabling what was written by the programs we can achive that.
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:17
|
|
I am making some modmaking but i have bumped into a problem.
The AI isnt building enough caravans and has negative gold imput!!!
How can i change the AIs atitude towards trade?
And can someone please write a code for me?
I want to change the the AIs strategy to something like STRATEGY_GOLD_RUSH everytime the gold imput is negative or (if not possible) when AI gold reserve reachs zero.
Last edited by Pedrunn on 04-03-2002 at 18:36
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:17. Apolyton Time is 00:17. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|