Hi all, Finaldeath from the AI Scripting Forums
I'm going to start posting up text and images for a long set of AI tutorials...
Aims:
User Patch based: shows off the power of goal manipulation and information processing
Basic introduction to get the bare bones of an AI present
Sectioned information on everything; basics onto advanced subjects
Heavy focus on setting up structure, not copying and pasting huge examples which require existing code from previous tutorials. This allows existing AI authors to use it, and for new users to pick and choose what to implement (beyond the basics).
I need to have some posts here to sort formatting. I'm writing all the text and gathering images as necessary, but I need to know if I should format HTML for the necessary code highlighting and other things.
I also think it might be necessary to, while having the different tutorials split up, them all linked as one big article; is this possible? (Rather then filling up the University with a ton of articles all at once; which would be a bit spammy!).
I also might just finish them over the course of a few months; I have several already written, but a few are both waiting on UP changes or are things I am myself not too great at so need to finish writing bits of my own AI to document it!
I'm also looking for feedback; what the content should be and how I write it. I am willing to rewrite large sections and add in things as necessary.
Currently these are my plans (with notes), subject to abject change on a whim:
Finaldeath (AOK AI Maker)
I'm going to start posting up text and images for a long set of AI tutorials...
Aims:
I need to have some posts here to sort formatting. I'm writing all the text and gathering images as necessary, but I need to know if I should format HTML for the necessary code highlighting and other things.
I also think it might be necessary to, while having the different tutorials split up, them all linked as one big article; is this possible? (Rather then filling up the University with a ton of articles all at once; which would be a bit spammy!).
I also might just finish them over the course of a few months; I have several already written, but a few are both waiting on UP changes or are things I am myself not too great at so need to finish writing bits of my own AI to document it!
I'm also looking for feedback; what the content should be and how I write it. I am willing to rewrite large sections and add in things as necessary.
Currently these are my plans (with notes), subject to abject change on a whim:
Tutorials to write:
Basics Series.
Possibly include User Patch in all of them from the start, makes it a lot easier!
- Basics 1: Introduction to AOK2 AI Scripting
- Hello world example
- comparison with other scripting/coding
- Basics 2: Rules, Commands and Constants
- defrule/defconst (integers and strings) and comments
- facts and actions
- disable-rule, up-jump-rule
- Basics 3: Goals and Timers
- set-goal, up-modify-goal, etc.
- up-timer-status
- Basics 4: Strategic Numbers
- How they work, what ones sync...
- Basics 5: Load - Loading More Files
- (load) (load-random)
- Basics 6: System Symbols
- #load-if-defined XXX
Advanced Series
Everything else! Everything is pretty in depth! But more seriously have to have these separately:
- Advanced 1: File / Rule / Constant / Loading In Depth
- Advanced 2: Debugging
- up-chat-data-to-all / up-chat-data-to-player / up-chat-data-to-self / up-get-cost-delta
- Advanced 3: Optimisation (maybe just merge with rest of the things):
- up-jump-rule
- SN syncs over network
- high lag actions
- moderate lag facts
Scouting
- Scouting 1: Basics, Scout Cavalry/Eagle Warrior
- Scouting 2: Civilian Scouting
- how to do post-game-start/with gatherers?
- Scouting 3: Advanced Scouting
- UP functions, resetting scouts, reassigning groups, use when attacking/retreating or not
- up-disband-group-type, up-send-scout
- Notes about up-retreat and up-stop
Economy Series.
- Economy 1: General Resource Gathering
- up-gaia-type-count, up-gaia-type-count-total
- Economy 2: Food Gathering (Boar, Deer, Forage, Farming, Fishing)
- How to do each of the types
- up-remaining-boar-amount, up-request-hunters
- Economy 3: Wood Gathering (Lumber camps)
- How to build next to nearby wood if possible, and expand radius well over time with possible dual drop sites
- Economy 4: Mining (Gold and Stone)
- How to build next to what we see as the nearest stone and gold piles
- Economy 5: Escaping an attacked camp
- How to build a further camp at another resource patch rather then suicide gathering from an existing one
- Economy 6: Advanced Economy
- up-drop-resources, up-retask-gatherers
Escrow Series
- Escrow 1: What is Escrow?
- Escrow 2: Basic Escrow Usage
- Escrow 3: Advanced Escrow Usage
- Cost data (up-setup-cost-data, up-add-cost-data, up-reset-cost-data)
- up-modify-escrow, up-release-escrow
Population
- Population 1: Population Percentages
- Population 2: Management and Deletion
- up-delete-idle-units - as well as detecting when certain units are useless (Trade Carts/Cogs, Fishing Boats)
Information
- Information 1: Your own facts
- Your pop, unit counts, etc.
- up-get-fact, up-resource-amount, up-resource-percent
- Information 2: Your allies facts
- Their goals, coordination, use for auto trading/feeding
- up-allied-goal, up-allied-resource-amount, up-allied-resource-percent
- up-get-focus-fact
- Information 3: Your enemies facts
- Military pop, unit counts, etc.
- up-get-player-fact, up-get-fact-max, up-get-fact-min, up-get-fact-sum
- target-player; up-get-target-fact
Training Units
- Training 1: Training Units
- Checking if things are being trained too
- up-pending-objects
- up-train-site-ready
- up-train
- Training 2: Escrow Usage
- Training 3: Garrisoning and Release
- Advanced technique
- up-ungarrison, up-gather-inside
- Training 4: Water Unit Training
- Same body of water etc. SNs
Research
- Research 1: Researching Upgrades
- up-research, up-research-status
- Research 2: Escrow Usage
- Research 3: Automatically Build Research Buildings
- Research 4: Advanced: Cancellation
- Research 5: Age Progression (Advanced)
- How to codify conditions to age up
- Set amount of villagers (noting fishing ships?)
- Set research (Loom/Wheelbarrow/Hand Cart usually)
- 2+ Town Centers or masses of resources
- Rush conditions versus Boom conditions
- Detecting when we are progressing
- Build things in preperation for the next age
- Keep training villagers!
Construction
- Construction 1: Building Basics
- Construction 2: Advanced Building Techniques
- up-assign-builders, up-can-build, up-build, up-set-placement-data, forward building etc.
- up-pending-objects, up-pending-placement
- up-reset-building
- Construction 3: Farms
- up-delete-distant-farms, farm usage due to max food distance, etc.
- Construction 4: Towers and Outposts
- Forward, and specifically notes about minimum build distance.
- Tower elevation SN
- Defending specific places
- Construction 4: Walls
- All wall information
- Construction 5: Docks
- Constructing together/apart, same body of water, etc.
Repairing
- When and what
- Repair SN
Attacking and Defending:
- Attack and Defence 1: How the AI works by default
- Attack and Defence 2: How attack groups work
- SNs and attack-now
- up-disband-group-type, up-reset-attack-now
- up-reset-target-priorities, up-set-offense-priority
- Attack and Defence 4: How siege units work
- Siege units are: Rams, Trebuchet, Petards
- Non-siege siege units: Mangonel, Scorpion, Bombard Cannon
- Attack and Defence 3: How defence groups work
- up-defender-count
- up-reset-target-priorities, up-set-defense-priority
- Attack and Defence 5: Town Under Attack!
- up-attacker-class, up-get-attacker-class, up-get-projectile-player, up-get-threat-data
- up-building-type-in-town / up-enemy-buildings-in-town / up-enemy-units-in-town / up-enemy-villagers-in-town / up-unit-type-in-town / up-villager-type-in-town
- up-projectile-detected / up-projectile-target
- Attack and Defence 6: Advanced Defence
- up-garrison, up-gather-inside (defending army)
- Attack and Defence 7: Unit Micro
- up-reset-unit, up-retreat-now, up-retreat-to
- up-set-attack-stance
Targeting Enemies
- up-find-player, up-player-distance
- team fights, helping allies
Diplomacy and Communication (to be split)
- Human Communication via. text
- Computer Communication via. goals
- Taunts (reacting to/using)
- Alliances (detecting and setting stance towards players)
- Trading
Names and Personality
- Setting a new AI name ( up-change-name )
- Taunting
- Communication with allies
Resigning
- Graceful resign (tributing resources, deleting buildings, telling everyone)
- Human-like detection of defeat (large military force opposing you late game with few troops, early loss of population, etc.)
Strategy and Tactics
- Boom or Rush?
- Army planning/composition
- Detection of enemy forces
- Counter units
- Changing strategy
Game Types (order from in game sans Scenario). Possibly one article?
- Game Types 1: Random Map
- Default stuffs; including victory condition options
- Game Types 2: Turbo Random Map
- Faster except villager production
- Game Types 3: Regicide
- Conquest with additional "Lost King" condition
- Extra castle!
- Different resources
- Game Types 4: Death Match
- Extra resources
- Game Types 5: King of the Hill
- Standard apart from large area in the middle; possibly not accessible if islands.
- Basic commands to attempt to win at it...
- Game Types 6: Wonder Race
- No combat, first wonder built wins...
- Pretty boring and basic.
- Game Types 7: Defend the Wonder
- Bonus resources
- Defending and attacking team(s) (who may not be allied!)
Starting States
- Starting States 1: Starting Age
- Dark Age to Post Imperial Age, suggestions and strategies
- Starting States 2: Starting Resources
- Low (normal), Medium, High, how it affects strategy
- Starting States 3: Teams
- Positioning (flank/pocket knowledge), how to scout, detection for trade routes
Victory Types
Applies to what game types?
- up-get-victory-data
- Standard
- Wonder, Conquest, Relics
- Conquest
- Basic info
- Time Limit
- Basic info
- Score
- Special game-type cases
Game Maps; possible one article?
- Game Maps 1: General Info
- Usual distributions of resources, players, wolves
- General amount of space for building (and noting distance between players - min/max along with info on differnet map sizes)
- Game Maps 1: Land Maps
- IE: No large body of water whatsoever
- Game Maps 2: Mixed (Water) Maps
- IE: Connecting land but has sea fish/large water body
- Game Maps 3: Island Maps
- IE: No connecting land between players
- Note about map sizes; these ones are larger!
- Note about detecting island maps
- Game Maps 4: Arena and Fortress
- Note about walls/strategy/extra things we get/don't get
- Game Maps 5: Nomad
- No scout, TC, spread out etc.
- Game Maps 6: Michi maps
- Imperial Rush
- Game Maps 7: Migration
- AI's can't play them! Some notes though.
Difficulty Settings
- Difficulty 1: Built in Difficulty Changes
- Big note on adjust-difficulty-auto-disable SN
- Notes on SNs automatically changed if not disabled
- Big note on Hardest extra resources
- Notes on all in built difficulty levels and changes
- Simple tips to decrease AI difficulty outside of Hard/Hardest, aim is to build for Hard/Hardest however.
- Difficulty 2: Tuning AI for different difficulties
In-depth on Game Data (basically Erreta)
- Hidden Data: Siege Armor/Siege Attack, building armor, fortified building armor
- Hidden Data: Attack speed, "Damage Per Second"
- Hidden Data: Attack bonuses versus units (eg: spearmen versus cavalry, also inc. things like villagers versus buildings)
- Hidden Data: How Monks convert units
- Hidden Data: Gaia Unit Stats: Wolves and Boar attack/armor, Villager Hunter attack bonuses.
- Ballistics - who it affects (note about cannons and Spanish)
- Thumb Ring - who it affects (note about All Techs and Britons for instance)
- Bugs:
- Fervor not affecting non-Relic carrying monks (fixed in FE)
-
- Trample Damage
Broken things
- Spies and scouting LOS/counting issues
- Seeing enemy upgrades are impossible (but you can usually detect unit line upgrades)
- Wall attacking and focusing is difficult
- Formations for groups, focus fire
- Transport ships; esp. building on other islands with villagers (impossible!)
- Deleting certain buildings until damaged (walls, houses)
- Suiciding monks (going to relics), scouts (going to explore the same places) and armies (walking past castles/enemy units)
- No stances for monks; always attacking/will always form groups
- No walls on Nomad and Islands maps (but island detections!)
Finaldeath (AOK AI Maker)