AI with C# (again)

AI with C# (again)

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
dpattiso
Posts: 5
Joined: 07 Jul 2008, 02:40

AI with C# (again)

Post by dpattiso »

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
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: AI with C# (again)

Post by Kloot »

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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI with C# (again)

Post by hoijui »

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.
dpattiso
Posts: 5
Joined: 07 Jul 2008, 02:40

Re: AI with C# (again)

Post by dpattiso »

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?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI with C# (again)

Post by AF »

Im not sure but I do know that the more help there is the quicker it'll be.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI with C# (again)

Post by hoijui »

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
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Re: AI with C# (again)

Post by Agon »

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.
dpattiso
Posts: 5
Joined: 07 Jul 2008, 02:40

Re: AI with C# (again)

Post by dpattiso »

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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI with C# (again)

Post by AF »

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 ^_^
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Re: AI with C# (again)

Post by jcnossen »

Sounds nice, will this be opensource?
dpattiso
Posts: 5
Joined: 07 Jul 2008, 02:40

Re: AI with C# (again)

Post by dpattiso »

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.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Re: AI with C# (again)

Post by jcnossen »

Do you have a research page so we can keep track of it?
dpattiso
Posts: 5
Joined: 07 Jul 2008, 02:40

Re: AI with C# (again)

Post by dpattiso »

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 ;)
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: AI with C# (again)

Post by Dragon45 »

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 =]
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Re: AI with C# (again)

Post by Agon »

Dragon45 wrote:so take your time, and by the time Command Engine is released, the spring codebase will be cleaned up a bit =]
No one works on Command Engine as I know.
Geryon
Posts: 4
Joined: 05 Jan 2006, 05:14

Re: AI with C# (again)

Post by Geryon »

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.
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Re: AI with C# (again)

Post by Agon »

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.
This is planned, sort of.
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?
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI with C# (again)

Post by hughperkins »

And the only one who can do this who contributed to Spring is hughperkins.
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.

In the meantime, feel free to call me on +44 7527631995 if you have any questions, preferably whilst I'm at work :-D
Post Reply

Return to “AI”