AIInterface:Python: Difference between revisions

From Spring
Jump to navigationJump to search
Slogic (talk | contribs)
Flozi (talk | contribs)
m Category:AIInterface
 
(25 intermediate revisions by one other user not shown)
Line 1: Line 1:
Important note: in current spring/master it is currently disabled because of an recently big merge (pureint), it will be fixed soon!
== Spring PyAI ==
== Spring PyAI ==
The Spring PyAI Interface can be used to write skirmish AIs in Python.  
The Spring PyAI Interface can be used to write a skirmish AI in Python.
Look at the [[AI:Development:Lang:Python|Development Page of Python]] if you want write an AI.


=== Code ===
=== Code ===
https://sourceforge.net/projects/springpyai/
http://github.com/spring/Python


=== Building ===
=== Building ===


From the [http://springpyai.git.sourceforge.net/git/gitweb.cgi?p=springpyai/springpyai;a=blob_plain;f=README README]:
The Python Interface is in spring/master, just git clone it, run "git submodule init" and you can compile/install it!


First get the clean spring sourcecode:
==Known Issuses/TODO==
*rewrite for pureint
*make thread-safe http://docs.python.org/release/1.5.2/api/threads.html
*ai's cant force a specific python version, add an setting into aiinfo.lua
*only one specific python version can be used, loading different ais using different python versions is currently impossible
*the init event can be replaced by a function / add release function
*there are no docs, look into interface.py if you search a function
*logging could be improved


git clone git://github.com/spring/spring.git spring
As a note: most of the Interface is generated by a python script.


then get the springpyai code into the right folder
=== Status ===
Most functions and Datatypes should work. All classes and functions are generated and because of this, there is no further documentation available.


git clone git://springpyai.git.sourceforge.net/gitroot/springpyai/springpyai spring/AI/Interfaces/Python
At github you find the main repository for the Interface:
http://github.com/spring/Python


and link the nullpythonai to the right folder to get it compiled
Check the NullPythonAI for something to start with.
ln -s ../Interfaces/Python/test/NullPythonAI/ spring/AI/Skirmish/NullPythonAI


That's it, when python is detected, the Interface will be compiled automatically.
[[Category:AIInterface]]
 
=== Status ===
Most functions and Datatypes should work. However, there is no typechecking at this point and the interface may crash if you use a wrong type. All classes and functions are generated and because of this, there is no further documentation available.
 
Check the NullPythonAI for something to start with.

Latest revision as of 18:43, 8 March 2013

Important note: in current spring/master it is currently disabled because of an recently big merge (pureint), it will be fixed soon!

Spring PyAI

The Spring PyAI Interface can be used to write a skirmish AI in Python. Look at the Development Page of Python if you want write an AI.

Code

http://github.com/spring/Python

Building

The Python Interface is in spring/master, just git clone it, run "git submodule init" and you can compile/install it!

Known Issuses/TODO

  • rewrite for pureint
  • make thread-safe http://docs.python.org/release/1.5.2/api/threads.html
  • ai's cant force a specific python version, add an setting into aiinfo.lua
  • only one specific python version can be used, loading different ais using different python versions is currently impossible
  • the init event can be replaced by a function / add release function
  • there are no docs, look into interface.py if you search a function
  • logging could be improved

As a note: most of the Interface is generated by a python script.

Status

Most functions and Datatypes should work. All classes and functions are generated and because of this, there is no further documentation available.

At github you find the main repository for the Interface: http://github.com/spring/Python

Check the NullPythonAI for something to start with.