GlobalAI "Hello world" using Boo, a Python compiler for .Net.
http://manageddreams.com/csai/testbooai.zip
To use:
*copy bot-libs\booailoader.dll and bot-libs\booailoader.xml to taspring\ai\bot-libs
*copy Booai\csai.dll and booai\csai.pdb to taspring\ai\BooAI (new directory)
*create a multiplayer game and specify "booailoader.dll" as the bot dll
To rebuild, with booc in the path, type:
*booc -t:library CSAI.py -r:csaiinterfaces.dll
*copy the new csai.dll and csai.pdb into taspring\ai\BooAI directory, overwriting the old files
Boo AI Hello World
Moderators: hoijui, Moderators
My first steps in playing around with an AI were written in C++, and it soon stops due to missing compilers, long round-trips, memory leaks, and so on...
so the idea of having a script language linked into spring as ai is great (at least from my point of view) and reloading of that ai would be even greater. I gave your Boo example a try, and: these thingies work! :o)
(I had to use the 0.73b1-version, the new 0.74b_ it gave an exception)
But now I have got a problem and three little questions for you:
a. Is a new csailoader for the actual spring version available?
b. What Boo version do you use?
c. (the actual problem): when using a Boo List object (like "b as List = List()"), the ai crashes! any ideas?
so long...
so the idea of having a script language linked into spring as ai is great (at least from my point of view) and reloading of that ai would be even greater. I gave your Boo example a try, and: these thingies work! :o)
(I had to use the 0.73b1-version, the new 0.74b_ it gave an exception)
But now I have got a problem and three little questions for you:
a. Is a new csailoader for the actual spring version available?
b. What Boo version do you use?
c. (the actual problem): when using a Boo List object (like "b as List = List()"), the ai crashes! any ideas?
so long...
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Torian,
Good to see that this is being used!
For C++, msvc and gcc are incompatible, they wont link. Thats a problem because the csailoader must be written in msvc to work.
There are two solutions to this, but you're going to have to poke around a little to get them to work:
- use a C-layer proxy between msvc and gcc. This was working at some point. The C-layer proxy was even integrated into Spring! It goes by the name of ABIC.
There's a csailoader that can link with ABIC.
- use Mono instead. There is a mono layer. This also passes through the ABIC layer.
The ABIC layer makes things quite complicated... you're going to have to be willing to dig around a little to get things to compile.
Boo compiles to standard .Net ilsm code, and the csailoader can work with anything that compiles into standard .net ilsm code.
Good to see that this is being used!
ermmmm, it's been a while.... there's a major change going from 0.73 to 0.74: the Spring compiler changed from msvc to gcc.But now I have got a problem and three little questions for you:
a. Is a new csailoader for the actual spring version available?
For C++, msvc and gcc are incompatible, they wont link. Thats a problem because the csailoader must be written in msvc to work.
There are two solutions to this, but you're going to have to poke around a little to get them to work:
- use a C-layer proxy between msvc and gcc. This was working at some point. The C-layer proxy was even integrated into Spring! It goes by the name of ABIC.
There's a csailoader that can link with ABIC.
- use Mono instead. There is a mono layer. This also passes through the ABIC layer.
The ABIC layer makes things quite complicated... you're going to have to be willing to dig around a little to get things to compile.
I dontb. What Boo version do you use?

No, my Python is very rusty. Isnt a List an abstract class? Does it work if you use ArrayList instead?c. (the actual problem): when using a Boo List object (like "b as List = List()"), the ai crashes! any ideas?
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Boo compiles to standard ilsm code.jcnossen wrote: Does this mean AI's are compiled from source when started? That would be pretty nice..
Pretty easy to get things to compile from source though, since the .Net Framework runtime contains the csc compiler, and the Mono runtime contains the gmcs compiler, so no need to install Visual Studio or anything.
nant is able to build a project using csc, then run it using exec. Put them in separate targets, with a "depends" in the run pointing to the build.
For dlls, you can make a loader dll that first builds the target dll then loads it.
Okay, so no new csailoader possible, but gcc as compiler...hughperkins wrote: ermmmm, it's been a while.... there's a major change going from 0.73 to 0.74: the Spring compiler changed from msvc to gcc.
*sigh* sounds better than the c-layer proxy (considering cross-platform usage)- use Mono instead. There is a mono layer. This also passes through the ABIC layer.
this is the relation between List and ArrayList found (for example) in java...No, my Python is very rusty. Isnt a List an abstract class? Does it work if you use ArrayList instead?
in Boo (btw one of the most under-documented languages I ever encountered, and it is not Python :o|), List is a double-linked list; in the shell, there is no problem instantiating one...
Okay, long posting, short story:
the csailoader does not (and may never) work with spring 0.74+.
there might be a problem with spring 0.73 and csailoader affecting some Boo features like List (rendering that approach useless for above-simple-AI programming).
I take a look at the mono/ABIC issue; but I am afraid, in the next few weeks I cant spend much time on that...
[flowery] So, the light at the end of the tunnel (ie AIs in script languages like perl, lua, python, etc) vanishes again...[/flowery] ;o]
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14