Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > Strategies and Goals
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
MarkG
Guest

Not Yet
time:
Exclamation  Old Post 01-12-2000 02:23
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Strategies and Goals Support Apolyton, buy Call to Power 2

a small analysis on the goals.txt and the strategies.txt from an answer of Azmel to a mail of mine


For every goal type record in Goals.txt, there is a corresponding entry in one or more of the strategy records in strategies.txt. Each GoalElement specifies (for that particular strategy) what the priority is for performing a particular goal relative to other goals. The priority is sometimes also refered to as the raw priority. Before any units are assigned to a goal, all goals of a particular type are sorted based on their raw_priority modified by any positive or negative bonuses for that goal type from it's Goals.txt record. Only the top "MaxEval" number of goals are ever matched to units. The MaxEval number can be absolute (ie. the best three goals) or relative (ie. two per city, or best four goals if we have two cities). If you increase the MaxEval attribute, you increase the pool of goals that the AI will consider, and usually improve intelligence at the expense of processing speed. If MaxEval is set to 0, then no goals of this type will be performed. The MaxExec field limits the number of a particular goal type that will be performed. This lets you consider the 10 best seige goals, but only actually seige the best two cities so that your troops don't get too spread out.

In general, goals execute from highest to lowest priority. The defense goal type usually has the highest priority so that units will be assigned to defend cities first, and then assigned to seige cities and perform other goals. For example, if the GoalElement for GOAL_ATTACK has a higher priority than for GOAL_SEIGE, then AI units will first try to attack enemy armies, and then with any remaining unassigned units, try to seige enemy cities. However, if two goals have very close raw priorities, then the match priority becomes more important. The match priority is computed based on how good a match a particular army is for a specific goal. In general, the closer an army is to a goal, the better it's match. That way even when seige goals have a higher raw priority, an army right next to an enemy unit will attack it rather than move 20 cells to seige a city.

Hope this brief explaination helps. Although it's a complicated system, with a little work it should be possible for anyone interested enough to tweak and customize.


Wes, forget the units and wonders, get into these two files!!

colorme is offline colorme
Warlord

Nov 2000
time: 05:14
Post  Old Post 01-12-2000 05:33
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Increase Your PM Length


I've tried modifying some of these goal priorities. Even set the GOAL_SEIGE to like a million or so. It didn't help one bit.

perhaps, the 2nd aspect of azmel's comment, i.e. the match priority over-riding the raw priority might be skewing the AI into not attacking cities (which is what we want).

In that case, seems like we need to have the AI have ready stacks of tons of offensive units.

colorme is offline colorme
Warlord

Nov 2000
time: 05:14
Post  Old Post 01-12-2000 05:34
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Browse Apolyton AD-FREE


Mark,

Can you also ask him how to improve the transportion of units, and the other AI problems we've mentioned?

You seem to have his ear

WesW is offline WesW
CTP1/2 Modification Site Admin
Florence, Al., USA
Jan 1970
time: 23:14
Post  Old Post 01-12-2000 07:26 Visit WesW's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Get a bigger avatar today!

Thanks, Mark. I will try and sort this out, but I am sure there are many people here who can do as well or better than I can at deciphering the code.
Below I have posted the code pertaining to the most important goals. I believe I understand the part about MaxExec and MaxEval, and the assigning of units and the strategies.txt part, so that leaves the goals.txt part to nail down.

What I would really like is if someone would go through each flag, and explain 'exactly' what it pertains to and does, and how the negative sign affects the AI's decision. 90% of the time, these are pretty self-evident, but it's that other 10% that always seems to be the crucial part.

GOAL_DEFEND {
ExecuteIncrementally
NoTransport

SquadClass:CanAttack
SquadClass:CanDefend

TargetType:City
TargetOwner:Self

Execute ORDER_MOVE

ThreatBonus 1000
EnemyValueBonus 0
AlliedValueBonus 1000
PowerBonus -100
DistanceToHomeBonus 0
DistanceToEnemyBonus 0
ChokePointBonus 250
UnexploredBonus -999999
ObsoleteArmyBonus -500
TreaspassingArmyBonus 0

ThreatenType:None
ThreatenBonus 0

ForceMatch efensive
}

GOAL_SEIGE {
RallyFirst

SquadClass:CanAttack
SquadClass:CanDefend
SquadClass:HasZoc
SquadClass:CanCaptureCity

TargetType:City
TargetOwner:HotEnemy

Execute ORDER_ATTACK

ThreatBonus 500
EnemyValueBonus -250
AlliedValueBonus 1000
PowerBonus 500
DistanceToHomeBonus 0
DistanceToEnemyBonus 0
ChokePointBonus 500
UnexploredBonus -999999
ObsoleteArmyBonus 100
TreaspassingArmyBonus 0

ThreatenType estroyCity
ThreatenBonus 5000

ForceMatch:Offensive

TargetProtectionWonder WONDER_THE_FORBIDDEN_CITY
}

GOAL_ATTACK {
RallyFirst

SquadClass:CanAttack

TargetType:AttackUnit
TargetType:SpecialUnit
TargetOwner:HotEnemy

Execute ORDER_ATTACK

ThreatBonus 100
EnemyValueBonus -250
AlliedValueBonus 1500
PowerBonus 500
DistanceToHomeBonus 0
DistanceToEnemyBonus 0
ChokePointBonus 50
UnexploredBonus -999999
ObsoleteArmyBonus 100
TreaspassingArmyBonus 0

ThreatenType estroyCity
ThreatenBonus 5000

ForceMatch:Offensive

TargetProtectionWonder WONDER_THE_FORBIDDEN_CITY
}

GOAL_SALLY {
IsSally
NoTransport

SquadClass:CanAttack

TargetType:AttackUnit
TargetOwner:HotEnemy

Execute ORDER_ATTACK

ThreatBonus 0
EnemyValueBonus 0
AlliedValueBonus 0
PowerBonus 100
DistanceToHomeBonus 0
DistanceToEnemyBonus 0
ChokePointBonus 100
UnexploredBonus -999999
ObsoleteArmyBonus 0
TreaspassingArmyBonus 0

ThreatenType:None
ThreatenBonus 0

ForceMatch:Offensive
}

GOAL_ESTABLISH_EMBASSY {
NeedsEscort

SquadClass:Special

TargetType:City
TargetOwner:Ally
TargetOwner:Neutral
TargetOwner:NoContact

Execute ORDER_ESTABLISH_EMBASSY

// just want to establish embassy at closest city.
ThreatBonus 0
EnemyValueBonus 0
AlliedValueBonus 0
PowerBonus 0
DistanceToHomeBonus -1
DistanceToEnemyBonus 1
ChokePointBonus 0
UnexploredBonus -1500
ObsoleteArmyBonus 0
TreaspassingArmyBonus 0

ThreatenType:None
ThreatenBonus 0

ForceMatch:Special
}

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:14
Post  Old Post 01-12-2000 18:36
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Suffering from ads?

So that's what they've done with those incomprehensible priorities from the old AIP files. It looks a lot clearer.

The game is not yet out in the UK so I won't be able to get it for another week or two. I'd really appreciate it if someone would e-mail me the most important AI files; this looks very interesting.

Thanks,

Peter

BTW: Colorme, is it possible that you've just got the AI trying to evaluate GOAL_SEIGE's, rather than trying to execute them?

colorme is offline colorme
Warlord

Nov 2000
time: 05:14
Post  Old Post 02-12-2000 10:51
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase the size of your Attachments


Peter,

I left MaxEval unchanged at 25 or so, and played around with MaxExec (10,5,3, etc.).
Didn't seem to help.

Daniel Frappier is offline Daniel Frappier
Prince
Montreal, Quebec, Canada
Jan 1970
time: 05:14
Post  Old Post 01-12-2000 23:08
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton buy from Amazon

WesW and other Mod-Maker,

I have no idea if that is a well known fact or not so forgive me if it is but to increase the performance and the combat capacity of the AI the first thing on you're todo list should be to increase the Production, Gold and Science bonuses it gets.

As it is the AI gets 0 (that's right ZERO) bonus on those 3 things onless it's already 25% weaker than the human player (which means that it's already dead aniway).

The production bonus is particularly important because the AI can do much less than a human with the same ressources and it doesn't have much left to build an offensive army with.

Why as Activision shipped the game with those difficulty settings is beyond me, at first i tought the AI was very bad but once the settings are correctly set it's...still bad but much better.

Also what I would call the Gold Bug (the player end up with so much that it's hard to spend it all) is partly because of game balance and partly because they didn't set the Wages Right, medium wages is 4 instead of 12 and maximum wages is 6 gold instead of 20, as it is you should always pay you're peoples maximum wages because it cost almost nothing and it gives you extra happiness.

I am looking forward to playing the Med mod.

WesW is offline WesW
CTP1/2 Modification Site Admin
Florence, Al., USA
Jan 1970
time: 23:14
Post  Old Post 02-12-2000 15:06 Visit WesW's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton

In Ctp2, they took the route of handicapping the human, rather than gifting the AI. Here are the lines from the DIffDB that do that. Production is not included in this, but production was actually the thing the AIs did best in Ctp1, where they were handicapped vs. the human in the initial settings.

MAX_HUMAN_ADVANCES--------3
MAX_AI_ADVANCES ----------6
HUMAN_SCIENCE_BONUS--------0.4 # % amount to add to advance cost for the player
HUMAN_FOOD_BONUS-------- -0.2 # % amount to add to food collected for the player

Btw, I have seen a couple of players comment on the gold slider being wrong. Please tell me what you saw that revealed this, so that I can try and set it to what it should be.

Daniel Frappier is offline Daniel Frappier
Prince
Montreal, Quebec, Canada
Jan 1970
time: 05:14
Post  Old Post 03-12-2000 10:42
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Suffering from ads?

The lines that control the Wages are in gamedata\const.txt

-----------------------------------------------------
UNIT_WAGES 1.0 # what does 1 notch mean
BASE_WAGES 4.0 # gold per person when slider is zero
-----------------------------------------------------

Wich means that the Wages at the middle of the slider is 4 gold and that each tick on one side or the other is worth 1 gold and for example

UNIT_WAGES 4.0 # what does 1 notch mean
BASE_WAGES 12.0 # gold per person when slider is zero

would gives possible wages of 4, 8, 12, 16 and 20.

I am not sure I understand you're comments about handicapping the AI, i can tell you that personnaly i hate it when the AI start with a lot of stuff because i feel it unbalance the early game and everything becomes a catch-up race BUT i think bonusses through out the game are good and necessary.

In my experience nothing as as much impact as a Production bonus, I think you can't go without one. I got to run my wife is angry and my kid is shouting , next time i will list the bonusses i gave and i hope you will not go without some, the one in the game are seriously wrong.

WesW is offline WesW
CTP1/2 Modification Site Admin
Florence, Al., USA
Jan 1970
time: 23:14
Post  Old Post 03-12-2000 02:39 Visit WesW's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Call to Power 2

I figured out the slider settings in the const.txt, and now they work as they should. We will have to see if this is proper, or if the Actigrammers changed them on purpose.
Getting back on topic...
Can someone explain what "squadclass" refers to in the goals.txt

FreeChina is offline FreeChina
Chieftain
in training
Aug 1999
time: 05:14
Post  Old Post 03-12-2000 20:43 Visit FreeChina's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton buy from Amazon

COmpletely unrelated, but it's pretty funny that "Destroy city" the D turns into a

colorme is offline colorme
Warlord

Nov 2000
time: 05:14
Post  Old Post 04-12-2000 02:49
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Full PM-box? Change here!


SO I was experimenting with adding some military AI code of my own (using SLIC2). But, I cannot figure out how to keep the AI from over-riding "my AI code".

e.g. I wrote some SLIC code to select the biggest army the AI (of one of the civs) has, and to make it move to a particular location. The selecting part works (I put in an appropriate message to indicate that), but the moving part of this doesn't work.

Does anyone know how this is done in SLIC1 (or better still in SLIC2)?

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 04-12-2000 17:28 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Got spare money?

colorme,

I haven't messed too much with this yet, so I could well be way off, but I think that if you want to override the AI completely, you'll have to work very, very thoroughly. Don't just send the AI to it's final destination, send it to an adjacent square first. If it has movement points left, send it to the next square, and then to the next, etc. That will probably work better. Also, there are a lot of ways to move the AI (much be like 5-10 events that are movement related), so trying a different event might help.

If you get stuck, send me what you've got and I'll have a look at it, I'm currently working on a more or less similar thing for a scenario anyway (restricting movement to a certain 'zone' to be more precise, not quite as complicated but still similar), so together we might be able to work it out.

BTW, in SLIC1 you couldn't tell the AI to do anything, not moving and not anything else either, so we're working on ground-breaking territory here

colorme is offline colorme
Warlord

Nov 2000
time: 05:14
Post  Old Post 05-12-2000 01:45
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton or Terrorists Win


Locutus,

Thanks for the tip. I'll try what you said. BTW, I do this in my spare time, and that's getting a little too spare I guess the same holds for you too ...

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
archivepost
Forum Jump:
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
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0487 seconds (90.06% PHP - 9.94% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net