News / Submit
Archives
Articles

KIS Home
Reviews
Info
Screenshots
Background
Story of Kohan
Factions
Heroes
Units
Spells
Terrain
Buildings
Technology
Official KIS AI

Ahriman's Gift / Battles of Ahriman

Fan Fiction
Strategy
Editing
Cheats & Tips
Walkthroughs (KIS)
Kohan University

Forums
Staff
Player Gallery
Clans
Contests & Tourneys
Links

A Proud Member of

StrategyPlanet

 



AI Basic Tutorial
by TheSimbul

INTRODUCTION


Let me start off by first saying that by no means am I an expert at creating AI. But the following should help when you need to create an Ai for specific purposes. I will try to pass on here what I have learned of AI. I hope this helps.

To start, download the Gore AI from the AI section of The Awakening. This will be the basis on which I show you how to modify it for your own needs. You will need to go back and forth from this tutorial and the AI file so it may be best to print this for easier use.

Now that you downloaded Gore, open it up:

PART I


;

; Gore (Nationalist) by fenwe

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Unit/Goal Allocation Settings ;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

This is where you can put what ever you would like. Any line that starts with the semi-colon ; will be ignored by the game, so you write whatever notes you need to at these locations.

PART II


; Full Strategic Re-Compute Time & General Settings

[GeneralSettings]

name = Gore

description = Gore

skill_level = 2 ; 0=easy/1=med/2=hard

full_recompute_time = 20.0 ; (s) 30 seconds per full recompute of strategy (float)

influence_range = 4 ; number of regions influence can cross (int)

influence_decay_rate = 0.4 ; amount of influence transmitted from one region to another (float)

PreferredFaction = NATIONALIST
 

This part is the basic identity of the AI.

Name: Change this to whatever you would like your AI called and this is also what will be displayed while game is played with the AI

Description: Change it to AI name as well

Skill_level: Depending on the # used is what the AI will start with

0= Basic AI , I believe starts with the same cash as you would start on a random map

1= Slightly Advanced AI, Starts with a town instead of a village

2= More Advanced AI, Starts with a town and 1 full company of units

Full_recompute_time: Time it takes AI to compute its strategy. I do not fully understand the difference between a higher or lower value. But of the better AI that I have seen they were always set at 20. The Crappier AI tend to have this set at 30. I would stay close to these #’s say 15-35.

Influence_range: This I believe is the # of zone of controls the Ai will focus most on.

Influence_decay_rate: Once again this is not fully understood. The better AI tend to have this set at 0.4 while the worst of Ai tend to have this set anywhere up to 0.7.

PrefferedFaction: This is where you choose the faction type the AI is. Faction types must be written in caps or will not work. COUNCIL, CEYAH, NATIONALIST, ROYALIST

PART III


; Priorities

[GoalPriorityList]

explore = 40.0 ; priority to go to unexplored regions (float)

distance = -3.0 ; reduced priority according to region distance (float)

combat = 10.0 ; enemy combat priority (float)

building_defend = 30.0 ; friendly building defense priority (float)

building_attack = 70.0 ; enemy building attack priority (float)

script = 0.0 ; scripted location priority---will this be used? (float)

repeat = 50.0 ; priority of repeated goals (float)

repair = 85.0 ; repair damaged friendly buildings, set to zero if not to be used (float)

guard = 15.0 ; guard regions (at border or near my towns) (float)

reinforce = 50.0 ; move injured units to friendly supply zone(float)


These are all pretty self-explanatory. They are all set as percentages. Set between 0.0 - 99.9. Set each of these as you want the AI to act.

The only 2 that may need a little explaining is.

Distance: Determines how less important an object is per zone of control from the AI’s main town

Script: no one knows what this does

PART IV


; Secondary Priorities

build_city = 37.0 ; new settlement priority (float)

build_outpost = 25.0 ; new outpost priority (float)

build_mine = 50.0 ; priority to build a new mine (float)

upgrade_city = 10.0 ; upgrade an existing city (float)

upgrade_structure = 10.0 ; upgrade an existing structure in a city (float)

commission_unit = 35.0 ; commissioning a new unit (float)


Once again these are pretty self explanatory. Percentages set between 0.0 -99.9.

Once again what is it you want your AI to do. Do you want them to focus more on upgrading and units or do you want them to settle often and build a decent eco for better units.


PART V


; Goal Priority Bonus

[GoalPriorityBonus]

fuzziness = 5.0 ; max fuzzy priority--fuzzy priority will be in a range from 0 to this (float)

destroy_captured_base_percent = 0.95 ; percent to raze a building surrounded by enemy. (float)

percent_engage_captain = 0.95 ; % chance the captain will be set to engage rather than command (float)
 

I do not understand fuzziness. The other 2 are once again self explanatory. Percentages set between 0.0 - 99.9.


PART VI


; Unit Strength Ratios

[StrengthRatios]

matching_ratio_min = 1.0 ; Minimum force strength ratio when engaging enemy (float)

matching_ratio_max = 5.0 ; Maximum (float)

building_bonus_min = 0.0 ; Minimum force strength bonus per building when present (float)

building_bonus_max = 50.0 ; Maximum, note this is both for friendly (on defense) as well as enemy (on attack) when there are enemy present (float)

guard_min = 10.0 ; Minimum force strength to be guarding areas (borders or near my cities) (float)

guard_max = 20.0 ; Maximum (float)

 

Matching ratio min and max: I believe determines, the minimum # of companies to send vs. an enemy to the maximum # of companies to send vs. an enemy.

Building bonus is not understood.

Guard min and max: When the AI decides to Guard a town or outpost or border. This is the minimum and maximum % of troops they will use. It does not mean they will use this percentage on all towns and such. The AI must first decide to guard these objects.

% chance of setting AI to guard something is in part 3.


PART VII


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Unit/Building Construction Settings ;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Build Priority

; Like the guard ratios, the gold ratios do not have to add up to zero,

; they will be normalized and any neg. values will be made pos. before that.

[GoldRatio]

build = 0.30 ; % of resources will go toward building and upgrading settlements and other stand-alone structures(float)

upgrade = 0.40 ; % of resources will go toward building new settlement structures, like sawmills(float)

unit = 0.40 ; % of resources will go toward commissioning new companies(float)

; Buildings

; Building priorities will be altered by a deficit in their production

[StructurePriorityList]

Woodmill = 15.0 ; base priority to build a woodmill (float)

Blacksmith = 40.0 ; base priority to build a blacksmith (float)

Quarry = 25.0 ; base priority to build a quarry (float)

Market = 45.0 ; base priority to build a market (float)

Barracks = 20.0 ; base priority to build a barracks (float)

Temple = 23.0 ; base priority to build a temple (float)

Library = 35.0 ; base priority to build a library (float)

Wall = 5.0 ; base priority to build a wall (float)

 

Gold Ratio: The percentage of gold used for these 3 various tasks. They do not need to be added up to 100%. Any values added up to above or below 100% will then be determined by the Ai. By going above 100% it makes the Ai different almost every time used. I.E. One time they may go total eco another total unit. So try to normalize them as close to 100 % as possible. If you want the Ai to act slightly random each time, try not to go above 115% and below 85%. By going above or below these #’s you effectively ruin the Ai to do the stupidest possible things he can do.

Buildings: Again this is a total up to 100%. Any above or below will be randomly determined by the AI. If you are looking to get the Ai to build specific units or build a strong eco then you should put the higher percentages into the objects you want them to create most. I.e. if you want Ai to make dragoons a lot, then put a high percentage in barracks and iron) (infantry and mage then put high percentages in iron and library) For the Ai to randomize what type of units it creates then put high or low percentages in all, then the Ai will have a higher chance of randomness for each town.

PART VIII


; Building Upgrade Priority List

[StructureUpgradePriorityList]

MiningPost = 25.0 ; base priority to upgrade a quarry to a mining post (float)

MasonryGuild = 15.0 ; base priority to upgrade a quarry to a masonry guild (float)

StoneMarket = 5.0 ; base priority to upgrade a quarry to a stone market (float)

Sawmill = 25.0 ; base priority to upgrade a woodmill to a sawmill (float)

CarpentryGuild = 30.0 ; base priority to upgrade a woodmill to a carpentry guild (float)

WoodMarket = 15.0 ; base priority to upgrade a woodmill to a wood market (float)

BlastFurnace = 35.0 ; base priority to upgrade a blacksmith to a blast furnace (float)

ArmoryGuild = 5.0 ; base priority to upgrade a blacksmith to an armory guild (float)

IronMarket = 15.0 ; base priority to upgrade a blacksmith to a iron market (float)

ManaForge = 45.0 ; base priority to upgrade a blacksmith to a mana forge (float)

Bazaar = 0.0 ; base priority to upgrade a market to a bazaar (float)

Bank = 95.0 ; base priority to upgrade a market to a bank (float)

Factory = 0.0 ; base priority to upgrade a market to a factory (float)

Billet = 0.0 ; base priority to upgrade a barracks to a billet (float)

Garrison = 0.0 ; base priority to upgrade a barracks to a garrison (float)

SupplyPost = 0.0 ; base priority to upgrade a barracks to a supply post (float)

TempleOfTheOverseers = 35.0 ; base priority to upgrade a Council temple (float)

WayOfImmortality = 30.0 ; base priority to upgrade a Royalist temple (float)

Nightbringers = 50.0 ; base priority to upgrade a Nationalist temple (float)

Nightbringers2 = 30.0 ; base priority to upgrade a Ceyah temple (float)

MageCollege = 35.0 ; base priority to upgrade a library to a mage college (float)

AstrologyHall = 0.0 ; base priority to upgrade a library to an astrology hall (float)

WizardTower = 0.0 ; base priority to upgrade a library to a wizard tower (float)

WatchTowers = 0.0 ; base priority to upgrade a wall to watch towers (float)

FortifiedWall = 0.0 ; base priority to upgrade a wall to a fortified wall (float)

TurretedRamparts = 0.0 ; base priority to upgrade a wall to turreted ramparts (float)

 

These are the possible upgrades the AI will make. Once again set up to 100%.

Unfortunately this part tends to be a pain since there are many possible upgrades.

For the AI to create specific effects such as a decent eco then put some percents into things like the bank or iron export. Since the AI is creator determined it is best to take your time at this part to determine what units or what type of eco or effects you want the AI to have.

Fuzziness is skipped because it is not understood

PART IX


This part is Unit Creation. There is a large list of every unit possible including support units. The more of a chance you want the AI to create certain unit’s the higher the percentage should be. As well as for support units.

The second part to this is the penalty listing for each unit. This determines how much percentage is lost per company of units. I.e.( Gore has it set as a 25 percent chance the AI will create an engineer. In the penalty area engineer is set at -25. What that means is that once the AI creates an engineer 25% will be taken off the original percent. In this case making it 0% so that the AI will not create more engineers.)

If you want AI to have a chance to en masse certain unit’s the lower the percentage. You can even make the percentage 0%. I have never tried this as a positive # so if you truly want AI to masse something try it out.

PART X


Unfortunately I don’t understand much of the rest of the AI screen. I hope this helped.

TheSimbul[ÐZ]