AI with C# (again)
Moderators: hoijui, Moderators
AI with C# (again)
Hi all,
I need an open source RTS engine for demonstrating my research for my PhD, and Spring fits the bill perfectly- aside from the small problem of me being a C# man and all my libraries being in C#. I've seen several posts (and the wiki) which say using C# is fine, and several newer ones saying its plain impossible. Could someone give me a definitive answer as to the state of the C# AI wrapper? Or any way of interfacing from mingw (or VS 2008 compiled C++) to C#? Is it even at all possible to get from C++ to C# in spring with the current builds?
And apologies for yet another post on C#, but I searched the board and it seemed all the info was too old to be trustworthy.
Thanks
I need an open source RTS engine for demonstrating my research for my PhD, and Spring fits the bill perfectly- aside from the small problem of me being a C# man and all my libraries being in C#. I've seen several posts (and the wiki) which say using C# is fine, and several newer ones saying its plain impossible. Could someone give me a definitive answer as to the state of the C# AI wrapper? Or any way of interfacing from mingw (or VS 2008 compiled C++) to C#? Is it even at all possible to get from C++ to C# in spring with the current builds?
And apologies for yet another post on C#, but I searched the board and it seemed all the info was too old to be trustworthy.
Thanks
Re: AI with C# (again)
This thread has the most recent (as of May 24) information. To get
from mingw C++ to C# is for all intents and purposes impossible at
this point, with VS C++ it can be done but the wrappers are not yet
functional again.
Note that the current C++ engine<==>AI interface layer is being
rewritten in C which will make adding Mono bindings _much_ easier
(compared to the huge MSVC-only DLL chain that is needed to link
C# AI's and Spring now), so it might be worth waiting a while if you
can afford to.
from mingw C++ to C# is for all intents and purposes impossible at
this point, with VS C++ it can be done but the wrappers are not yet
functional again.
Note that the current C++ engine<==>AI interface layer is being
rewritten in C which will make adding Mono bindings _much_ easier
(compared to the huge MSVC-only DLL chain that is needed to link
C# AI's and Spring now), so it might be worth waiting a while if you
can afford to.
Re: AI with C# (again)
yeah... could you give us some dates?
* when will you have to start coding?
* when would you need to know for sure if and when an AI for spring can be written in C#?
we could then tell you how likely it is that you could use spring for your PhD.
* when will you have to start coding?
* when would you need to know for sure if and when an AI for spring can be written in C#?
we could then tell you how likely it is that you could use spring for your PhD.
Re: AI with C# (again)
Well I've been working on the code in some form or another for a year, but I'm about to change direction and the old custom graphics I am currently using will just slow me down in the future (and they're rubbish).
Basically I want to avoid writing any of the low level stuff such as "move", "attack" etc and just make use of them, which is why Spring is so appealing.
And I can't really wait at all, as I need to get started and *something* produced in the next month. Would anyone know how long it would be before the wrappers are functional? Are we talking weeks or months?
Basically I want to avoid writing any of the low level stuff such as "move", "attack" etc and just make use of them, which is why Spring is so appealing.
And I can't really wait at all, as I need to get started and *something* produced in the next month. Would anyone know how long it would be before the wrappers are functional? Are we talking weeks or months?
Re: AI with C# (again)
Im not sure but I do know that the more help there is the quicker it'll be.
Re: AI with C# (again)
well... the C interface is possibly usable in a week. but then the C# interface still has to be done.
hmm.. then again, spring can be compiled with VC now already, so the C interface is not really a requirement, right? you would just have to use a VC build of spring, which is fine, as long as you don't want to play online with others. but of course, you wold need a working C# interface.. i can't help you there. i think, as fast as you need it, you will not be able to do it yourself, alone, but maybe Agon should say something about this.
edit: removed useless paragraph & typo
hmm.. then again, spring can be compiled with VC now already, so the C interface is not really a requirement, right? you would just have to use a VC build of spring, which is fine, as long as you don't want to play online with others. but of course, you wold need a working C# interface.. i can't help you there. i think, as fast as you need it, you will not be able to do it yourself, alone, but maybe Agon should say something about this.
edit: removed useless paragraph & typo
Re: AI with C# (again)
I did not decide if a D-Bus interface or a Mono wrapper is better.
The problem here is I don't know much about both topics.
So best would be to ask hughperkins.
If he will help out it could be done faster. If I need to do it alone. I think I need two weeks and more because I need to learn C++ and D-Bus or embedding Mono.
The decision between D-Bus/TCP/something similar or embedding Mono is still no done.
Maybe you can help to decide or/and later to design the interface or/and implement.
The problem here is I don't know much about both topics.
So best would be to ask hughperkins.
If he will help out it could be done faster. If I need to do it alone. I think I need two weeks and more because I need to learn C++ and D-Bus or embedding Mono.
The decision between D-Bus/TCP/something similar or embedding Mono is still no done.
Maybe you can help to decide or/and later to design the interface or/and implement.
Re: AI with C# (again)
Thanks for the info guys. I reckon I'll go ahead and produce a generic interface for any game engine so that should the time come I can just add Spring into the system without major hassle.
Re: AI with C# (again)
If you could link us t your work and the code when your finished so we can have a look too that'd be much appreciated ^_^
Re: AI with C# (again)
Sounds nice, will this be opensource?
Re: AI with C# (again)
If I ever get a spring implementation I'll let you guys know, as I hope it will be quite an advance in the way the AI plays in RTS scenarios.
Re: AI with C# (again)
Do you have a research page so we can keep track of it?
Re: AI with C# (again)
Now that would involve being prepared in some way... so no. I only have an internal wiki page for keeping notes etc. The actual work is months off of being showable anyway, as I really have just started the prototype today. If I get it working with Spring I'm sure I'll throw up a few FRAPS videos to show it in action- assuming it works 

Re: AI with C# (again)
if you're a phd student you have lots of time no worries
there's one dude in my lab who's been a student for 6 years. he's maybe halfway done with some stuff that could possibly lead up to his thesis
so take your time, and by the time Command Engine is released, the spring codebase will be cleaned up a bit =]
there's one dude in my lab who's been a student for 6 years. he's maybe halfway done with some stuff that could possibly lead up to his thesis
so take your time, and by the time Command Engine is released, the spring codebase will be cleaned up a bit =]
Re: AI with C# (again)
No one works on Command Engine as I know.Dragon45 wrote:so take your time, and by the time Command Engine is released, the spring codebase will be cleaned up a bit =]
Re: AI with C# (again)
I recommend you build the dll in C++/CLI and call into C# from there. Spring will think it's loading a C DLL (and will need no modifications), and the compiler handles and the thunking, loading of the CLR, etc. To accomplish this in visual studio you'll want to have two projects in one solution. One small C++/CLI wrapper dll, and the main c# logic dll.
Re: AI with C# (again)
This is planned, sort of.Geryon wrote:I recommend you build the dll in C++/CLI and call into C# from there. Spring will think it's loading a C DLL (and will need no modifications), and the compiler handles and the thunking, loading of the CLR, etc. To accomplish this in visual studio you'll want to have two projects in one solution. One small C++/CLI wrapper dll, and the main c# logic dll.
But currently the interface gets a redesign so this has to wait.
And the only one who can do this who contributed to Spring is hughperkins.
But I don't know if he will do this. And it looks like the redesign will take another month and than I have not so much time to look into it and do it by my self.
Do you have interest in doing this?
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI with C# (again)
Well, my laptops got stolen, and I only have an eeepc left. I'm not planning on buying any new ones until I've done something about my house security.And the only one who can do this who contributed to Spring is hughperkins.
In the meantime, feel free to call me on +44 7527631995 if you have any questions, preferably whilst I'm at work :-D