<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paulomorfeo</id>
	<title>Spring - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paulomorfeo"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Paulomorfeo"/>
	<updated>2026-11-09T00:42:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Beginners_FAQ&amp;diff=11121</id>
		<title>Lua Beginners FAQ</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Beginners_FAQ&amp;diff=11121"/>
		<updated>2016-01-18T22:51:16Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Case problem in the paths, ruining Linux paths&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is an introduction to using Lua in Spring - it only tries to answer general questions, for more specific Questions please ask in the forum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Where should I start?==&lt;br /&gt;
&lt;br /&gt;
You can start by reading general Lua tutorials  [http://lua-users.org/wiki/LuaTutorial here]. &lt;br /&gt;
&lt;br /&gt;
After that, you could look at the example widget [[Lua:Tutorial_GettingStarted|here]], and try to add some functionality of your own!&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re a pro, have a look at the game repos [https://springrts.com/wiki/Gamedev:PublicRepos here], especially their /luaui/Widgets and /luarules/gadgets dirs.&lt;br /&gt;
&lt;br /&gt;
==Where can I find help?==&lt;br /&gt;
&lt;br /&gt;
You can find documentation of Springs Lua API on the [[Lua_Scripting|Lua_Scripting]] page. Discussion of lua coding takes place on the [https://springrts.com/wiki/Read_Me_First lobby] in #moddev and #lua, and there is also a [https://springrts.com/phpbb/viewforum.php?f=23 Lua sub-forum].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How do I open &amp;quot;.lua&amp;quot; files?==&lt;br /&gt;
&lt;br /&gt;
Any text editor is enough. On Windows i.e. use [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++]. There are also IDEs able to work with Lua, such as Eclipse, if you look for them.&lt;br /&gt;
&lt;br /&gt;
==What is a call-in? And a call-out?==&lt;br /&gt;
&lt;br /&gt;
Call-ins are functions defined in your script that Spring calls when a determined event takes place. For example, the widget:Initialize() call-in is run by Spring when the widget is loaded.&lt;br /&gt;
Call-outs are functions defined in Spring you can run at whichever moment you desire. For example, when you call Spring.GetUnitTeam(unitID), the engine returns the teamID of the unit identified by &amp;quot;unitID&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What is the difference between unsynced and synced lua code?==&lt;br /&gt;
&lt;br /&gt;
Synced code is code that runs, identically and at the same time, on every connected client. In practice, this means code which controls the game state. Unsynced code is code that will run differently (or maybe not at all) on each connected client. Typically, this means the user interface.&lt;br /&gt;
&lt;br /&gt;
For example, lua code to make units explode if they fell down a cliff would need to be synced. But, code that warned a player when one of their own units was getting near a cliff edge, would need to be unsynced.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What is the difference between LuaUI, LuaRules, widgets and gadgets?==&lt;br /&gt;
&lt;br /&gt;
Spring allows various [[:Category:Lua|Lua States]], each with differing functionality. Inside each Lua state, developers can write addons, which are self-contained pieces of code. There is:&lt;br /&gt;
* &amp;lt;b&amp;gt;LuaUI&amp;lt;/b&amp;gt;: Used for unsynced GUI related code. Addons in here are often called widgets. Clients can (if the game permits it) control which widgets are running. Widgets contain only unsynced code. They can be bundled inside the game, or loaded from the users &amp;quot;Spring/LuaUI/Wigets&amp;quot; directory.&lt;br /&gt;
* &amp;lt;b&amp;gt;LuaRules&amp;lt;/b&amp;gt;: Addons in here are often called gadgets. Clients cannot choose which gadgets run. Gadgets can include both synced and unsynced code, and must be bundled inside the game.&lt;br /&gt;
&lt;br /&gt;
Intended for mappers, there is also LuaGaia, which behaves like LuaRules but is seperated from it. To see which of the lua states has access to which data/functionality, see [[:Category:Lua|Lua States]] and [[Lua:Callins]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What can&#039;t Lua do in the current version of Spring?==&lt;br /&gt;
&lt;br /&gt;
Springs Lua interface is very powerful. To work out if some idea is possible you need to ask &lt;br /&gt;
* When do I need the engine to tell me something has happened? Check against [[Lua:Callins|Callins]].&lt;br /&gt;
* What information will I need to know about the game state? Check against [[Lua_SyncedRead]] (synced) and [[Lua_UnsyncedRead]] (unsynced).&lt;br /&gt;
* What do I then need to do about it? Check against [[Lua_SyncedCtrl]] (synced) and[[Lua_UnsyncedCtrl]] (unsynced).&lt;br /&gt;
Sometimes you need special functionality, like disk access or OpenGL calls, in which case check against [[Lua_Scripting#Interfaces|Interfaces]].&lt;br /&gt;
&lt;br /&gt;
For completeness, some examples of things you (currently) can&#039;t do:&lt;br /&gt;
*control the ground LOS - but you can set the los status of units!&lt;br /&gt;
*add custom parameters to CEG definitions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Where can I find/edit examples?==&lt;br /&gt;
&lt;br /&gt;
You can find some easy example widgets [[Lua:Tutorial_GettingStarted|here]]. The best source of more complicated examples is inside games themselves, in the LuaUI/Widgets and Luarules/gadgets directories. See [[Gamedev:PublicRepos]] for a list of repositories. &lt;br /&gt;
&lt;br /&gt;
To make your own widgets, simply place individual .lua files into your Spring/LuaUI/Widgets dir (create the dir if it is not present. Case-sensitive!!!). Game repositories can be checked out into a folder named &amp;quot;SomeAwesomeGame.sdd&amp;quot;, placed in your &amp;quot;/Spring/games&amp;quot; dir; this shoudl give a local copy of the game, recognized by Spring, where you can edit files. Make sure to check the licenses before doing this!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Can I reload a script without restarting Spring?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can type &amp;quot;/luaui reload&amp;quot; to reload widgets, and if you have &amp;quot;cheats&amp;quot; enabled you can also &amp;quot;/luarules reload&amp;quot; to reload gadgets.&lt;br /&gt;
&lt;br /&gt;
==Why does the print function seem to do nothing?==&lt;br /&gt;
&lt;br /&gt;
Its output is displayed in stdout. If you have no easy way to see it, you can Spring.Echo(&amp;quot;some text&amp;quot;) which prints to the ingame chat and infolog.txt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:Lang:Java&amp;diff=657</id>
		<title>AI:Development:Lang:Java</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:Lang:Java&amp;diff=657"/>
		<updated>2015-11-03T18:45:39Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Update about serious quirk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[AI:Development|AI Development]] &amp;lt; Java AI Development&lt;br /&gt;
&lt;br /&gt;
== Getting Started on your own Java AI ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; This tutorial assumes you have Spring working on your machine. The Spring directory will be referred to as &#039;Spring&#039; from here on.&lt;br /&gt;
&lt;br /&gt;
You will also need to make sure that Java AI&#039;s run properly on your machine. This is most easily done by running a Spring game with the &#039;&#039;NullOOJavaAI&#039;&#039; that comes with the engine. You will need the JRE 1.5 or greater, and to set the &#039;&#039;JAVA_HOME&#039;&#039; environment variable on your system to point to the correct location.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; If you&#039;re using a &#039;&#039;64 bit&#039;&#039; version of &#039;&#039;Windows&#039;&#039;, you will need a 32 bit Java Runtime Environment/Java Development Kit anyway, because Spring is (as of May 2014) not yet available as a 64bit version for Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setting up a Java Project ===&lt;br /&gt;
&lt;br /&gt;
To start working on your own Java AI, you should first set up a project in your favorite Java IDE. You need to import the Spring Java AI Interface libraries, and then create an AI class and an AI Factory.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OUTDATED&#039;&#039;&#039; If you are using &#039;&#039;&#039;Netbeans IDE&#039;&#039;&#039;, you can find a detailed tutorial [http://springrts.com/phpbb/download/file.php?id=4970 here] (from [http://springrts.com/phpbb/viewtopic.php?p=448743#p448743 this forum thread]). Otherwise, please continue reading this page.&lt;br /&gt;
&lt;br /&gt;
==== Importing the interface libraries ====&lt;br /&gt;
&lt;br /&gt;
In order to use the Java Interface, you will need to import the Java Interface libraries (optionally, you can attach the sources for JavaDoc support in your editor) &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Spring/AI/Interfaces/Java/[version]/AIInterface.jar&amp;lt;/code&amp;gt; (sources: jlib/AIInterface-src.jar&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;Spring/AI/Skirmish/NullOOJavaAI/0.1/jlib/vecmath.jar&amp;lt;/code&amp;gt; (sources: vecmath-src.jar)&lt;br /&gt;
* &amp;lt;code&amp;gt;JavaOO-AIWrapper.jar&amp;lt;/code&amp;gt; (sources: TODO)&lt;br /&gt;
&lt;br /&gt;
==== Creating the main class ====&lt;br /&gt;
&lt;br /&gt;
Now that you have the libraries, the next step is to create your AI&#039;s main class. Firstly, you may want to create a package to put your classes in, for example, &#039;&#039;myjavaai&#039;&#039;. Create a new class, named MyJavaAI (or whatever you would like your AI to be called). MyJavaAI should extend com.springrts.ai.oo.AbstractOOAI.&lt;br /&gt;
&lt;br /&gt;
=== Adding your AI to Spring ===&lt;br /&gt;
&lt;br /&gt;
Your AI needs to have its own folder, and the engine will need to know your AI&#039;s attributes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Creating an AI folder ====&lt;br /&gt;
&lt;br /&gt;
Every Spring AI is stored in &#039;&#039;Spring/AI/Skirmish&#039;&#039;. You will have to create a folder for your AI as well. It is easiest to go to the directory &#039;&#039;Spring/AI/Skirmish&#039;&#039;, make a copy of the folder &#039;&#039;NullOOJavaAI&#039;&#039;, and rename the copy to &#039;&#039;MyJavaAI&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Telling the Engine about your AI ====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;MyJavaAI&#039;&#039; folder you created contains the different versions of your AI. As of this writing, the &#039;&#039;NullOOJavaAI&#039;&#039; only has a version &#039;&#039;0.1&#039;&#039;, so there should be a folder &#039;&#039;0.1&#039;&#039; inside the &#039;&#039;MyJavaAI&#039;&#039; folder. Inside you will find a number of files.&lt;br /&gt;
These files are:&lt;br /&gt;
* &#039;&#039;SkirmishAI.jar&#039;&#039;: the jar file that contains the AI code.&lt;br /&gt;
* &#039;&#039;AIInfo.lua&#039;&#039;: contains information about the AI.&lt;br /&gt;
* &#039;&#039;AIOptions.lua&#039;&#039;: you can specify your AI&#039;s options in here.&lt;br /&gt;
* Possibly some text files: these are log files generated by the &#039;&#039;NullOOJavaAI&#039;&#039;. If you don&#039;t plan on using the same files, you may as well delete these.&lt;br /&gt;
&lt;br /&gt;
Additionally, there is a folder named &#039;&#039;jlib&#039;&#039;. This is where you should place any additional libraries you use in your AI.&lt;br /&gt;
&lt;br /&gt;
In order to let Spring recognize your AI, you will have to edit &#039;&#039;AIInfo.lua&#039;&#039;. You can do this with any regular text editor.&lt;br /&gt;
When you open it, the file will look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
local infos = {&lt;br /&gt;
   {&lt;br /&gt;
      key    = &#039;shortName&#039;,&lt;br /&gt;
      value  = &#039;NullOOJavaAI&#039;,&lt;br /&gt;
      desc   = &#039;machine conform name.&#039;,&lt;br /&gt;
   },&lt;br /&gt;
   {&lt;br /&gt;
      key    = &#039;version&#039;,&lt;br /&gt;
      value  = &#039;0.1&#039;, -- AI version - !This comment is used for parsing!&lt;br /&gt;
   },&lt;br /&gt;
   {&lt;br /&gt;
      key    = &#039;className&#039;,&lt;br /&gt;
      value  = &#039;nulloojavaai.NullOOJavaAI&#039;,&lt;br /&gt;
      desc   = &#039;fully qualified name of a class that implements interface com.springrts.ai.AI&#039;,&lt;br /&gt;
   },&lt;br /&gt;
   {&lt;br /&gt;
      key    = &#039;name&#039;,&lt;br /&gt;
      value  = &#039;high-level Java stub Skirmish AI&#039;,&lt;br /&gt;
      desc   = &#039;human readable name.&#039;,&lt;br /&gt;
   },&lt;br /&gt;
   {&lt;br /&gt;
      key    = &#039;loadSupported&#039;,&lt;br /&gt;
      value  = &#039;no&#039;,&lt;br /&gt;
      desc   = &#039;whether this AI supports loading or not&#039;,&lt;br /&gt;
   },&lt;br /&gt;
   {&lt;br /&gt;
      key    = &#039;interfaceShortName&#039;,&lt;br /&gt;
      value  = &#039;Java&#039;, -- AI Interface name - !This comment is used for parsing!&lt;br /&gt;
      desc   = &#039;the shortName of the AI interface this AI needs&#039;,&lt;br /&gt;
   },&lt;br /&gt;
   {&lt;br /&gt;
      key    = &#039;interfaceVersion&#039;,&lt;br /&gt;
      value  = &#039;0.1&#039;, -- AI Interface version - !This comment is used for parsing!&lt;br /&gt;
      desc   = &#039;the minimum version of the AI interface required by this AI&#039;,&lt;br /&gt;
   },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return infos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The file describes a number of attributes. Each attribute has a key, a value and a desc(ription). The key is the name of the attribute, the description tells you what the attribute is used for, and the value is what you will want to edit.&lt;br /&gt;
&lt;br /&gt;
The shortName attribute is the name used for your AI internally. It&#039;s most logical to change this into to the same name you gave your AI class. (MyJavaAI.) The shortName needs to agree with the folder name (see below) and cannot contain the char &#039;_&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;version&#039; tells the engine which version of your AI this is. If you&#039;re in the 0.1 folder, make this 0.1. Your AI should be located at AI/Skirmish/&#039;&#039;shortName&#039;&#039;/&#039;&#039;version&#039;&#039;/.&lt;br /&gt;
&lt;br /&gt;
&#039;classname&#039; tells the interface which class is your AIFactory class. Take care that you use the fully qualified class name, or it won&#039;t work. In this example, this should be myjavaai.MyJavaAIFactory.&lt;br /&gt;
&lt;br /&gt;
&#039;name&#039; describes your AI to the user. In this example, you might put &#039;A simple Java AI to learn about AI programming in Spring.&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;loadSupported&#039; is rather self-explanatory. Since you have just started working on your AI, you may not get around to implementing loading support for some time, so it&#039;s best to put &#039;no,&#039; for now.&lt;br /&gt;
&lt;br /&gt;
&#039;interfaceShortName&#039; and &#039;interfaceversion&#039; tell the engine about the interface your AI uses. Since MyJavaAI uses the same interface as the NullOOJavaAI, leave these as they are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, the last thing you should do is exporting your AI to SkirmishAI.jar. The way to do this varies depending on your Java editor.&lt;br /&gt;
&lt;br /&gt;
=== Test your AI ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After following all the above steps, you should be able to run your AI. Either use SpringLobby to start a new game and see if you can add your AI as a bot, or run &#039;&#039;spring.exe&#039;&#039; to see if you can start the script MyJavaAI Test.&lt;br /&gt;
Of course, since you haven&#039;t told the AI what to do, your starting unit(s) will sit there doing nothing.&lt;br /&gt;
&lt;br /&gt;
== Getting your AI to Do Something ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After getting your AI running, you will want to make it do something. Traditionally, the first thing to get your AI to is to build a solar plant, assuming you want it to play BA. If not, it is quite straightforward to build other units once you have the general idea.&lt;br /&gt;
You will need four things to get your AI to build a solar plant:&lt;br /&gt;
* A reference to the callback&lt;br /&gt;
* A reference to the commander (your starting unit in BA)&lt;br /&gt;
* A reference to the solar plant definition object&lt;br /&gt;
* To tell the commander to build the solar plant&lt;br /&gt;
&lt;br /&gt;
However, before we go about building solar plants, first you should know about events. We will use these to get the required object references.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
&lt;br /&gt;
Nearly everything that happens in the game is an event. When a unit is created, this is an event. Enemy spotted? Also an event. A player sends your AI a message? You got it, this is an event as well.&lt;br /&gt;
&lt;br /&gt;
Every event is made known to your AI. Have a look at the &amp;lt;code&amp;gt;MyJavaAI&amp;lt;/code&amp;gt; class again. &amp;lt;code&amp;gt;MyJavaAI&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;AbstractOOA&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;AbstractOOAI&amp;lt;/code&amp;gt; implements a number of methods like &amp;lt;code&amp;gt;unitCreated()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;enemyEnterRadar()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;message()&amp;lt;/code&amp;gt;.&lt;br /&gt;
Sound familiar? The method &amp;lt;code&amp;gt;unitCreated(Unit unit, Unit builder)&amp;lt;/code&amp;gt; is called every time a unit is created, and tells you the unit that was created and the unit that built it. Similarly, enemyEnterRadar(Unit enemy) and message(int player, String message) tell you about an enemy unit entering radar range and receiving a message from another player respectively.&lt;br /&gt;
There are many other events that all have corresponding methods. To have your AI respond to these events, simply override the method in your &amp;lt;code&amp;gt;MyJavaAI&amp;lt;/code&amp;gt; class.&lt;br /&gt;
The return type of these methods is an integer. The return value can be used for debugging. 0 means that no errors occurred, while any other value is threated as an error. This system can be used for debugging, but is it much easier to implement proper logging.&lt;br /&gt;
&lt;br /&gt;
In the sections below you will see an example of the use of these events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Getting a reference to the callback ===&lt;br /&gt;
&lt;br /&gt;
The callback is the object through which the AI communicates with the engine. All information that does not change the state of the engine can be retrieved through individual methods in the callback, and state changing commands (eg to units) will go through a single, specialized method, which is in the callback as well.&lt;br /&gt;
Getting a reference to the callback is easy.&lt;br /&gt;
First create a class field &amp;lt;code&amp;gt;OOAICallback callback&amp;lt;/code&amp;gt; to put the reference in, then overwrite the method &amp;lt;code&amp;gt;init(int teamId, OOAICallback callback)&amp;lt;/code&amp;gt;. The init method is called at the start of every game (right at the end of the countdown).&lt;br /&gt;
As you can see, all that you need to do is set the parameter value callback to the field callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public int init(int teamId, OOAICallback callback)&lt;br /&gt;
{&lt;br /&gt;
    this.callback = callback;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting a reference to the commander ===&lt;br /&gt;
&lt;br /&gt;
Whenever a unit has been built, the engine sends a unitFinished event. At the start of the game, the engine will send a UnitFinished event for every starting unit. When playing BA, this means you will get a UnitFinished event for the commander. Therefore, the most straightforward way of finding the reference to the commander is overriding the &amp;lt;code&amp;gt;unitFinished()&amp;lt;/code&amp;gt; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public int unitFinished(Unit unit) {&lt;br /&gt;
    if (unit.getDef().getName().equals(&amp;quot;armcom&amp;quot;)) {&lt;br /&gt;
        commander = unit;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting a reference to the solar plant definition ===&lt;br /&gt;
&lt;br /&gt;
Every unit in Spring has a UnitDef (a &#039;unit defintion&#039;). This object tells you all there is to know about the properties of the unit type, such as maximum speed, turn rate and what weapons it carries.&lt;br /&gt;
One way to get the reference to the definition of a solar plant is to use &amp;lt;code&amp;gt;callback.getUnitDefs()&amp;lt;/code&amp;gt;. This will give you a list of all the available unit types in the game that is currently being played.&lt;br /&gt;
The name of the unit def we are looking for is &#039;armsolar&#039;, so we can just iterate through the list and find the one named armsolar, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
List&amp;lt;UnitDef&amp;gt; unitDefs = this.callback.getUnitDefs();&lt;br /&gt;
UnitDef solarPlant = null;&lt;br /&gt;
for (UnitDef def : unitDefs)&lt;br /&gt;
   if (def.getName().equals(&amp;quot;armsolar&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
       solarPlant = def;&lt;br /&gt;
       break;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Telling the commander to build the solar plant ===&lt;br /&gt;
&lt;br /&gt;
Now, the only thing left to do is to tell the commander that we want it to build the solar plant, and where to place it. In short, we need to give the commander a build command.&lt;br /&gt;
&lt;br /&gt;
We want to give this command only once at the first frame of the game. For this we can use the &amp;lt;code&amp;gt;update()&amp;lt;/code&amp;gt; method, which is called at every frame of the game. All we need to do is overwrite the &amp;lt;code&amp;gt;update(int frame)&amp;lt;/code&amp;gt; method and give the command if the frame is 1. This results in the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public int update(int frame)&lt;br /&gt;
{&lt;br /&gt;
    if (frame == 0)&lt;br /&gt;
    {&lt;br /&gt;
        // give command here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commands are issued by invoking the respective method on the &amp;lt;code&amp;gt;Unit&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;Group&amp;lt;/code&amp;gt;). In our case, that&#039;s the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; method, which takes the following arguments:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;UnitDef toBuildUnitDef&amp;lt;/code&amp;gt;: the kind of unit to build&lt;br /&gt;
* &amp;lt;code&amp;gt;AIFLoat3 buildPos&amp;lt;/code&amp;gt;: the location the unit should be built at (in our case, we use the commander&#039;s current position)&lt;br /&gt;
* &amp;lt;code&amp;gt;int facing&amp;lt;/code&amp;gt;: the direction the new unit will be facing (mostly matters for buildings, which can not turn after being constructed)&lt;br /&gt;
* &amp;lt;code&amp;gt;short options&amp;lt;/code&amp;gt;: a set of UnitCommandOptions. 0 means no option.&lt;br /&gt;
* &amp;lt;code&amp;gt;int timeout&amp;lt;/code&amp;gt;: the number of frames after which the command times out. We don&#039;t want a timeout, and therefore specify a suitably high number :-)&lt;br /&gt;
&lt;br /&gt;
Therefore, our command looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    commander.build(solarDef, commander.getPos(), 0, (short) 0, Integer.MAX_VALUE);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point you will want to see if your AI actually works. Export your code to &#039;&#039;Spring/AI/Skirmish/MyJavaAI/SkirmishAI.jar&#039;&#039; and start up a game. Your AI should now build a solar plant at its start position.&lt;br /&gt;
&lt;br /&gt;
===Building a metal extractor===&lt;br /&gt;
Building a metal extractor is slightly more complicated. Assuming you&#039;re not on a metal map, you will need to find a suitable site to place the extractor. Generally, it&#039;s preferable to select a site closest to wherever your construction unit (commander) is located.&lt;br /&gt;
&lt;br /&gt;
Modify your code that got a reference to the solar plant by making the following changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
List&amp;lt;UnitDef&amp;gt; unitDefs = this.callback.getUnitDefs(); UnitDef solarPlant = null; for (UnitDef def : unitDefs)&lt;br /&gt;
&lt;br /&gt;
  if (def.getName().equals(&amp;quot;armsolar&amp;quot;))&lt;br /&gt;
  {&lt;br /&gt;
      solarPlant = def;&lt;br /&gt;
  }&lt;br /&gt;
  else if (def.getName().equals(&amp;quot;armmex&amp;quot;))&lt;br /&gt;
  {&lt;br /&gt;
       metalExtractor=def;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, you will need to create a Unitdef metalExtractor field by where you declared your solarPlant field.&lt;br /&gt;
&lt;br /&gt;
Next, you need a method for determining the distance between two 3D coordinates (since Spring locations are three dimensional). A slightly modified version of a distance function is found below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
public float calculateDistance(AIFloat3 a, AIFloat3 b)&lt;br /&gt;
    {&lt;br /&gt;
    float xDistance = a.x - b.x;&lt;br /&gt;
    float yDistance = a.y - b.y;&lt;br /&gt;
    float zDistance = a.z - b.z;&lt;br /&gt;
    float totalDistanceSquared = xDistance*xDistance + yDistance*yDistance + zDistance*zDistance;&lt;br /&gt;
    return totalDistanceSquared;&lt;br /&gt;
    } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code actually returns the distance squared, but it will work for our purposes. In your init function, you will want to add the following code above the return statement but below the line defining the callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
checkForMetal();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will call the following function you need to place in your code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
public void checkForMetal()&lt;br /&gt;
    {&lt;br /&gt;
    Resource metal=Resource.getInstance(clb, 0);&lt;br /&gt;
    availablemetalspots=clb.getMap().getResourceMapSpotsPositions(metal);&lt;br /&gt;
    if(availablemetalspots.isEmpty())&lt;br /&gt;
        {&lt;br /&gt;
        sendTextMsg(&amp;quot;This is a map with no metal spots&amp;quot;);&lt;br /&gt;
        metalmap=false;&lt;br /&gt;
        }&lt;br /&gt;
    else&lt;br /&gt;
        {metalmap=true;&lt;br /&gt;
        sendTextMsg(&amp;quot;This is a map with metal spots. Listing Values...&amp;quot;);&lt;br /&gt;
        for (AIFloat3 metalspot : availablemetalspots) {&lt;br /&gt;
            sendTextMsg(&amp;quot;Metal Spot at X: &amp;quot;+metalspot.x + &amp;quot;, Y: &amp;quot;+metalspot.y +&amp;quot;, Z: &amp;quot;+metalspot.z);&lt;br /&gt;
        }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above code to function properly, you will need to create a Boolean named metalmap and a List&amp;lt;AIFloat3&amp;gt; availablemetalspots. You will now have a function set up for calculating distance between two points, and a data structure holding a list of positions of metal spots. The next step is to tie these two together:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
public AIFloat3 closestMetalSpot(AIFloat3 unitposition)&lt;br /&gt;
    {&lt;br /&gt;
    AIFloat3 closestspot=null;&lt;br /&gt;
    for (AIFloat3 metalspot : availablemetalspots) {&lt;br /&gt;
            if (closestspot==null)&lt;br /&gt;
                {&lt;br /&gt;
                closestspot=metalspot;&lt;br /&gt;
                }&lt;br /&gt;
        else if(calculateDistance(metalspot, unitposition) &amp;lt; calculateDistance(closestspot, unitposition) &amp;amp;&amp;amp; metalspot.hashCode()!=unitposition.hashCode())&lt;br /&gt;
                    {&lt;br /&gt;
                    closestspot=metalspot;&lt;br /&gt;
                    }&lt;br /&gt;
        }&lt;br /&gt;
    availablemetalspots.remove(closestspot);&lt;br /&gt;
    return closestspot;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above function accepts an AIFloat3 containing the location of your construction unit (commander). It will then find the closest metal spot and return that location. The next step is to have your commander make use of this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
  if (frame == 600)&lt;br /&gt;
  {&lt;br /&gt;
       if(metalmap){       sendTextMsg(&amp;quot;About to build mex at frame &amp;quot; + frame);&lt;br /&gt;
       AIFloat3 closestspot=closestMetalSpot(commander.getPos());&lt;br /&gt;
       commander.build(metalExtractor, closestspot, 0, (short) 0, Integer.MAX_VALUE);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Place the above code in your update() method. When the frame count reaches 600, your commander will start to build a metal extractor at the closest metal spot. The extractor may not be right on top of where the metal spot appears to be, but you can mouse over the extractor to make sure it&#039;s drawing the metal properly.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Q:&#039;&#039;&#039; What is the difference between &amp;lt;code&amp;gt;unitCreated()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;unitFinished()&amp;lt;/code&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; The difference is that &amp;lt;code&amp;gt;unitCreated()&amp;lt;/code&amp;gt; is called when construction of a unit starts, while &amp;lt;code&amp;gt;unitFinished()&amp;lt;/code&amp;gt; when construction on the unit has been completed. Any number of things may happen in-between, including the unit under construction being destroyed, so it is important to remember this distinction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Q:&#039;&#039;&#039; Do I have to copy and paste my jar file to the directory in Spring/AI/Skirmish/MyAI/0.1 each time I want to test my AI out?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Yes, but it is much easier if you automate the process. In Windows, a simple batch file can be created to move the files over for you. For example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
copy C:\Users\msm8bball\Documents\NetBeansProjects\MyAI\dist\MyAI.jar &amp;quot;C:\Program Files (x86)\Spring\AI\Skirmish\MyAI\0.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
del &amp;quot;C:\Program Files (x86)\Spring\AI\Skirmish\MyAI\0.1\SkirmishAI.jar&amp;quot;&lt;br /&gt;
rename &amp;quot;C:\Program Files (x86)\Spring\AI\Skirmish\MyAI\0.1\MyAI.jar&amp;quot; SkirmishAI.jar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify the above code to match your computer&#039;s directories. Place it in a text file and save it as MoveAI.bat. This will create a batch file that you can double click and it will automatically move your AI to the proper location and rename it. You might wish to put a shortcut to this in your Start menu or taskbar. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Q:&#039;&#039;&#039; I have problems with the class-loader in my AI, any idea? &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Each Java AI implementation is loaded by a separate class loader. This is used to load all the AI&#039;s class files and dependency libraries (in the &#039;&#039;jlib&#039;&#039; dir). Some libraries though, use the Thread contexts class loader, instead of the one of the current class. Therefore, if you want to load something from the AI&#039;s own class-path, make sure to let these libraries use the class-path of your AI classes, eg:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ClassLoader myClassLoader = AIFactory.class.getClassLoader();&lt;br /&gt;
MySpecialUtil msp = new MySpecialUtil();&lt;br /&gt;
msp.setClassLoader(myClassLoader);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Please do not set this class-loader on the thread with &amp;lt;code&amp;gt;Thread.currentThread().setContextClassLoader(myClassLoader)&amp;lt;/code&amp;gt;, because all AI&#039;s are run in the same Java thread, and therefore this will cause problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [[AIInterface:Java|Java AI Interface]]&lt;br /&gt;
* [https://springrts.com/dl/buildbot/doc/100.0.1-225-ga4855e7/JavaOO/ Javadoc of the Java AI OO Wrapper]&lt;br /&gt;
* &#039;&#039;&#039;OUTDATED&#039;&#039;&#039; [http://springrts.com/phpbb/download/file.php?id=4970 Netbeans Java Skirmish AI Tutorial] (from [http://springrts.com/phpbb/viewtopic.php?p=448743#p448743 this forum thread])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=558</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=558"/>
		<updated>2014-10-22T23:45:09Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
This section gives help on how to create Artificial Intelligence agents that control teams (as if a player) - &amp;quot;Skirmish AI&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The SpringRTS engine interacts with the Skirmish AIs through an &amp;quot;Interface&amp;quot;. There are stable (10-2014, Spring v98) interfaces for the languages C/C++ and Java (not currently sure about the others but I think Lua too).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example Skirmish AI:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039; &#039;&#039;(up-to-date as of 10-2014, SpringRTS v98)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:TheMaps|The mappings provided by the AI Interface]]&#039;&#039;&#039; - how the engine maps the game area and how the interface exposes those maps.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:MonitorAndDebug|How to monitor and debug your Skirmish AI]]&#039;&#039;&#039; - How to monitor and debug your Skirmish AI.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the Skirmish AIs that have already been developed for SpringRTS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overall AI ideas, practical examples, useful resources==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:GameInferences|Useful inferences]]&#039;&#039;&#039; - how to infer where the opponents might have started, where on the maps can your units go, etc..&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other hints, tips and interesting infos ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; AI &amp;quot;frame skipping&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?p=463953#p463953&amp;lt;br&amp;gt;&lt;br /&gt;
As in: if a Java/C/C++ SkirmishAI gets delayed responding back to the Interface, the SpringRTS engine will wait on the AI. Thus delaying the game, thus not having the AI &amp;quot;skip&amp;quot; frames.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Engine commands to control the AIs&#039;&#039;&#039;&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]&#039;&#039;&#039;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall say that only it once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Link to source code of the Interface, engine-side&#039;&#039;&#039;&lt;br /&gt;
Chances are you&#039;ll have doubts about what exactly the commands abc(), qwe() or xyz() do. Asking in the AI forum is a good way to clarify. The most reliable is probably to look at the source code (if you&#039;re able to navigate the maze of C++ code in all its glory, that is):&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.h&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.cpp&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=557</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=557"/>
		<updated>2014-10-22T22:38:32Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my development environment. What now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
This section gives help on how to create Artificial Intelligence agents that control teams (as if a player) - &amp;quot;Skirmish AI&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The SpringRTS engine interacts with the Skirmish AIs through an &amp;quot;Interface&amp;quot;. There are stable (10-2014, Spring v98) interfaces for the languages C/C++ and Java (not currently sure about the others but I think Lua too).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example Skirmish AI:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039; &#039;&#039;(up-to-date as of 10-2014, SpringRTS v98)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:TheMaps|The mappings provided by the AI Interface]]&#039;&#039;&#039; - how the engine maps the game area and how the interface exposes those maps.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:MonitorAndDebug|How to monitor and debug your Skirmish AI]]&#039;&#039;&#039; - How to monitor and debug your Skirmish AI.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the Skirmish AIs that have already been developed for SpringRTS.&lt;br /&gt;
&lt;br /&gt;
==Overall AI ideas, practical examples, useful resources==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:GameInferences|Useful inferences]]&#039;&#039;&#039; - how to infer where the opponents might have started, where on the maps can your units go, etc..&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other hints, tips and interesting infos ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; AI &amp;quot;frame skipping&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?p=463953#p463953&amp;lt;br&amp;gt;&lt;br /&gt;
As in: if a Java/C/C++ SkirmishAI gets delayed responding back to the Interface, the SpringRTS engine will wait on the AI. Thus delaying the game, thus not having the AI &amp;quot;skip&amp;quot; frames.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Engine commands to control the AIs&#039;&#039;&#039;&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]&#039;&#039;&#039;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall say that only it once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Link to source code of the Interface, engine-side&#039;&#039;&#039;&lt;br /&gt;
Chances are you&#039;ll have doubts about what exactly the commands abc(), qwe() or xyz() do. Asking in the AI forum is a good way to clarify. The most reliable is probably to look at the source code (if you&#039;re able to navigate the maze of C++ code in all its glory, that is):&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.h&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.cpp&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=932</id>
		<title>AI:Links</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=932"/>
		<updated>2014-10-22T22:37:44Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=AI Links=&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AI_Research | Another &amp;quot;AI Research&amp;quot; wiki page]]&#039;&#039;&#039;: Another page of similar content (likely lack of syncronization between people editing).&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-370-the-battlecode-programming-competition-january-iap-2013/lecture-videos/ MIT lectures on developing RTS AIs]&#039;&#039;&#039;: Videos of MIT lectures for the class Battlecode (developing AIs for an in-house RTS).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.darkstars.co.uk Darkstars]&#039;&#039;&#039;: AF&#039;s main site, has a lot of theory on it, including details of his NTai project&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=539 5 Matrix AI 1,2,3]&#039;&#039;&#039;: A thread discussing Triaxx&#039; theory and plans for his AI 5 matrix AI/Wormhole AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2752&amp;amp;highlight= &amp;quot;Research about Pathfinding, AI and Voronoi diagrams&amp;quot;]&#039;&#039;&#039;: A forum post by Gabba.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=4326 Academic research papers on AI in RTS games]&#039;&#039;&#039;: A forum post by NeuronExMachina.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AIResearch | AI research Material]]&#039;&#039;&#039;: Research links to articles and documents about AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=greedyAlg Greedy is good]&#039;&#039;&#039;: Greedy is good tutorial at topcoder.com&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=graphsDataStrucs1 Graph and data structures]&#039;&#039;&#039;: Graph and data structures tutorial at topcoder.com. This includes path-finding using bfs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AI:HughsUnitGroupingHeuristic|Unit grouping heuristic]]&#039;&#039;&#039;: Unit grouping and reorg heuristic by Hugh Perkins&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/optimizing-30000-ships-in-realtime-in-c.html Optimizing 30,000+ Ships In Realtime In C#]&#039;&#039;&#039;: Lead developer of game AI Wars discusses performance considerations for his RTS handling 30K+ units. Mostly good ideas on how to build a performance RTS engine but also some ideas applicable on how to make a performant AI agent, like working with fixed-ints rather than floats (especially for sync issues between different computers) or imperfect range checks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/07/range-checks-approximation-vs-accurate.html Range Checks - Approximation vs Accurate]&#039;&#039;&#039;: Lead developer of game AI Wars discusses how to improve performance of range checks at the cost of accuracy, which also raises the question of whether we really need 100% accurate range checks always/most times/ever in an AI agent. He states (other post) that range checks was the largest consumer of CPU in the alpha version of the game. He describes how he used an alternative that doesn&#039;t use the expensive SquareRoot math calculation.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/designing-emergent-ai-part-1.html Designing Emergent AI, Part 1: An Introduction]&#039;&#039;&#039;: Lead developer of game AI Wars explains how the game&#039;s AI works - essentially an overview of how to conceptually construct an AI agent for RTSs. A good resource on how to start going at building an AI agent for an RTS.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; [[Main_Page|&amp;lt;- Back to Main page page]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=931</id>
		<title>AI:Links</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=931"/>
		<updated>2014-10-22T22:33:45Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=AI Links=&lt;br /&gt;
&lt;br /&gt;
===Development/Research===&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-370-the-battlecode-programming-competition-january-iap-2013/lecture-videos/ MIT lectures on developing RTS AIs]&#039;&#039;&#039;: Videos of MIT lectures for the class Battlecode (developing AIs for an in-house RTS).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.darkstars.co.uk Darkstars]&#039;&#039;&#039;: AF&#039;s main site, has a lot of theory on it, including details of his NTai project&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=539 5 Matrix AI 1,2,3]&#039;&#039;&#039;: A thread discussing Triaxx&#039; theory and plans for his AI 5 matrix AI/Wormhole AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2752&amp;amp;highlight= &amp;quot;Research about Pathfinding, AI and Voronoi diagrams&amp;quot;]&#039;&#039;&#039;: A forum post by Gabba.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=4326 Academic research papers on AI in RTS games]&#039;&#039;&#039;: A forum post by NeuronExMachina.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AIResearch | AI research Material]]&#039;&#039;&#039;: Research links to articles and documents about AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=greedyAlg Greedy is good]&#039;&#039;&#039;: Greedy is good tutorial at topcoder.com&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=graphsDataStrucs1 Graph and data structures]&#039;&#039;&#039;: Graph and data structures tutorial at topcoder.com. This includes path-finding using bfs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AI:HughsUnitGroupingHeuristic|Unit grouping heuristic]]&#039;&#039;&#039;: Unit grouping and reorg heuristic by Hugh Perkins&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/optimizing-30000-ships-in-realtime-in-c.html Optimizing 30,000+ Ships In Realtime In C#]&#039;&#039;&#039;: Lead developer of game AI Wars discusses performance considerations for his RTS handling 30K+ units. Mostly good ideas on how to build a performance RTS engine but also some ideas applicable on how to make a performant AI agent, like working with fixed-ints rather than floats (especially for sync issues between different computers) or imperfect range checks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/07/range-checks-approximation-vs-accurate.html Range Checks - Approximation vs Accurate]&#039;&#039;&#039;: Lead developer of game AI Wars discusses how to improve performance of range checks at the cost of accuracy, which also raises the question of whether we really need 100% accurate range checks always/most times/ever in an AI agent. He states (other post) that range checks was the largest consumer of CPU in the alpha version of the game. He describes how he used an alternative that doesn&#039;t use the expensive SquareRoot math calculation.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/designing-emergent-ai-part-1.html Designing Emergent AI, Part 1: An Introduction]&#039;&#039;&#039;: Lead developer of game AI Wars explains how the game&#039;s AI works - essentially an overview of how to conceptually construct an AI agent for RTSs. A good resource on how to start going at building an AI agent for an RTS.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; [[Main_Page|&amp;lt;- Back to Main page page]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=556</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=556"/>
		<updated>2014-10-22T22:28:17Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Restructure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
This section gives help on how to create Artificial Intelligence agents that control teams (as if a player) - &amp;quot;Skirmish AI&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The SpringRTS engine interacts with the Skirmish AIs through an &amp;quot;Interface&amp;quot;. There are stable (10-2014, Spring v98) interfaces for the languages C/C++ and Java (not currently sure about the others but I think Lua too).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example Skirmish AI:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039; &#039;&#039;(up-to-date as of 10-2014, SpringRTS v98)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:TheMaps|The maps provided by the AI Interface]]&#039;&#039;&#039; - how the engine maps the game area and how the interface exposes those maps.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:MonitorAndDebug|How to monitor and debug your Skirmish AI]]&#039;&#039;&#039; - How to monitor and debug your Skirmish AI.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the Skirmish AIs that have already been developed for SpringRTS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overall AI ideas, practical examples, useful resources==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:GameInferences|Useful inferences]]&#039;&#039;&#039; - how to infer where the opponents might have started, where on the maps can your units go, etc..&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development.&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other hints, tips and interesting infos ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; AI &amp;quot;frame skipping&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?p=463953#p463953&amp;lt;br&amp;gt;&lt;br /&gt;
As in: if a Java/C/C++ SkirmishAI gets delayed responding back to the Interface, the SpringRTS engine will wait on the AI. Thus delaying the game, thus not having the AI &amp;quot;skip&amp;quot; frames.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Engine commands to control the AIs&#039;&#039;&#039;&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]&#039;&#039;&#039;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall say that only it once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039; Link to source code of the Interface, engine-side&#039;&#039;&#039;&lt;br /&gt;
Chances are you&#039;ll have doubts about what exactly the commands abc(), qwe() or xyz() do. Asking in the AI forum is a good way to clarify. The most reliable is probably to look at the source code (if you&#039;re able to navigate the maze of C++ code in all its glory, that is):&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.h&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.cpp&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=714</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=714"/>
		<updated>2014-10-22T22:24:59Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Section moved somewhere else&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying for all opponents&#039; units will respond with all enemy units even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends a message to all players warning the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; event.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed to SpringRTS when the lobby invokes it. On start, the SpringRTS engine will then parse that script for instructions on what maps to load, etc., and which starting positions to use. In Linux, that script should be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;br /&gt;
&lt;br /&gt;
=Infer map traversability=&lt;br /&gt;
How to infer where in the map each unit can pass through. Usually a submarine won&#039;t be able to go inland and a tank won&#039;t be able to climb mountains.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO&amp;lt;br&amp;gt;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32665&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:MonitorAndDebug&amp;diff=687</id>
		<title>AI:Development:MonitorAndDebug</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:MonitorAndDebug&amp;diff=687"/>
		<updated>2014-10-22T21:59:51Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[AI:Development|AI Development]] &amp;lt; AI Development - Monitor and Debug&lt;br /&gt;
&lt;br /&gt;
=How to monitor and debug your Skirmish AI=&lt;br /&gt;
You will probably want to monitor what&#039;s is happening in the execution and need some form of debugging. This page describes a few options that can be implemented to monitor an AI.&lt;br /&gt;
&lt;br /&gt;
All code examples are using the Java interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Print a text message ingame ==&lt;br /&gt;
From the interface, you can request the &amp;quot;Game&amp;quot; object to &amp;quot;sendTextMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
_Callback.getGame().sendTextMessage (...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will display a text message to all players just like when a player hits &amp;quot;enter&amp;quot;, types something, then hits &amp;quot;enter&amp;quot; again.&lt;br /&gt;
&lt;br /&gt;
Whatever is sent to that method will show up in the game&#039;s GUI but it will also end up logged in the engine&#039;s log file. In Linux, it will be: &amp;lt;code&amp;gt;~/.config/spring/infolog.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Write to the engine&#039;s log ==&lt;br /&gt;
You can access a &amp;quot;log&amp;quot; from the Interface and send messages to it.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
_Callback.getLog ().log (msg);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing this .. appears to have the exact same effect as the previous option...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Write to a custom log ==&lt;br /&gt;
SpringRTS is built to run on a variety of different system (Linux, Windows and Mac), each with its own filesystems. Using the Interface you can obtain an appropriate path for the AI to create a log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
String logFilePath = _Callback.getDataDirs ().allocatePath (&amp;quot;PI_P&amp;quot; + _TeamID + &amp;quot;.txt&amp;quot;, &lt;br /&gt;
								true, true, false, false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would return a path like like: &amp;lt;code&amp;gt;/home/paulo/.config/spring/AI/Skirmish/PoucoInteligente/1/PI_P0.txt&amp;lt;/code&amp;gt; which you can use to create a log file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Draw a window ==&lt;br /&gt;
An extremely powerfull option to have visibility over what&#039;s happening in the game in realtime is to draw whatever you want into another window. For example, create a JFrame window (Java) and draw into it a minimap of LineOfSight.&lt;br /&gt;
&lt;br /&gt;
The existing AI zkgbai has code which can be learnt from (or reused) to create a new separate window and to draw a minimap into it.&lt;br /&gt;
&lt;br /&gt;
The AI&#039;s class &amp;quot;LosManager&amp;quot; draws a minimap of the LineOfSight, creating an &amp;quot;Image&amp;quot; object:&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/Anarchid/zkgbai/blob/master/src/zkgbai/los/LosManager.java&amp;lt;br&amp;gt;&lt;br /&gt;
The AI&#039;s class &amp;quot;DebugView&amp;quot; is the separate window itself and paints &amp;quot;Image&amp;quot; objects - the AI then creates a &amp;lt;code&amp;gt;new DebugView (...)&amp;lt;/code&amp;gt; and hands it over the desired images (like a LOS minimap).&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/Anarchid/zkgbai/blob/master/src/zkgbai/gui/DebugView.java&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Runtime debugging with the JDK/IDE  ==&lt;br /&gt;
TODO: Don&#039;t even know yet if this is possible or even how it interacts with the engine (will Spring crash or timeout waiting for a response from the Interface???).&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:TheMaps&amp;diff=705</id>
		<title>AI:Development:TheMaps</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:TheMaps&amp;diff=705"/>
		<updated>2014-10-22T21:59:37Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[AI:Development|AI Development]] &amp;lt; AI Development - The maps&lt;br /&gt;
&lt;br /&gt;
=The maps provided by the AI Interface=&lt;br /&gt;
The SpringRTS engine has a 3 Dimensional game area (x; y; z) but it works by mapping the dimensions X and Z (the ones we see when looking from above) into several bi-demensional &amp;quot;maps&amp;quot;, each representing a different game mechanic. This page describes how the Interface exposes those maps to the AI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Maps available ==&lt;br /&gt;
The game area is broken down into (at least) these maps:&lt;br /&gt;
* HeightMap - map of terrain heights.&lt;br /&gt;
* SlopeMap - TODO&lt;br /&gt;
* CornersHeightMap - TODO (complicated...)&lt;br /&gt;
* LosMap - map of where in the game area you have visibility (Line of Sight).&lt;br /&gt;
* RadarMap - map of where in the game area you have radar coverage.&lt;br /&gt;
* JammerMap - map of where in the game area you have radar-jamming coverage.&lt;br /&gt;
* ResourceMapRaw - map of where in the game area there is metal and/or other resources.&lt;br /&gt;
Additionally, there&#039;s the game area which is where the units will exist, but is not &amp;quot;mapped&amp;quot; - units will be at position (x; y; z) in the game area but no map for it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Interface exposure ==&lt;br /&gt;
Each of the maps is bi-demensional (x; z), representing the dimensions &amp;quot;x&amp;quot; and &amp;quot;z&amp;quot; of the game area (x; y; z). However, the Interface exposes each map as a &#039;&#039;&#039;list&#039;&#039;&#039; of values.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;List&amp;lt;float&amp;gt; heightMap = _Callback.getMap().getHeightMap();&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
This list will contain each row (dimension X) sequentially (Z0, Z1, Z2, ...). Therefore, each position &amp;lt;code&amp;gt;(x;z)&amp;lt;/code&amp;gt; of each map will exist in the list at the index &amp;lt;code&amp;gt;(x + z * {map&#039;s width})&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Granularities ==&lt;br /&gt;
The game areas are large battlefields and the engine does not map them unit by unit. Instead it breaks down the game area in blocks - &amp;quot;granularity&amp;quot; (http://en.wikipedia.org/wiki/Granularity) - creating maps much smaller than the game area. Additionally, each map has a different granularity and, thus, a different size.&lt;br /&gt;
&lt;br /&gt;
The map HeightMap should be considered the main map and the sizes of all other maps (as described in the documentation) are relative to the size of that map.&lt;br /&gt;
&lt;br /&gt;
* HeightMap - main map (ex: 256x256)&lt;br /&gt;
* Game area - the game area will be the HeightMap * 8 (ex: 2048x2048)&lt;br /&gt;
* SlopeMap - 1/2 the size of the HeightMap (ex: 128x128)&lt;br /&gt;
* CornersHeightMap - TODO (complicated...)&lt;br /&gt;
* LosMap - size is variable per mod: see below&lt;br /&gt;
* RadarMap - 1/8 the size of the HeightMap (ex: 32x32)&lt;br /&gt;
* JammerMap - 1/8 the size of the HeightMap (ex: 32x32)&lt;br /&gt;
* ResourceMapRaw - 1/2 the size of the HeightMap (ex: 128x128)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LosMap ==&lt;br /&gt;
The map of Line-of-sight has a granularity that is specified per game (&amp;quot;mod&amp;quot;). Each &amp;quot;mod&amp;quot; will specify the property LosMipLevel:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;int losMipLevel = _Callback.getMod().getLosMipLevel();&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Raising 2 to the &amp;quot;power&amp;quot; of LosMipLevel will give the relation of the size of LosMap to the HeightMap.&amp;lt;br&amp;gt;&lt;br /&gt;
Ex:&amp;lt;br&amp;gt;&lt;br /&gt;
# LosMipLevel=0 | 2^0 = &#039;&#039;&#039;1&#039;&#039;&#039; | Size of the LosMap = size of HeightMap * 1/&#039;&#039;&#039;1&#039;&#039;&#039;&lt;br /&gt;
# LosMipLevel=1 | 2^1 = &#039;&#039;&#039;2&#039;&#039;&#039; | Size of the LosMap = size of HeightMap * 1/&#039;&#039;&#039;2&#039;&#039;&#039;&lt;br /&gt;
# LosMipLevel=2 | 2^2 = &#039;&#039;&#039;4&#039;&#039;&#039; | Size of the LosMap = size of HeightMap * 1/&#039;&#039;&#039;4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32674&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:TheMaps&amp;diff=704</id>
		<title>AI:Development:TheMaps</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:TheMaps&amp;diff=704"/>
		<updated>2014-10-22T21:56:52Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Full content creation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[AI:Development|AI Development]] &amp;lt; AI Development - The maps&lt;br /&gt;
&lt;br /&gt;
=The maps provided by the Interface=&lt;br /&gt;
The SpringRTS engine has a 3 Dimensional game area (x; y; z) but it works by mapping the dimensions X and Z (the ones we see when looking from above) into several bi-demensional &amp;quot;maps&amp;quot;, each representing a different game mechanic. This page describes how the Interface exposes those maps to the AI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Maps available ==&lt;br /&gt;
The game area is broken down into (at least) these maps:&lt;br /&gt;
* HeightMap - map of terrain heights.&lt;br /&gt;
* SlopeMap - TODO&lt;br /&gt;
* CornersHeightMap - TODO (complicated...)&lt;br /&gt;
* LosMap - map of where in the game area you have visibility (Line of Sight).&lt;br /&gt;
* RadarMap - map of where in the game area you have radar coverage.&lt;br /&gt;
* JammerMap - map of where in the game area you have radar-jamming coverage.&lt;br /&gt;
* ResourceMapRaw - map of where in the game area there is metal and/or other resources.&lt;br /&gt;
Additionally, there&#039;s the game area which is where the units will exist, but is not &amp;quot;mapped&amp;quot; - units will be at position (x; y; z) in the game area but no map for it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Interface exposure ==&lt;br /&gt;
Each of the maps is bi-demensional (x; z), representing the dimensions &amp;quot;x&amp;quot; and &amp;quot;z&amp;quot; of the game area (x; y; z). However, the Interface exposes each map as a &#039;&#039;&#039;list&#039;&#039;&#039; of values.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;List&amp;lt;float&amp;gt; heightMap = _Callback.getMap().getHeightMap();&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
This list will contain each row (dimension X) sequentially (Z0, Z1, Z2, ...). Therefore, each position &amp;lt;code&amp;gt;(x;z)&amp;lt;/code&amp;gt; of each map will exist in the list at the index &amp;lt;code&amp;gt;(x + z * {map&#039;s width})&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Granularities ==&lt;br /&gt;
The game areas are large battlefields and the engine does not map them unit by unit. Instead it breaks down the game area in blocks - &amp;quot;granularity&amp;quot; (http://en.wikipedia.org/wiki/Granularity) - creating maps much smaller than the game area. Additionally, each map has a different granularity and, thus, a different size.&lt;br /&gt;
&lt;br /&gt;
The map HeightMap should be considered the main map and the sizes of all other maps (as described in the documentation) are relative to the size of that map.&lt;br /&gt;
&lt;br /&gt;
* HeightMap - main map (ex: 256x256)&lt;br /&gt;
* Game area - the game area will be the HeightMap * 8 (ex: 2048x2048)&lt;br /&gt;
* SlopeMap - 1/2 the size of the HeightMap (ex: 128x128)&lt;br /&gt;
* CornersHeightMap - TODO (complicated...)&lt;br /&gt;
* LosMap - size is variable per mod: see below&lt;br /&gt;
* RadarMap - 1/8 the size of the HeightMap (ex: 32x32)&lt;br /&gt;
* JammerMap - 1/8 the size of the HeightMap (ex: 32x32)&lt;br /&gt;
* ResourceMapRaw - 1/2 the size of the HeightMap (ex: 128x128)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LosMap ==&lt;br /&gt;
The map of Line-of-sight has a granularity that is specified per game (&amp;quot;mod&amp;quot;). Each &amp;quot;mod&amp;quot; will specify the property LosMipLevel:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;int losMipLevel = _Callback.getMod().getLosMipLevel();&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Raising 2 to the &amp;quot;power&amp;quot; of LosMipLevel will give the relation of the size of LosMap to the HeightMap.&amp;lt;br&amp;gt;&lt;br /&gt;
Ex:&amp;lt;br&amp;gt;&lt;br /&gt;
# LosMipLevel=0 | 2^0 = &#039;&#039;&#039;1&#039;&#039;&#039; | Size of the LosMap = size of HeightMap * 1/&#039;&#039;&#039;1&#039;&#039;&#039;&lt;br /&gt;
# LosMipLevel=1 | 2^1 = &#039;&#039;&#039;2&#039;&#039;&#039; | Size of the LosMap = size of HeightMap * 1/&#039;&#039;&#039;2&#039;&#039;&#039;&lt;br /&gt;
# LosMipLevel=2 | 2^2 = &#039;&#039;&#039;4&#039;&#039;&#039; | Size of the LosMap = size of HeightMap * 1/&#039;&#039;&#039;4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32674&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:TheMaps&amp;diff=703</id>
		<title>AI:Development:TheMaps</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:TheMaps&amp;diff=703"/>
		<updated>2014-10-22T19:36:41Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Inception - just page creation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[AI:Development|AI Development]] &amp;lt; AI Development - The maps&lt;br /&gt;
&lt;br /&gt;
=The maps provided by the Interface=&lt;br /&gt;
The SpringRTS engine maps the game area into several different maps. This page describes how the Interface exposes those maps to the AI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sizes / granularities ==&lt;br /&gt;
TODO:&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:MonitorAndDebug&amp;diff=686</id>
		<title>AI:Development:MonitorAndDebug</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:MonitorAndDebug&amp;diff=686"/>
		<updated>2014-10-22T19:29:19Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[AI:Development|AI Development]] &amp;lt; AI Development - Monitor and Debug&lt;br /&gt;
&lt;br /&gt;
=How to monitor and debug your AI=&lt;br /&gt;
You will probably want to monitor what&#039;s is happening in the execution and need some form of debugging. This page describes a few options that can be implemented to monitor an AI.&lt;br /&gt;
&lt;br /&gt;
All code examples are using the Java interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Print a text message ingame ==&lt;br /&gt;
From the interface, you can request the &amp;quot;Game&amp;quot; object to &amp;quot;sendTextMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
_Callback.getGame().sendTextMessage (...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will display a text message to all players just like when a player hits &amp;quot;enter&amp;quot;, types something, then hits &amp;quot;enter&amp;quot; again.&lt;br /&gt;
&lt;br /&gt;
Whatever is sent to that method will show up in the game&#039;s GUI but it will also end up logged in the engine&#039;s log file. In Linux, it will be: &amp;lt;code&amp;gt;~/.config/spring/infolog.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Write to the engine&#039;s log ==&lt;br /&gt;
You can access a &amp;quot;log&amp;quot; from the Interface and send messages to it.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
_Callback.getLog ().log (msg);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing this .. appears to have the exact same effect as the previous option...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Write to a custom log ==&lt;br /&gt;
SpringRTS is built to run on a variety of different system (Linux, Windows and Mac), each with its own filesystems. Using the Interface you can obtain an appropriate path for the AI to create a log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
String logFilePath = _Callback.getDataDirs ().allocatePath (&amp;quot;PI_P&amp;quot; + _TeamID + &amp;quot;.txt&amp;quot;, &lt;br /&gt;
								true, true, false, false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would return a path like like: &amp;lt;code&amp;gt;/home/paulo/.config/spring/AI/Skirmish/PoucoInteligente/1/PI_P0.txt&amp;lt;/code&amp;gt; which you can use to create a log file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Draw a window ==&lt;br /&gt;
An extremely powerfull option to have visibility over what&#039;s happening in the game in realtime is to draw whatever you want into another window. For example, create a JFrame window (Java) and draw into it a minimap of LineOfSight.&lt;br /&gt;
&lt;br /&gt;
The existing AI zkgbai has code which can be learnt from (or reused) to create a new separate window and to draw a minimap into it.&lt;br /&gt;
&lt;br /&gt;
The AI&#039;s class &amp;quot;LosManager&amp;quot; draws a minimap of the LineOfSight, creating an &amp;quot;Image&amp;quot; object:&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/Anarchid/zkgbai/blob/master/src/zkgbai/los/LosManager.java&amp;lt;br&amp;gt;&lt;br /&gt;
The AI&#039;s class &amp;quot;DebugView&amp;quot; is the separate window itself and paints &amp;quot;Image&amp;quot; objects - the AI then creates a &amp;lt;code&amp;gt;new DebugView (...)&amp;lt;/code&amp;gt; and hands it over the desired images (like a LOS minimap).&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/Anarchid/zkgbai/blob/master/src/zkgbai/gui/DebugView.java&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Runtime debugging with the JDK/IDE  ==&lt;br /&gt;
TODO: Don&#039;t even know yet if this is possible or even how it interacts with the engine (will Spring crash or timeout waiting for a response from the Interface???).&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:MonitorAndDebug&amp;diff=685</id>
		<title>AI:Development:MonitorAndDebug</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development:MonitorAndDebug&amp;diff=685"/>
		<updated>2014-10-22T19:25:30Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Inception&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[AI:Development|AI Development]] &amp;lt; AI Development - Monitor and Debug&lt;br /&gt;
&lt;br /&gt;
=How to monitor and debug your AI=&lt;br /&gt;
You will probably want to monitor what&#039;s is happening in the execution and need some form of debugging. This page describes a few options that can be implemented to monitor an AI.&lt;br /&gt;
&lt;br /&gt;
All code examples are using the Java interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Print a text message ingame ==&lt;br /&gt;
From the interface, you can request the &amp;quot;Game&amp;quot; object to &amp;quot;sendTextMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
_Callback.getGame().sendTextMessage (...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will display a text message to all players just like when a player hits &amp;quot;enter&amp;quot;, types something, then hits &amp;quot;enter&amp;quot; again.&lt;br /&gt;
&lt;br /&gt;
Whatever is sent to that method will show up in the game&#039;s GUI but it will also end up logged in the engine&#039;s log file. In Linux, it will be: &amp;lt;code&amp;gt;~/.config/spring/infolog.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Write to the engine&#039;s log ==&lt;br /&gt;
You can access a &amp;quot;log&amp;quot; from the Interface and send messages to it.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
_Callback.getLog ().log (msg);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Doing this .. appears to have the exact same effect as the previous option...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Write to a custom log ==&lt;br /&gt;
SpringRTS is built to run on a variety of different system (Linux, Windows and Mac), each with its own filesystems. Using the Interface you can obtain an appropriate path for the AI to create a log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
String logFilePath = _Callback.getDataDirs ().allocatePath (&amp;quot;PI_P&amp;quot; + _TeamID + &amp;quot;.txt&amp;quot;, &lt;br /&gt;
								true, true, false, false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would return a path like like: &amp;lt;code&amp;gt;/home/paulo/.config/spring/AI/Skirmish/PoucoInteligente/1/PI_P0.txt&amp;lt;/code&amp;gt; which you can use to create a log file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Draw a window ==&lt;br /&gt;
An extremely powerfull option to have visibility over what&#039;s happening in the game in realtime is to draw whatever you want into another window. For example, create a JFrame window (Java) and draw into it a minimap of LineOfSight.&lt;br /&gt;
&lt;br /&gt;
The existing AI zkgbai has code which can be learnt from (or reused) to create a new separate window and to draw a minimap into it.&lt;br /&gt;
&lt;br /&gt;
The AI&#039;s class &amp;quot;LosManager&amp;quot; draws a minimap of the LineOfSight, creating an &amp;quot;Image&amp;quot; object:&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/Anarchid/zkgbai/blob/master/src/zkgbai/los/LosManager.java&amp;lt;br&amp;gt;&lt;br /&gt;
The AI&#039;s class &amp;quot;DebugView&amp;quot; is the separate window itself and paints &amp;quot;Image&amp;quot; objects - the AI then creates a &amp;lt;code&amp;gt;new DebugView (...)&amp;lt;/code&amp;gt; and hands it over the desired images (like a LOS minimap).&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/Anarchid/zkgbai/blob/master/src/zkgbai/gui/DebugView.java&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Runtime debugging with the JDK/IDE  ==&lt;br /&gt;
TODO: Don&#039;t even know yet if this is possible or even how it interacts with the engine (will Spring crash or timeout waiting for a response from the Interface???).&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=555</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=555"/>
		<updated>2014-10-22T18:34:32Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* AI &amp;quot;frame skipping&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an &amp;quot;Interface&amp;quot;. See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039; &#039;&#039;(up-to-date as of 10-2014, SpringRTS v98)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:GameInferences|Useful inferences]]&#039;&#039;&#039; - how to infer where the opponents might have started, where on the maps can your units go, etc&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?p=463953#p463953&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=554</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=554"/>
		<updated>2014-10-19T23:45:07Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my development environment. What now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an &amp;quot;Interface&amp;quot;. See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039; &#039;&#039;(up-to-date as of 10-2014, SpringRTS v98)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:GameInferences|Useful inferences]]&#039;&#039;&#039; - how to infer where the opponents might have started, where on the maps can your units go, etc&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=713</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=713"/>
		<updated>2014-10-19T23:41:44Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying for all opponents&#039; units will respond with all enemy units even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends a message to all players warning the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; event.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed to SpringRTS when the lobby invokes it. On start, the SpringRTS engine will then parse that script for instructions on what maps to load, etc., and which starting positions to use. In Linux, that script should be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;br /&gt;
&lt;br /&gt;
=Infer map traversability=&lt;br /&gt;
How to infer where in the map each unit can pass through. Usually a submarine won&#039;t be able to go inland and a tank won&#039;t be able to climb mountains.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO&amp;lt;br&amp;gt;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32665&lt;br /&gt;
&lt;br /&gt;
=How interface commands correlate to the source code of the engine=&lt;br /&gt;
Chances are you&#039;ll have doubts about what exactly does command X(), Y() or Z(). Asking in the AI forum is a good way to clarify. The most reliable is probably to look at the source code:&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.h&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.cpp&amp;lt;br&amp;gt;&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=712</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=712"/>
		<updated>2014-10-19T23:35:02Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying for all opponents&#039; units will respond with all enemy units even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends a message to all players warning the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; event.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed to SpringRTS when the lobby invokes it. On start, the SpringRTS engine will then parse that script for instructions on what maps to load, etc., and which starting positions to use. In Linux, that script should be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;br /&gt;
&lt;br /&gt;
=Infer map traversability=&lt;br /&gt;
How to infer where in the map each unit can pass through. Usually a submarine won&#039;t be able to go inland and a tank won&#039;t be able to climb mountains.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO&amp;lt;br&amp;gt;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32665&lt;br /&gt;
&lt;br /&gt;
=How interface commands correlate to the source code of the engine=&lt;br /&gt;
Chances are you&#039;ll have doubts about what exactly does command X(), Y() or Z(). Asking in the AI forum is a good way to clarify. The most reliable is probably to look at the source code:&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.h&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICallback.cpp&amp;lt;br&amp;gt;&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=553</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=553"/>
		<updated>2014-10-19T23:26:01Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* How to write a Skirmish AI for Spring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an &amp;quot;Interface&amp;quot;. See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039; &#039;&#039;(up-to-date as of 10-2014, SpringRTS v98)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:GameInferences|Useful inferences]]&#039;&#039;&#039; - useful inferences you can make to derive things like where the opponents might have started&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=711</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=711"/>
		<updated>2014-10-19T23:23:37Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Wiki TODO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying for all opponents&#039; units will respond with all enemy units even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends a message to all players warning the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; event.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed to SpringRTS when the lobby invokes it. On start, the SpringRTS engine will then parse that script for instructions on what maps to load, etc., and which starting positions to use. In Linux, that script should be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;br /&gt;
&lt;br /&gt;
=Infer map traversability=&lt;br /&gt;
How to infer where in the map each unit can pass through. Usually a submarine won&#039;t be able to go inland and a tank won&#039;t be able to climb mountains.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO&amp;lt;br&amp;gt;&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32665&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=710</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=710"/>
		<updated>2014-10-19T23:18:36Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Parse the startup script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying for all opponents&#039; units will respond with all enemy units even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends a message to all players warning the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; event.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed to SpringRTS when the lobby invokes it. On start, the SpringRTS engine will then parse that script for instructions on what maps to load, etc., and which starting positions to use. In Linux, that script should be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=709</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=709"/>
		<updated>2014-10-19T23:15:48Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Enable cheats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying for all opponents&#039; units will respond with all enemy units even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends a message to all players warning the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; event.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed as a parameter when the lobby invokes the executable for SpringRTS. On start, the SpringRTS engine will then parse that script for instructions on what mod/game to load, what maps to load, and which starting positions to use. In Linux, that script will typically be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=708</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=708"/>
		<updated>2014-10-19T23:12:40Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying the Interface for all opponent&#039;s units will respond with all enemies even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends the player a warning that the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI player receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; events.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed as a parameter when the lobby invokes the executable for SpringRTS. On start, the SpringRTS engine will then parse that script for instructions on what mod/game to load, what maps to load, and which starting positions to use. In Linux, that script will typically be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=707</id>
		<title>AI:GameInferences</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:GameInferences&amp;diff=707"/>
		<updated>2014-10-19T23:11:32Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: Inception&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Useful inferences derivable from the game&#039;s data=&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This page describes how to infer (derive logical conclusions from permisses) some useful information to get started with behaving intelligentely. For example: try to infer where the opponent might have started.&lt;br /&gt;
&lt;br /&gt;
=Infer spawn positions=&lt;br /&gt;
An important first step right at the start of the game is to infer where the opponent(s) might have started.&amp;lt;br&amp;gt;&lt;br /&gt;
A forum thread about it: http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=32662&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a few methods of varying reliability but, unfortunately, none appears to be absolutely reliable:&lt;br /&gt;
* &#039;&#039;&#039;Enable cheats, even if only temporarily&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Parse the startup script&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Try to parse the map&#039;s raw data files&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Assume symetric starting positions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Enable cheats==&lt;br /&gt;
The Java OOInterface allows the enabling and disabling of cheats (not sure about the other interfaces - someone update this). After cheating is enable, querying the Interface for all opponent&#039;s units will respond with all enemies even if they are out of sight or radar.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Cheats cheats = _OOAICallback.getCheats();&lt;br /&gt;
cheats.setEnabled (true); //Enables cheats and sends the player a warning that the AI is cheating.&lt;br /&gt;
cheats.setEventsEnabled (true); //Enables this AI player receiving events for also the other player, like the &amp;quot;unitFinished&amp;quot; events.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - at the very beggining of the game (as in frame 0) the enemy might not yet have spawned (your initial unit might have spawned first). It&#039;s necessary to wait a few frames before trying to get this info reliably. (SpringRTS runs at 30 simulation steps per second)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note - this method does not work in all conditions. As far as I&#039;ve read somewhere, cheating will only work when the AI is playing someone in the same host machine and, if any cheating is done with someone else in the game, it will desync the running simulation between the running machines. There is a method that can be used to query that:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
bool whetherCheatingWillDesyncTheGame = cheats.isOnlyPassive();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parse the startup script==&lt;br /&gt;
The lobbies create an instruction script that is passed as a parameter when the lobby invokes the executable for SpringRTS. On start, the SpringRTS engine will then parse that script for instructions on what mod/game to load, what maps to load, and which starting positions to use. In Linux, that script will typically be in: ~/.config/spring/script.txt.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the startup script you can find parameters like:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   startpostype=3;&lt;br /&gt;
&lt;br /&gt;
   [TEAM0]&lt;br /&gt;
   {&lt;br /&gt;
      StartPosX=284;&lt;br /&gt;
      StartPosZ=256;&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
See the source code for a mapping of what each startpostype means: https://github.com/spring/spring/blob/64733de8b60dfba3533ed2374cc426c2bfb6addb/rts/Game/GameSetup.h#L65&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If &amp;quot;choose in game&amp;quot; option was chosen, the script should have a definition of a rectangle of where each player could have chosen its start position:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
startrecttop&lt;br /&gt;
 startrectbottom&lt;br /&gt;
startrectleft&lt;br /&gt;
startrectright&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Try to parse the map&#039;s raw data files==&lt;br /&gt;
According to user Silentwings, some maps have a mapinfo.lua specifications file with the information on the starting positions on the map. However, not all maps have that file, and each mod/game can override that behaviour anyway.&lt;br /&gt;
&lt;br /&gt;
==Assume symetric starting positions==&lt;br /&gt;
As a final last resort, a weak assumption can be made that in a 1v1 match the opponent will start in the symetrical opposite position of the map.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example: if the AI starts top left, at position (250; 250), it can make a weak assumption that the opponent will have started roughly at (MaxX-250; MaxZ-250).&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=930</id>
		<title>AI:Links</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=930"/>
		<updated>2014-10-19T16:39:30Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Development/Research */  new link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=AI Links=&lt;br /&gt;
&lt;br /&gt;
===Development/Research===&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-370-the-battlecode-programming-competition-january-iap-2013/lecture-videos/ MIT lectures on developing RTS AIs]&#039;&#039;&#039;: Videos of MIT lectures for the class Battlecode (developing AIs for an in-house RTS).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.darkstars.co.uk Darkstars]&#039;&#039;&#039;: AF&#039;s main site, has a lot of theory on it, including details of his NTai project&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=539 5 Matrix AI 1,2,3]&#039;&#039;&#039;: A thread discussing Triaxx&#039; theory and plans for his AI 5 matrix AI/Wormhole AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2752&amp;amp;highlight= &amp;quot;Research about Pathfinding, AI and Voronoi diagrams&amp;quot;]&#039;&#039;&#039;: A forum post by Gabba.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=4326 Academic research papers on AI in RTS games]&#039;&#039;&#039;: A forum post by NeuronExMachina.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AIResearch | AI research Material]]&#039;&#039;&#039;: Research links to articles and documents about AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=greedyAlg Greedy is good]&#039;&#039;&#039;: Greedy is good tutorial at topcoder.com&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=graphsDataStrucs1 Graph and data structures]&#039;&#039;&#039;: Graph and data structures tutorial at topcoder.com. This includes path-finding using bfs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AI:HughsUnitGroupingHeuristic|Unit grouping heuristic]]&#039;&#039;&#039;: Unit grouping and reorg heuristic by Hugh Perkins&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/optimizing-30000-ships-in-realtime-in-c.html Optimizing 30,000+ Ships In Realtime In C#]&#039;&#039;&#039;: Lead developer of game AI Wars discusses performance considerations for his RTS handling 30K+ units. Mostly good ideas on how to build a performance RTS engine but also some ideas applicable on how to make a performant AI agent, like working with fixed-ints rather than floats (especially for sync issues between different computers) or imperfect range checks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/07/range-checks-approximation-vs-accurate.html Range Checks - Approximation vs Accurate]&#039;&#039;&#039;: Lead developer of game AI Wars discusses how to improve performance of range checks at the cost of accuracy, which also raises the question of whether we really need 100% accurate range checks always/most times/ever in an AI agent. He states (other post) that range checks was the largest consumer of CPU in the alpha version of the game. He describes how he used an alternative that doesn&#039;t use the expensive SquareRoot math calculation.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/designing-emergent-ai-part-1.html Designing Emergent AI, Part 1: An Introduction]&#039;&#039;&#039;: Lead developer of game AI Wars explains how the game&#039;s AI works - essentially an overview of how to conceptually construct an AI agent for RTSs. A good resource on how to start going at building an AI agent for an RTS.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; [[Main_Page|&amp;lt;- Back to Main page page]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=552</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=552"/>
		<updated>2014-10-19T15:50:36Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Quick Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an &amp;quot;Interface&amp;quot;. See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039; &#039;&#039;(up-to-date in 10-2014, SpringRTS v98)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=551</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=551"/>
		<updated>2014-10-19T15:48:47Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Quick Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an &amp;quot;Interface&amp;quot;. See these pages for tutorials on how to setup a development environment, connect to the appropriate &amp;quot;Interface&amp;quot; and how to build your first example AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=550</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=550"/>
		<updated>2014-10-19T15:47:30Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my development environment. What now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an Interface. See these pages for tutorials on how to setup a development environment and how to build your first AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - semi-technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|SpringRTS &amp;lt;-&amp;gt; AIs architecture]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=549</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=549"/>
		<updated>2014-10-19T15:45:24Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my development environment. What now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an Interface. See these pages for tutorials on how to setup a development environment and how to build your first AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - check that page for ideas ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|Introduction to Springs AI interface system]]&#039;&#039;&#039; - architecture of SpringRTS and how it interacts with the AIs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=548</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=548"/>
		<updated>2014-10-19T15:42:42Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my development environment. What now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an Interface. See these pages for tutorials on how to setup a development environment and how to build your first AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - check that page for ideas ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - technical description of the Interfaces that expose the SpringRTS engine to the AI agents&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|Introduction to Springs AI interface system]]&#039;&#039;&#039; - general explanation about Spring&#039;s AI API. (this is not crucial information for an AI developer to know)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=547</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=547"/>
		<updated>2014-10-19T15:30:21Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Quick Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
The SpringRTS engine receives commands from an AI agent and sends back game state to the AI through an Interface. See these pages for tutorials on how to setup a development environment and how to build your first AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - check that page for ideas ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - see a description of how the AI agents interact with SpringRTS engine&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|Introduction to Springs AI interface system]]&#039;&#039;&#039; - general explanation about Spring&#039;s AI API. Though, an AI dev does not have to know about this, and should just follow the link to his preffered language from the list above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=546</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=546"/>
		<updated>2014-10-19T15:22:11Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Quick Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
See these pages for tutorials on how to setup a development environment to start building AIs and how to build your first AI agent:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - check that page for ideas ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - see a description of how the AI agents interact with SpringRTS engine&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|Introduction to Springs AI interface system]]&#039;&#039;&#039; - general explanation about Spring&#039;s AI API. Though, an AI dev does not have to know about this, and should just follow the link to his preffered language from the list above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=545</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=545"/>
		<updated>2014-10-19T15:21:55Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my development environment. What now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
Please choose your preferred programming language:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* other -&amp;gt; have a look at &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a general explanation about Springs AI API, see [[AI:Development:System|the introduction to Springs AI interface system]]. Though, an AI dev does not have to know about this, and should just follow the link to his preffered language from the list above.&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Skirmish:List|AIs for Spring]]&#039;&#039;&#039; - list of some of the AI agents that have already been developed for SpringRTS&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Links|AI related links]]&#039;&#039;&#039; - check that page for ideas ranging from how to conceptualize AI agents all the way down to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&#039;&#039;&#039; - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039; - see a description of how the AI agents interact with SpringRTS engine&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:System|Introduction to Springs AI interface system]]&#039;&#039;&#039; - general explanation about Spring&#039;s AI API. Though, an AI dev does not have to know about this, and should just follow the link to his preffered language from the list above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=544</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=544"/>
		<updated>2014-10-19T15:14:42Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my AI dev environment, what now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
Please choose your preferred programming language:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* other -&amp;gt; have a look at &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a general explanation about Springs AI API, see [[AI:Development:System|the introduction to Springs AI interface system]]. Though, an AI dev does not have to know about this, and should just follow the link to his preffered language from the list above.&lt;br /&gt;
&lt;br /&gt;
==I have setup my development environment. What now?==&lt;br /&gt;
&lt;br /&gt;
* [[AI:Skirmish:List|AIs for Spring]] - look at some of the AI agents that have already been built for Spring&amp;lt;br&amp;gt;&lt;br /&gt;
* [[AI:Links|AI related links]] - check that page for ideas ranging from how to conceptualize AI agents all the way to how to tackle very specific problems like pathfinding&amp;lt;br&amp;gt;&lt;br /&gt;
* [http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum] - comunity&#039;s forum dedicated to AI development&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=543</id>
		<title>AI:Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Development&amp;diff=543"/>
		<updated>2014-10-19T15:10:54Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* I have setup my AI dev environment, what now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; AI Development&lt;br /&gt;
&lt;br /&gt;
=How to write a Skirmish AI for Spring=&lt;br /&gt;
&lt;br /&gt;
==Quick Start==&lt;br /&gt;
Please choose your preferred programming language:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Lua|Lua]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:C|C]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Cpp|C++]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:CSharp|C#]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Java|Java]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Groovy|Groovy]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[AI:Development:Lang:Python|Python]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* other -&amp;gt; have a look at &#039;&#039;&#039;[[AI:Development:Interface|AI Interfaces &amp;amp; Wrappers]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a general explanation about Springs AI API, see [[AI:Development:System|the introduction to Springs AI interface system]]. Though, an AI dev does not have to know about this, and should just follow the link to his preffered language from the list above.&lt;br /&gt;
&lt;br /&gt;
==I have setup my AI dev environment, what now?==&lt;br /&gt;
&lt;br /&gt;
* Look at some of the other [[AI:Skirmish:List|AIs for Spring]]&amp;lt;br&amp;gt;&lt;br /&gt;
* Check out the [[AI:Links|AI related links]] page for ideas on how to conceptualize AI agents or how to tackle specific problems&amp;lt;br&amp;gt;&lt;br /&gt;
* Visit the [http://springrts.com/phpbb/viewforum.php?f=15 Springs AI dev forum]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Lua&amp;lt;--&amp;gt;AI communications [in Spring 0.83+]==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=26298&lt;br /&gt;
He shall only say it once!&lt;br /&gt;
&lt;br /&gt;
==AI &amp;quot;frame skipping&amp;quot;==&lt;br /&gt;
http://springrts.com/phpbb/viewtopic.php?f=15&amp;amp;t=24838&amp;amp;start=9&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
In spring you have some control over AIs with these commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/aireload&lt;br /&gt;
/ailist&lt;br /&gt;
/aikill&lt;br /&gt;
/aicontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI Dev]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=929</id>
		<title>AI:Links</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=AI:Links&amp;diff=929"/>
		<updated>2014-10-19T15:06:19Z</updated>

		<summary type="html">&lt;p&gt;Paulomorfeo: /* Development/Research */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=AI Links=&lt;br /&gt;
&lt;br /&gt;
===Development/Research===&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.darkstars.co.uk Darkstars]&#039;&#039;&#039;: AF&#039;s main site, has a lot of theory on it, including details of his NTai project&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=539 5 Matrix AI 1,2,3]&#039;&#039;&#039;: A thread discussing Triaxx&#039; theory and plans for his AI 5 matrix AI/Wormhole AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2752&amp;amp;highlight= &amp;quot;Research about Pathfinding, AI and Voronoi diagrams&amp;quot;]&#039;&#039;&#039;: A forum post by Gabba.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=4326 Academic research papers on AI in RTS games]&#039;&#039;&#039;: A forum post by NeuronExMachina.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AIResearch | AI research Material]]&#039;&#039;&#039;: Research links to articles and documents about AI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=greedyAlg Greedy is good]&#039;&#039;&#039;: Greedy is good tutorial at topcoder.com&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://www.topcoder.com/tc?module=Static&amp;amp;d1=tutorials&amp;amp;d2=graphsDataStrucs1 Graph and data structures]&#039;&#039;&#039;: Graph and data structures tutorial at topcoder.com. This includes path-finding using bfs&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[[AI:HughsUnitGroupingHeuristic|Unit grouping heuristic]]&#039;&#039;&#039;: Unit grouping and reorg heuristic by Hugh Perkins&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/optimizing-30000-ships-in-realtime-in-c.html Optimizing 30,000+ Ships In Realtime In C#]&#039;&#039;&#039;: Lead developer of game AI Wars discusses performance considerations for his RTS handling 30K+ units. Mostly good ideas on how to build a performance RTS engine but also some ideas applicable on how to make a performant AI agent, like working with fixed-ints rather than floats (especially for sync issues between different computers) or imperfect range checks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/07/range-checks-approximation-vs-accurate.html Range Checks - Approximation vs Accurate]&#039;&#039;&#039;: Lead developer of game AI Wars discusses how to improve performance of range checks at the cost of accuracy, which also raises the question of whether we really need 100% accurate range checks always/most times/ever in an AI agent. He states (other post) that range checks was the largest consumer of CPU in the alpha version of the game. He describes how he used an alternative that doesn&#039;t use the expensive SquareRoot math calculation.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;[http://christophermpark.blogspot.co.uk/2009/06/designing-emergent-ai-part-1.html Designing Emergent AI, Part 1: An Introduction]&#039;&#039;&#039;: Lead developer of game AI Wars explains how the game&#039;s AI works - essentially an overview of how to conceptually construct an AI agent for RTSs. A good resource on how to start going at building an AI agent for an RTS.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; [[Main_Page|&amp;lt;- Back to Main page page]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI]]&lt;/div&gt;</summary>
		<author><name>Paulomorfeo</name></author>
	</entry>
</feed>