AI:Development:System: Difference between revisions

From Spring
Jump to navigationJump to search
Hoijui (talk | contribs)
No edit summary
Flozi (talk | contribs)
AI -> AI Dev
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Springs AI API==
[[Engine_Development|Development]] < [[AI:Development|AI Development]] < AI API
__NOTOC__
=Spring's AI API=
 
==Design==
Skirmish AIs are not loaded by the engine directly, but through an interface library.
Skirmish AIs are not loaded by the engine directly, but through an interface library.
This allows integration of AIs written in other languages.
This allows integration of AIs written in other languages.
Line 13: Line 17:


Wrappers are comparable to AI Interfaces, but they rather lay between an AI Interface and an AI.
Wrappers are comparable to AI Interfaces, but they rather lay between an AI Interface and an AI.
They consist of code that adds enhances an interface in some way, and they are compiled directly into the AI library.
They consist of code that enhances an interface or AI in some way, and they are compiled directly into the respective library.
An example of one is the Legacy C++ Wrapper.
An example of one is the Legacy C++ Wrapper.
It makes the C/C++ AI Interface look like the old C++ AI interface of spring,
It makes the C/C++ AI Interface look like the old C++ AI interface of spring,
Line 20: Line 24:
For further info, see [[AI:Development:Interface|AI Interface Development]].
For further info, see [[AI:Development:Interface|AI Interface Development]].


===History===
==History==
Global AIs used by spring versions prior to 0.79 have used an AI Interface with the following structure:<br><br>
Global AIs used by spring versions prior to 0.79 have used an AI Interface with the following structure:<br><br>
[[Image:CAIInterfaceCodeStructureOld.png|thumb|center|722 px|Old Code Structure]]
[[Image:CAIInterfaceCodeStructureOld.png|thumb|center|722 px|Old Code Structure]]
Line 26: Line 30:
Therefore, AIs had to be written in C++, and be compiled with the same compiler as the engine.
Therefore, AIs had to be written in C++, and be compiled with the same compiler as the engine.


[[Category: AI]]
===Links (not relevant for Spring versions newer then 0.78)===
[[Category: Development]]
;'''Metal Handler Class''': Cain has developed and released a Metal Handler Class that succesfully finds metal spots on maps, which can be a major stumbling block for many AI developers. Information about it can be found in [http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2408 this thread].<br>
 
;'''[[Krogothes_Metal_class|Krogothes Metal Class V3]]''': A useful mex spot finding algorithm, essential for any AI that uses metal extractors<br>
 
;'''Global AI Interface''': Jouninkomiko has a topic on the [http://taspring.clan-sy.com/phpbb/viewtopic.php?t=923 Global AI Interface] running here.<br>
 
;'''[[AI:Hughs_global_AI_tutorial|Hugh's global AI tutorial]]''': Hugh's tutorial on writing an AI in C#.<br>
 
;'''[[AI:CSAIInterface|Global AI .Net Interface]]''': Write Global AIs in .Net, using Hugh Perkins's interface<br>
 
;'''[[AI:JAI|Global AI Java Interface]]''': Write Global AIs in Java, using JAI<br>
 
[[Category: AI Dev]]

Latest revision as of 17:44, 23 March 2013

Development < AI Development < AI API

Spring's AI API

Design

Skirmish AIs are not loaded by the engine directly, but through an interface library. This allows integration of AIs written in other languages. An other idea made possible through this, is a library that can load AIs over the network, and let them run on an AI server (NOTE: this is not planned, just a possibility).

To get an idea of the overall code and runtime structure of Springs AI Interface system, have a look at the following diagram.

New Code Structure

briefly: AI Interfaces are plugins for the spring engine, while Skirmish AIs are plugins for AI Interfaces.

Wrappers are comparable to AI Interfaces, but they rather lay between an AI Interface and an AI. They consist of code that enhances an interface or AI in some way, and they are compiled directly into the respective library. An example of one is the Legacy C++ Wrapper. It makes the C/C++ AI Interface look like the old C++ AI interface of spring, is used by KAIK and AAI for example, and its code is compiled directly into these AI libraries.

For further info, see AI Interface Development.

History

Global AIs used by spring versions prior to 0.79 have used an AI Interface with the following structure:

Old Code Structure

Therefore, AIs had to be written in C++, and be compiled with the same compiler as the engine.

Links (not relevant for Spring versions newer then 0.78)

Metal Handler Class
Cain has developed and released a Metal Handler Class that succesfully finds metal spots on maps, which can be a major stumbling block for many AI developers. Information about it can be found in this thread.
Krogothes Metal Class V3
A useful mex spot finding algorithm, essential for any AI that uses metal extractors
Global AI Interface
Jouninkomiko has a topic on the Global AI Interface running here.
Hugh's global AI tutorial
Hugh's tutorial on writing an AI in C#.
Global AI .Net Interface
Write Global AIs in .Net, using Hugh Perkins's interface
Global AI Java Interface
Write Global AIs in Java, using JAI