From what I know, all that's needed to make a new personality attribute is to make it in strategies.txt, and make a personality in personalities.txt use it in the line discovery: name of discovery thing, but I'm not sure.
At any point in the game what an AI civ does is determined by the strategic state and diplomatic states of it's leader. These states are in turn determined by the personality attributes, defined in personality.txt, which are used to load various strategies. They also determine the leader's diplomatic states, although what's going on here is not so clear. For example, the Stalin personality has the following attributes which load the associated strategies:
Attribute Strategy
Exploration: Minimal EXPLORE_NEAR
Expansion: Average SETTLE_COMPACT + CAREFUL_START
Discovery: Military MILITARIST_DEFAULT
Conquest: Agressive (sic) ?
Trustworthiness: Chaotic ?
Alignment: Evil ?
Exploration: Minimal EXPLORE_NEAR
Expansion: Average SETTLE_COMPACT + CAREFUL_START
Discovery: Military MILITARIST_DEFAULT
Conquest: Agressive (sic) ?
Trustworthiness: Chaotic ?
Alignment: Evil ?
I don't really know what they're on about, but I think it means that there's something going on that we can't see, so from now on I'll just talk about strategic states. (And there's actually only three diplomatic states anyway: DIPLOMACY_DEFAULT, DIPLOMACY_PROVOKE_WAR, and DIPLOMACY_MAKE_FRIEND, [although Dale later defined some new ones].)
Each of the main XXX_DEFAULT strategies is an example of a strategic state and you can see what a strategic state does by examining them in conjunction with the explanation of strategies.txt provided in the Apolyton Modification: Data Files Definitions section.
But it is important to realize that none of these DEFAULT strategies is ever in itself an active strategic state. The base active strategic state of, e.g., the Stalin personality is obtained by embedding the EXPLORE_NEAR, SETTLE_COMPACT, and CAREFUL_START strategies into MILITARIST_DEFAULT. (This is done with the SLIC ConsiderStrategicState function.) The point is that some of the data in the DEFAULT strategies is never used; it is always overwritten by the corresponding data in the Exploration, Expansion and Start strategies. The resulting strategic state is the one that is used by the Stalin personality for most of the game. There are then other strategies that are embedded into this state in special game situations. The most interesting are the war strategies: STRATEGY_SIEGE, STRATEGY_ATTACK, and STRATEGY_DEFEND.
So that's a very concise description of how the game engine determines the active strategic states of the AI players.
Any programming task has two highly interdependent entities to consider: the data and the program. For all it's faults, CTP2 has provided us with the means to modify both of them. We have access to much of the AI's data and we have SLIC functions that allow us to change the way in which it uses this data.
First consider the data. Clearly, you can change the active strategic states of the AI players by just changing the data in strategies.txt and the other connected files. Here's a couple of suggestions:
(1) Get rid of the Wimps: in civilisation.txt replace the Ghandi, Nader, and Medici personalities with the more warlike Stalin and Caesar ones.
(2) Experiment with Goals.
But now for the bad news. Just changing the data will not, IMHO, result in any really significant improvement in the AI's behaviour. To do that you have to learn SLIC and modify the program itself.
That's as far as I got.
What I want to do is create two different militarist civs one that uses fascism and one that uses communism.
// Government GOVERNMENT_ECOTOPIA
// Government GOVERNMENT_VIRTUAL_DEMOCRACY
// Government GOVERNMENT_DEMOCRACY
Government GOVERNMENT_TECHNOCRACY
// Government GOVERNMENT_CORPORATE_REPUBLIC
Government GOVERNMENT_COMMUNISM
Government GOVERNMENT_THEOCRACY
Government GOVERNMENT_MONARCHY
Government GOVERNMENT_TYRANNY
// Government GOVERNMENT_VIRTUAL_DEMOCRACY
// Government GOVERNMENT_DEMOCRACY
Government GOVERNMENT_TECHNOCRACY
// Government GOVERNMENT_CORPORATE_REPUBLIC
Government GOVERNMENT_COMMUNISM
Government GOVERNMENT_THEOCRACY
Government GOVERNMENT_MONARCHY
Government GOVERNMENT_TYRANNY

About Adding New Strategies
You can add as many new strategies as you want, but you have to learn at least a bit of SLIC to get the AI to use them. Bear in mind that a strategy can be almost any subset of parameters from a default strategy. The Goal parameters are especially fun: they control how the AI moves it's units around the map. For example, I've been playing with the WW2 scenario and defined two new strategies for the Germans:
STRATEGY_WW2_GERMAN_LAND_GOALS{
GoalElement { Goal GOAL_SEIGE Priority 995000 MaxEval 25 MaxExec 15 }
GoalElement { Goal GOAL_ATTACK Priority 805000 MaxEval 25 MaxExec 25 }
GoalElement { Goal GOAL_HARASS Priority 755000 MaxEval 25 MaxExec 10 }
GoalElement { Goal GOAL_HARASS_CITY Priority 730500 MaxEval 12 MaxExec 3 }
GoalElement { Goal GOAL_BOMBARD Priority 807000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_BOMBARD_UNIT Priority 810000 MaxEval 5 MaxExec 2 }
}
STRATEGY_WW2_GERMAN_AIR_GOALS{
GoalElement { Goal GOAL_SEIGE Priority 810000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_ATTACK Priority 805000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_HARASS Priority 755000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_HARASS_CITY Priority 730500 MaxEval 12 MaxExec 3 }
GoalElement { Goal GOAL_BOMBARD Priority 995000 MaxEval 25 MaxExec 25 }
GoalElement { Goal GOAL_BOMBARD_UNIT Priority 990000 MaxEval 25 MaxExec 25 }
}
GoalElement { Goal GOAL_SEIGE Priority 995000 MaxEval 25 MaxExec 15 }
GoalElement { Goal GOAL_ATTACK Priority 805000 MaxEval 25 MaxExec 25 }
GoalElement { Goal GOAL_HARASS Priority 755000 MaxEval 25 MaxExec 10 }
GoalElement { Goal GOAL_HARASS_CITY Priority 730500 MaxEval 12 MaxExec 3 }
GoalElement { Goal GOAL_BOMBARD Priority 807000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_BOMBARD_UNIT Priority 810000 MaxEval 5 MaxExec 2 }
}
STRATEGY_WW2_GERMAN_AIR_GOALS{
GoalElement { Goal GOAL_SEIGE Priority 810000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_ATTACK Priority 805000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_HARASS Priority 755000 MaxEval 5 MaxExec 2 }
GoalElement { Goal GOAL_HARASS_CITY Priority 730500 MaxEval 12 MaxExec 3 }
GoalElement { Goal GOAL_BOMBARD Priority 995000 MaxEval 25 MaxExec 25 }
GoalElement { Goal GOAL_BOMBARD_UNIT Priority 990000 MaxEval 25 MaxExec 25 }
}
Code:
if (tmpPlayer == 1) { // If current player is German ConsiderStrategicState(tmpPlayer, 9900, StrategyDB(STRATEGY_WW2_GERMAN),-1,-1,-1); tacticalGoals=Random(100); if (tacticalGoals<66) { ConsiderStrategicState(tmpPlayer, 9999, StrategyDB(STRATEGY_WW2_GERMAN_LAND_GOALS),-1,-1,-1); } else{ ConsiderStrategicState(tmpPlayer, 9999, StrategyDB(STRATEGY_WW2_GERMAN_AIR_GOALS),-1,-1,-1); }
Here's another example. In the standard game the AI will rarely use STRATEGY_SEIGE. This is the one where it prioritizes capturing cities. But you can force it to use this strategy when it's at war with you with:
Code:
if (IsAtWarWithHuman(player[0])) {//if at war, take cities SendTroopsToTheater(); ConsiderStrategicState(Player[0], 1500, StrategyDB(STRATEGY_SEIGE),-1,-1,-1); }
For all it's faults, this is a great game for modders.
Leave a comment: