AIInterface:Python: Difference between revisions

From Spring
Jump to navigationJump to search
Abma (talk | contribs)
Abma (talk | contribs)
Line 40: Line 40:
==Known Issuses/TODO==
==Known Issuses/TODO==
*there are no docs, look into interface.py if you search a function
*there are no docs, look into interface.py if you search a function
*ai's could only work on a specific python version, add an setting into aiproperties.lua
*the init event could be replaced by an init function
*add release function/event for the ai


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

Revision as of 17:55, 22 June 2010

Spring PyAI

The Spring PyAI Interface can be used to write skirmish AIs in Python.

Code

http://github.com/spring/Python

Building

From the README:

Howto setup

1. Get the clean spring sourcecode:

 git clone git://github.com/spring/spring.git spring cd spring

2. Get the Python AI Interface code into the right folder

 git clone git://github.com/spring/Python.git AI/Interfaces/Python

That's it. When Python is detected, the AI Interface will be compiled with spring:

 cmake .
 make

Quick Setup Windows

download + install:

 http://buildbot.eat-peet.net/spring/installer/spring_0.81.0-888-g4813344.exe

download + extract to install-folder

 http://abma.de/builds/pyai-current.zip

download + install python:

 http://python.org/ftp/python/2.6.5/python-2.6.5.msi

Download a mod + map.

It doesn't work with the currently stable spring release. Would be nice if someone could pick the source and compile it and test it.

If you want test it, you need spring from the current git master! What is currently untested:

  • compile with windows (mingw / visual studio + co)

Known Issuses/TODO

  • there are no docs, look into interface.py if you search a function
  • ai's could only work on a specific python version, add an setting into aiproperties.lua
  • the init event could be replaced by an init function
  • add release function/event for the ai

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

For windows there is a (cross-compiled) package here: http://abma.de/builds/pyai-current.zip


Status

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

There is also a branch with the interface included avaiable: http://github.com/spring/Python

Check the NullPythonAI for something to start with.