From Spring
Jump to: navigation, search


CSAI works ok as ARM on land maps, using the AA2.23 or XTA7 mod.

CSAI is written in C#, by Hugh Perkins

Supported Mods

  • AA2.23
  • XTA7

Supported Platforms

  • Windows

Supported Maps

CSAI works best with maps with one large contiguous land segment.

The following maps have been tested and work ok:

  • SmallDivide
  • CometCatcher Remake v02
  • SpeedMetal
  • Small Supreme Battlefield


CSAI scout sets off, SSB, XTA7:

Csaivsaai xta7 ssb 4zippysetsoffsmall.JPG

CSAI tanks leave trail of destruction through AAI base, SSB, XTA7:

Csaivsaai xta7 ssb 23trailofdestructionthroughaaibasesmall.JPG

CSAI tanks kill AAI commander on SSB, XTA7:

Csaivsaai xta7 ssb 25byebyeaaicommandersmall.JPG

CSAI (in red) approaches TSI base, SpeedMetal, AA2.23. That plasma beam could cause some pain.

Csaivstsispeedmetal arriveatbase.JPG

Plasma beam down, CSAI overruns TSI base, SpeedMetal, AA2.23.

Csaivstsispeedmetal 2plasmagoneoverrun.JPG

CSAI (in red) attacks AAI, SpeedMetal, AA2.23


CSAI units approach TSI base, SmallDivide, AA2.23

Vstsismalldivide 1 attackgroupapproachingbase.JPG

CSAI units kill TSI commander, SmallDivide, AA2.23

Vstsismalldivide 6tsicommanderdies.JPG


Here are some replays to give you an impression of how CSAI fights.

CSAI vs AAI 0.75, XTA7:

Small Supreme Battlefield

CSAI vs AAI 0.75, AA2.23:

CSAI vs TSI 0.12, AA2.23:


Latest release:

Previous releases:

To Install

  • Ensure that you have the Microsoft Framework .Net 1.1 runtime installed. You can download this from Microsoft, for free.
  • Ensure that you have the latest version of Spring installed, 0.73b.
  • Download the latest CSharpAI zipfile from the Downloads section and unzip it.
  • Run setup.exe
  • Confirm the Spring installation directory
  • The CSAI dlls should be automatically installed into the Spring directory

To use

To run the bot:

  • create a multiplayer game, using Absolute Annihilation 2.23
  • specify start positions as "random" or "fixed"
  • click "add bot"
  • specify the ai as "csailoader.dll"
  • Important: ensure bot plays as ARM

You can find a logfile in the Spring/AI/CSAI directory, called csharpai_team0.log , where 0 is the name of the team

Commands available

You can talk to your AI whilst it plays.

Commands to the ai always start with ".csai ", then the command.

Type ".csai help" for a list of available commands. Here are some of them:

  • .csai commanderbuildpower Commander builds a solar cell near him
  • .csai commanderbuildextractor Commander builds a metal extractor on nearest available metal spot
  • .csai commandermove 0 1000 1500 Move team 0 commander to position (1000,1500)
  • .csai commandergetpos Ask for commander's current position
  • .csai commanderbuild armvp Ask commander to build a vehicle plant next to him. Use any valid unit name here (see logfile for list) (must be buildable by arm commander)
  • .csai killallfriendly Kills all units belonging to AI, except for commander This is sometimes useful during AI testing
  • .csai unitcount (countunits?) Shows number of units currently
  • .csai showmetalspots Show detected optimal metal extractor positions. Also shows metalspots that have been marked used
  • .csai tankscount Find out how many tanks are available
  • .csai tanksmoveto 0 500 1000 Move all team 0 tanks to position 500, 1000
  • .csai autoshowenemieson Shows detected mobile enemies (samson icon) and static enemies (antinuke icon)

How to beat CSAI

Here are some strategies that will kill the current release of CSAI.

Massive concentration of defense near AI's base:



Known issues

  • All current released versions: on computers where the regional settings specifies the decimal separator as something other than ".", the metal cache will fail to load correctly. This means the commander will put extractors along the top of the screen and lose. This affects computers in France and Germany.

Release notes

Release 28 October

C /C# Interface

  • corrected critical bug in AICallbackProxy::GetMetalMap()
  • augmented number of allowed units to 10000 in AICallbackProxy


  • (experimental) created setup.exe to facilitate installation

Release 26 October 2006 b

C /C# Interface

  • No changes


  • created PackCoordinator architecture
  • fixed bug that caused infantry factories to shutdown occasionally when playing XTA
  • spreadsearch initiated more aggressively

Release 26 October 2006

C /C# Interface

  • No changes


  • supports XTA 7
  • modified Metal algo to prefer spots which are over actual metal, rather than offset to one side
  • (experimental) clearance around metal extractors reduced to improve location precision. NOTE: this may increase unit blocking, to be verified
  • you can turn debug on by creating an empty file called "debug.flg" in the ai/csai directory
  • (experimental) added search algo for tanks if they havent seen an enemy for about a minute and there's at least 100 of them
  • improved radar deployment

Release 25 October 2006

C /C# Interface

  • No changes


  • added support for metal maps
  • fixed bug with metalspots being marked used even if not
  • added constructor controller, to ensure always at least one constructor
  • added anti-sticking patch for constructors
  • added memory for buildings to enemycontroller (since buildings cant move)
  • corrected bugs in enemy selection algorithm
  • trimmed cpu resource drain for stuck constructors
  • removed default drawing of detected enemies; you can say ".csai autoshowenemieson" to reactivate this
  • removed default drawing of planned construction site; you can say ".csai constructorshownextbuildsiteon" to reactivate this
  • experimenting with kbot factory
  • experimenting with replacing samsons by jethros
  • factories no longer announce their creation
  • added AttackPackCoordinator to improve pack grouping

Release 24 October 2006

C /C# Interface

  • CSAI.dll moved to AI/CSAI (only CSAIInterfaces.dll remains in Spring root)
  • <csailoaderfilename>.xml config file added, to configure which C# AI dll to load
  • batchfile building no longer supported (please use nant)
  • added IMoveData
  • added IUnitDef.movedata
  • added all command constants, eg MOVE, SELFD, to Command.cs
  • added operators to Float3
  • added UnitIsBusy to AICallback (checks GetCurrentUnitCommands returns empty deque)
  • documentation moved to wiki at


  • added commands to move commander, and get commander to build things
  • logfiles moved to AI/CSAI , in line with AI standards
  • batchfile building no longer supported (please use nant)
  • UnitController added, to register player-owned units
  • FactoryController added, to register player-owned factories
  • added port of AF's UnitDefHelp
  • added architecture for strategies
  • event architecture added to CSAI for unitcreated, unitfinished, unitdamaged, etc
  • added PowerController to control energy
  • added MetalController to control metal
  • added TankController to manage tanks (bootstrapping class only)
  • added EnemyController to monitor enemies
  • added RadarController to manage radars
  • added simple heuristic to prevent commander blocking himself in or factories
  • added ScoutController
  • added Request system to factories, to decide what to build
  • documentation moved to wiki at

Developer resources

You may wish to extend or modify CSAI. If so, the following pages may be useful: