AI:CSAI
CSAI
CSAI works ok as ARM on land maps, using the AA2.23 or XTA7 mod.
It can be downloaded from:
Latest release:
Previous releases:
- http://manageddreams.com/csai/CSharpAI_20061026.zip
- http://manageddreams.com/csai/CSharpAI_20061025.zip
- http://manageddreams.com/csai/CSharpAI_20061024.zip
CSAI is written in C#, by Hugh Perkins
Supported Mods
- AA2.23
- XTA7
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
Replays
Here are some replays of it fighting with AAI 0.75 using AA2.23:
SmallDivide:
- http://manageddreams.com/csai/061023-SmallDivide-0.73b1-23.sdf (win)
- http://manageddreams.com/csai/061023-SmallDivide-0.73b1-22.sdf (lose)
- http://manageddreams.com/csai/061023-SmallDivide-0.73b1-21.sdf (win)
- http://manageddreams.com/csai/061023-SmallDivide-0.73b1-20.sdf (win)
CometCatcher Remake v02:
- Catcher Remake-v02-0.73b1.sdf http://manageddreams.com/csai/061023-Comet Catcher Remake-v02-0.73b1.sdf (stalemate)
- Catcher Remake-v02-0.73b1-0.sdf http://manageddreams.com/csai/061023-Comet Catcher Remake-v02-0.73b1-0.sdf(win)
SpeedMetal:
Matches against TSI 0.12:
- Catcher Remake-v02-0.73b1-3.sdf http://manageddreams.com/csai/061025-Comet Catcher Remake-v02-0.73b1-3.sdf (win)
- http://manageddreams.com/csai/061025-SpeedMetal-0.73b1-0-csai-vs-tsi-aa223.sdf (win)
- http://manageddreams.com/csai/061025-SmallDivide-0.73b1-0-csai-vs-tsi-aa223.sdf (win)
Supported Platforms
You will need a Windows platform to run CSAI.
To Install
First, make sure you have the Framework .Net 1.1 runtime installed. You can download this from Microsoft.
Download the CSharpAI zipfile above
You should find the following dlls, pdb and xml files inside:
- CSAI/CSAI.dll
- CSAI/CSAI.pdb
- CSAIInterfaces/CSAIInterfaces.dll
- CSAIInterfaces/CSAIInterfaces.pdb
- CSAILoader/CSAILoader.dll
- CSAILoader/CSAILoader.xml
Find the spring application directory on your computer. We will call this directory TASpring. It should have spring.exe and tasclient.exe in. Arrange these files as follows:
- CSAI.dll, CSAI.pdb go in TASpring\AI\CSAI (you will need to create this directory)
- CSAIInterfaces.dll, CSAIInterfaces.pdb go in TASpring (same directory as spring.exe)
- CSAILoader.dll, CSAILoader.xml go in TASpring\AI\Bot-libs
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"
- [b]Important: ensure bot plays as ARM[/b]
You can find a logfile in the TASpring/AI/CSAI directory, called csharpai_team0.log , where 0 is the name of the team
You can recompile the CSAI dll at any time, and reload it by saying ".reloadai" in the spring.exe game
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)
Release notes
Release 26 October 2006 b
C++/C# Interface
- No changes
CSAI
- 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
CSAI
- 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
CSAI
- 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 http://taspring.clan-sy.com/wiki/AI:CSAIInterface
CSAI
- 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 http://taspring.clan-sy.com/wiki/AI:CSAI
Developer resources
You may wish to extend or modify CSAI. If so, the following pages may be useful:
- CSAI Build Instructions How to build CSAI
- AI:CSAIInterface Information on the C++/C# interface