Skip to content

Strategy Manager

SMUnlimited edited this page Sep 18, 2026 · 2 revisions

Strategy Manager

The Strategy Manager is the supported editor for AMAI strategies, profiles, racial builds, and settings. It edits the same tab-separated source files used by the compiler.

Requirements and launch

Install Perl and the Perl/Tk modules (Tk, Tk::TextUndo, Tk::Table, and Tk::Balloon), then run from the repository root:

perl .\AMAIStrategyManager.pl

Choose REFORGED, TFT, or ROC, then choose a race. The Strategies and Profiles tabs operate on the chosen source set.

For a complete first project, follow Tutorial.

Editing workflow

  1. Select a version and race.
  2. Use New, Copy, or Insert to create a strategy/profile.
  3. Select it and choose Edit.
  4. Keep strategy code goal-oriented: declare the desired army, upgrades, items, and tier progression; AMAI supplies prerequisites, workers, and food production.
  5. Use Lock to force the selected strategy or profile during a test. Unlock restores normal selection.
  6. Choose Compile Version, install the rebuilt scripts into a test copy of a map, and observe a match.

Extract and Insert exchange individual strategies (.ais) and profiles (.aip). Review imported files before compiling them: their build sections contain code that becomes part of the AI script.

Strategy structure

A strategy contains metadata used to decide when it fits—key units/buildings/upgrades, match-up strengths, timing, aggression, expansion timing, and hero preferences—plus initialization and tier build code.

The smallest useful tier build can be just:

call BuildUnit(1, hero[1], 80)
call BuildUnit(10, uFOOTMAN, 50)

Higher priority goals are considered first. For repeated units and upgrades, AMAI increases priority for the remaining quantity, allowing similarly weighted goals to interlace instead of completing one entire line first.

Useful calls include:

call BuildUnit(10, uRIFLEMAN, 50)
call BuildUpgr(2, uUPG_RANGED, 34)
call BuildItem(2, uHEALING_POTION, 40)

Names such as uRIFLEMAN are generated identifiers based on the selected version's tables. Use existing strategies and StandardUnits.txt to find valid names. See Reference#strategy-build-api for the signatures.

Profiles

Profiles alter behavior rather than build goals. Current fields cover aggression, uncertainty, minimum attack strength, farm timing, expansion timing, strategy persistence, production scaling, chat frequency, targeting, surrender behavior, and favorite heroes/units.

Profiles are global to a version; strategies and racial settings belong to a race. Use a locked profile and strategy when testing so random selection does not hide the effect of a change.

Direct file editing

The manager is safer for ordinary changes. If editing tables directly:

  • Preserve tab-separated formatting and the header column order.
  • Keep boolean values lowercase (true/false).
  • Avoid spreadsheet software silently adding quotes or changing identifiers.
  • Declare all local variables at the beginning of every JASS-style function.
  • Remember that function order matters: a function must be imported or defined above its callers.

Clone this wiki locally