Thread Tools
Old December 31, 1969, 20:00   #1
13
Guest
 
Posts: n/a
4
 
Old December 31, 1969, 20:00   #2
0
Guest
 
Posts: n/a
1
 
Old December 31, 1969, 20:00   #3
9
Guest
 
Posts: n/a
5
 
Old December 31, 1969, 20:00   #4
3
Guest
 
Posts: n/a
1
 
Old December 31, 1969, 20:00   #5
3
Guest
 
Posts: n/a
1
 
Old December 31, 1969, 20:00   #6
1
Chieftain
 
1's Avatar
 
Local Time: 04:42
Local Date: October 31, 2010
Join Date: Dec 1969
Location: USA
Posts: 46
1
1 is offline  
Old November 30, 2000, 17:23   #7
MarkG
Guest
 
Posts: n/a
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!!
 
Old November 30, 2000, 20:33   #8
colorme
Warlord
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Nov 2000
Posts: 122

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  
Old November 30, 2000, 20:34   #9
colorme
Warlord
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Nov 2000
Posts: 122

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
colorme is offline  
Old November 30, 2000, 22:26   #10
WesW
Apolytoners Hall of Fame
 
WesW's Avatar
 
Local Time: 03:42
Local Date: October 31, 2010
Join Date: Mar 2007
Location: Florence, Al., USA
Posts: 1,554
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
}
WesW is offline  
Old December 1, 2000, 09:36   #11
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
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?
Peter Triggs is offline  
Old December 1, 2000, 14:08   #12
Daniel Frappier
Prince
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Montreal, Quebec, Canada
Posts: 590
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.
Daniel Frappier is offline  
Old December 2, 2000, 01:51   #13
colorme
Warlord
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Nov 2000
Posts: 122

Peter,

I left MaxEval unchanged at 25 or so, and played around with MaxExec (10,5,3, etc.).
Didn't seem to help.
colorme is offline  
Old December 2, 2000, 06:06   #14
WesW
Apolytoners Hall of Fame
 
WesW's Avatar
 
Local Time: 03:42
Local Date: October 31, 2010
Join Date: Mar 2007
Location: Florence, Al., USA
Posts: 1,554
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.
WesW is offline  
Old December 2, 2000, 17:39   #15
WesW
Apolytoners Hall of Fame
 
WesW's Avatar
 
Local Time: 03:42
Local Date: October 31, 2010
Join Date: Mar 2007
Location: Florence, Al., USA
Posts: 1,554
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
WesW is offline  
Old December 2, 2000, 23:42   #16
Darkknight
NationStates
Prince
 
Darkknight's Avatar
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Nov 2000
Location: in between Q, W, A and S
Posts: 689
AI Attack files

There is a txt. file Strategy.txt or something.I heard there is a line (AIAttack or something) if you move it further up the file or change the no. . there should be a AIDefense line or something change the Attack line to the same no. position in file.

I just heard this i don't even have the game so i can't check it out.if someone sends me the strategy.txt file I'd look over it see what i can do (if you're too engrossed in the game to bother, I don't have it for 7 more days.

Don't flame me if i'm wrong.

------------------
" mind over body "
Darkknight is offline  
Old December 3, 2000, 01:42   #17
Daniel Frappier
Prince
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Montreal, Quebec, Canada
Posts: 590
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.
Daniel Frappier is offline  
Old December 3, 2000, 10:05   #18
marc420
Warlord
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Oceania
Posts: 123
Just a thought on AI Attacks that I wanted to throw out.

To some extent, having an AI that doesn't attack as much may be considered an improvement over earlier AI's in civ-type games.

In the past, I've defeated civilizations that were more powerful than myself by using a "rope-a-dope" strategy. That is I would set up a strong defensive position, then let the AI send wave after wave of attackers at me.

Often, with a combination of defense and counter-attack, I was able to inflict very heavy losses over a long stretch of time upon a powerful AI civilization. This was a resource drain on the powerful civ, and thus over time I was able to catch up or pull ahead of the civ, and eventually go over to the attack myself against this civ.

So, if the AI in CTP2 is not going to spend hundreds of years producing units and throwing them against my strong defensive line, then this might be considered an improvement in the AI's intelligence.

Or at least its possible that this sort of change in behaviour is what Activision was aiming at, and maybe they just missed the balance a bit by making the AI too cautious in attacking.
marc420 is offline  
Old December 3, 2000, 11:40   #19
MarkG
Guest
 
Posts: n/a
marc, it is certain from the strategies.txt file that the ai evaluates your stack(according to how many units of each kind you have) before attacking

i saw this "live": an ai stack of 5 units gets close to a city of mine. i dont have the time to rush build city walls and just leave it with the 4 units i have inside. the ai attacks and gets my city. i eeer reload a previous save and build one more unit. the ai stack turns around and heads to another city
 
Old December 3, 2000, 11:43   #20
FreeChina
Chieftain
 
FreeChina's Avatar
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Aug 1999
Location: in training
Posts: 96
COmpletely unrelated, but it's pretty funny that "Destroy city" the D turns into a
FreeChina is offline  
Old December 3, 2000, 17:49   #21
colorme
Warlord
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Nov 2000
Posts: 122

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)?
colorme is offline  
Old December 4, 2000, 01:54   #22
MrFun
Emperor
 
MrFun's Avatar
 
Local Time: 04:42
Local Date: October 31, 2010
Join Date: Nov 2000
Location: Illinois
Posts: 8,595
People are complaining about a weak AI and then you go ahead and reset when you lose a battle to the computer!?

Oh well, I am sometimes guilty of that too.
MrFun is offline  
Old December 4, 2000, 08:28   #23
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 11:42
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
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
Locutus is offline  
Old December 4, 2000, 16:45   #24
colorme
Warlord
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Nov 2000
Posts: 122

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 ...
colorme is offline  
Old December 7, 2000, 14:19   #25
OmniGod
Civilization IV CreatorsCiv4 SP Democracy Game
Prince
 
OmniGod's Avatar
 
Local Time: 04:42
Local Date: October 31, 2010
Join Date: Dec 1999
Location: Welland, ON
Posts: 751
Okay can someone tell me how to make the AI start building a civ right away... it's 30 turns in and only the Canadians are smart enough to build a city... some civs aren't even moving around to find a good location, they're just standing there dumbfounded... is the the large map that confuses them, or are they just looking to be knocked off in the first 100 turns, by my army?

Omni - how do you fix this?
OmniGod is offline  
Old December 7, 2000, 18:30   #26
skorpion59
Prince
 
Local Time: 03:42
Local Date: October 31, 2010
Join Date: May 1999
Location: Tulsa, Oklahoma, USA
Posts: 716
Omni,

Even on massive maps, the Civs will move, settle, etc.
You have the 'Ghost Civ' problem. Stems from the scenario getting messed up internally while it was being created. Generally, although not always, this comes from not deleting the original settlers before playing with the 'Set Start Loc' options.

POSSIBLY, if you go back in and delete all the settlers, then set the Start Locs again, it might fix it. Although, quite often, once the scenario gets messed up, it is toast and no longer usable.
skorpion59 is offline  
Old December 8, 2000, 15:00   #27
WesW
Apolytoners Hall of Fame
 
WesW's Avatar
 
Local Time: 03:42
Local Date: October 31, 2010
Join Date: Mar 2007
Location: Florence, Al., USA
Posts: 1,554
Poor name for the thread, but the best I could come up with right now. Anyway, I have been trading emails with Darryl (Gemini) all morning about what he has been able to figure out about the goals settings found in the strategies.txt. He is still working on his Ctp1 mod, but everything he has been working on seems to be a problem still in Ctp2, so I think everyone will be excited to hear what he has told me. Here are edited excerpts from our correspondence:

Darryl, if you get time, write me up a brief description of the major improvements to AI behavior that you have been able to achieve, and what settings you altered to achieve them.
Wes

Well, I just recently implemented them but so far I have seen the ai attack in stacks of 9 for air and naval units. To do this I set the priority for attack_troops_priority to the highest priority for all the aip files. It seems when other priority's took precedence that the ai would stack very ineffectively, for example you might see a stack of two or three for air and naval units when the explore or seige priority took precedence. Since I set the attack_troops_priority the highest in all aip files it takes cities a lot more effectively and more often.
Also, it seems that adjusting the min_attack ratio and max_attack_ratio to from 9.0 and down(i have 14 different aips for the war settings so I decrease this in each file) tends to have very good results for making the ai more inteligent about where to attack and when. Although I have tested this it is only the attack_troops_priority that seems to really get the ai to stack naval units in 9 a stack.
Also the distance_from_unit as well as the other distance priorities seems to have been interfering with making the ai a tougher opponent. Setting all these priorities to 0 has made the ai attack from farther distances and also made the ai less choosy about the cities it takes. For instance the per_capita modifier would make the ai not take easily taken cities, instead waiting for what appears to be a larger city to come into play. If that larger city doesn't come into play the ai seems pretty stupid and will just pass by or wait??? Crazy, but setting it to 0 has made the ai much more aggressive. I especially enjoyed it when I saw the Japanese attack the US mainland (seeing as my map is 120x240 at first it would only attack it's closest enemies), sending troop transport after transport to the mainland. I have also seen it use the aircraft carriers(but not often, still working on that).There still are some quirky ai behavioral problems going on but hopefully fixable.
Also I have set the num_city_defenders to different integers depending on the aip warsetting. I have randomized the aip files to switch on a random basis. I have created 14 seperate aip files just based on different styles of war to conduct and how many city defenders the ai will prioritize. Anyway, those are the major changes I can think of, sorry about some of the spellings for the priorities, I'm at work right now and I am going by memory.

Darryl states in other letters that increasing the max_eval numbers seems to get the AI to attack more, perhaps because it evaluates more cities and thus finds more opportunities for success.

I haven't really examined Darryl's comments to see how they could be used in the Strategies.txt, but I know this info will help us.
WesW is offline  
Old December 10, 2000, 18:31   #28
lozina
Settler
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Mar 2000
Location: Mt. Kisco, NY USA
Posts: 27
the whole diplomacy ai really stinks... but 2 things that stand out right now are:

1. all civs find it necessary to pirate your trade routes every once in a while. this is annoying not only because they do it totally arbitrarily- dosent matter if you're on good terms or not- but also they consider it "ok". sometimes i pirate their trade routes in return and then send proposal that ill stop if they stop - and they always reject! meanwhile his regard would be at "respects you". i just dont understand it... piracy should be something more hostile civs do and other civs should lower their regard towards a pirating nation. also- you should be able to avoid making trade routes through another nation's border- at a cost of more caravans of course. or maybe even plot the whole course yourself...

another thing is how civs value cities so minimally. id offer another civ a size 30 city for some size 1 hamlet they snuck into my borders (so i can then disband it) and they always reject... or if i offer huge cities for something like a peace treaty they reject that too. cities should be more considered much more valuable to the ai... just imagine usa offering New york city to canada!

why am i posting this stuff on this forum? because i wanna know how to customize the diplomacy so i can make these changes. does anyone know what files i need to edit and if i need to know their SLIC scripting language? ive been fooling around with various files ever since the game came out and still cant find how to make such changes in diplomacy. pls lemme know!!!
lozina is offline  
Old December 11, 2000, 04:05   #29
Matte979
Warlord
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Nov 2000
Location: US
Posts: 110
My feel is that the didn't finish the diplomacy.

First. There are alot of things in the files concerning dipolomacy that isn't used. The computer players don't do any diplomacy between themself.
They are almost always at war.

Activision needs to go through the whole diplomacy system.

/Mathias
Matte979 is offline  
Old December 11, 2000, 15:21   #30
OmniGod
Civilization IV CreatorsCiv4 SP Democracy Game
Prince
 
OmniGod's Avatar
 
Local Time: 04:42
Local Date: October 31, 2010
Join Date: Dec 1999
Location: Welland, ON
Posts: 751
Most of what you want to change is based in the diplomacy files, and in general through out the whole AI files... I've started to glance at them for an upcoming scenario where I need to overhaul the people involved... but if you take the time to read, cross reference and such you'll see that there is possibility in the AI dip.... no special knowledge needed as of yet, but it never hurts to know slic, just in case

Omni
OmniGod is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:42.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team