This is an .ai template that eases the burden of AI scripting. It has been used as a base for the Melee AIs in my project (The Withering Kind
) and in Kam's Beyond The Throne
. (from version 220.127.116.11 to 18.104.22.168 at least, latest version's one is "streamlined" according to the release notes so I'm not sure it's the same)
.ai scripts are pure JASS. This script is aimed at JASS/vJass coders that want to script quick 'n' dirty Melee AIs or that want to learn how to script AIs.
Its features: (and also its non-features)
- Most common racial tasks are either fully automatized or streamlined. Namely, the AI will:
- Build houses automatically.
- Tier up when a set amount of gold and wood is reached.
- Train workers automatically with a system that covers:
- An user defined number of them, divided in main base workers and expansion workers.
- Having different harvesters types for gold and wood. (max. 2)
- Build/research/train most buildings, upgrades and units without modifications to the BuildPriorities and UpgradePriorities as long as you've set the IDs correctly. (To make the AI work right, though, you'll still have to tweak those according to the race's needs)
- (added in v0.5) Can focus on either researching upgrades or tiering up, depending on FocusTiering's value.
- Most of the AI scripting now consists in setting constants at the beginning of the script. Most users will only have to set variables and tweak the two functions I named above to have a fully working, competitive AI.
- IDs aside, all constants are already set to values that should work fine with most races.
- The most common racial differences (like the UD harvesting mechanics, the fact Naga can swim etc.) are supported. As always, it's a matter of setting up a couple of variables.
- The AI can stop creating Basic Melee (Footmen) units when they're obsolete, saving food for better units, if you want to.
- (added in v0.5) Easy and Normal difficulties are handled just like standard AI does.
- (added in v0.5) New Attack function, it's more streamlined, almost identical to standard AI and... it buys Zeppelins! Woot! (disabled by default because it makes the AI do pretty reckless stuff at times, but other than that it's fine)
- The HallCount function.
- If a variable that should store an ID is unused, set it to 0. No, the script won't crash and burn.
- The template script is (badly) commented.
- Uhhh.... AI scripts support 4 heroes.
Differences with Blizzard's Melee AI & bugs or other misc notes:
- The AI will build houses quicker than the standard AI.
- Will Tier up (if not focusing on upgrades) and build armies faster.
- Will actually research upgrades (standard AI gets stuck on that at times )
- It will not buy Zeppelins as it is now, it does with SimpleAttack enabled, but it doesn't use them anyway, so...
- Hard and Insane difficulties for now consist in Expansion number differences. Nothing more. (might be on par with what Blizzard did actually. Maybe even better)
- It's able to rebuild and recover if it can.
- Building placement can be weird. There's nothing I can do about it, blame Blizzard. =P