C/C++ AI Beginner

C/C++ AI Beginner

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

Moderators: hoijui, Moderators

Post Reply
SiriusDragon
Posts: 14
Joined: 21 Mar 2010, 07:13

C/C++ AI Beginner

Post by SiriusDragon »

Hello,

I'm a uni student that has decided to use Spring for an AI project as a part of a uni subject I'm doing (the other cantidate was StarCraft).

I'm a TA fan so I tried to find a mod as close to OTA as possible, and I think I've settled on BA, unless there are any other mods that are closer to OTA? For now I'm aiming to get my AI playing one mod, on one map, with fixed settings/starting positions, in order to improve consistency in testing and development.

I currently use a Windows 7 x64 development environment with Visual Studio 2008, but I have access to other versions and I can also use XP if that helps. Using Linux is NOT an option.

I also wish to use C/C++ (preferably C++, the OO functionality will help) for coding the AI.

From what I can tell, Spring seems to be in a fair state of flux and change with regards to the interface, is this true?

Does anyone have any ideas for a total beginner? I read up all the info I could find on the Wiki, but it didn't help as much as I'd hoped.

Once I get started with the coding and working out Spring's interface, I should be fine. I just need some advice for the initial steps.

Thank you anyone who can offer advice, and congratulations on the awesome AIs you've all developed, and Spring itself of course.

Edit:
Hm, this should help.
http://darkstars.co.uk/2010/vs2008-ais-and-the-c-api/
Is this the latest API for Spring?
I did read about the LegacyCPP wrapper, but I assumed we weren't supposed to use it, considering it's 'legacy'...
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: C/C++ AI Beginner

Post by manolo_ »

try the mod BOTA (should be closer to OTA, than BA), also pm error ohoiji
SiriusDragon
Posts: 14
Joined: 21 Mar 2010, 07:13

Re: C/C++ AI Beginner

Post by SiriusDragon »

manolo_ wrote:try the mod BOTA (should be closer to OTA, than BA), also pm error ohoiji
pm error ohoiji? :?

And ooops! Totally missed BOTA, not sure how :oops: Thanks heaps for that suggestion. That should be perfect then. I hope com stealing still works, my eventual goal is to get the AI to do that and other odd tactics :lol:

Also, I've done a bit more reading, and I think I understand the state of the interface now. It was C++, but now it's C. So is there a 'non-legacy' wrapper? Or should I write my own around the C API?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: C/C++ AI Beginner

Post by imbaczek »

error was probably Error323, the guy who makes E323AI. hoijui is the engine AI wrapper developer, so he's the definitive source of answers to certain questions. you can also post here and/or check #sy and #ai in the lobby.

AFAIK there are now two C++ wrappers, but I've only used the legacy one.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: C/C++ AI Beginner

Post by hoijui »

yeah.. i recommend using the new C++ wrapper.
it is not used by any released AI yet, but it is already in use too.

though... the visual studio projects do not support that, and generally.. i can not recommend them for AI dev. CMake is the official build system, and it is needed for the new C++ Wrapper.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: C/C++ AI Beginner

Post by AF »

Im using the C++ API hence the blog post, I have units building other units with it, and it all seems to work and rather nicely.

I have a project due for release within the next few days that may be of interest to you and anyone else in development, although it's of limited interest for competitive AI development atm
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: C/C++ AI Beginner

Post by MidKnight »

There is also Hardcore Annihilation, which is probably the closest mod to TA available. It is developed by Pxtl, but has gone unmaintained for a while, though.

Ergh, grammar.
SiriusDragon
Posts: 14
Joined: 21 Mar 2010, 07:13

Re: C/C++ AI Beginner

Post by SiriusDragon »

Many thanks for all the help and suggestions so far!

I shall look into BOTA and Hardcore Annihilation too as games. Probably BOTA as it seems to be a bit more maintained. However I am open to eventually making the AI configurable, if people like it :) That way it could play other games too.

The AI will probably be open source too, unless there's a REALLY good reason not to do that. Which is unlikely...
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: C/C++ AI Beginner

Post by hoijui »

AI has to be GPL 2 and later, as it links to spring which uses that Licensing.
I also recommend you to use Git as SCM, because it is good, you will be able to integrate the AI well with spring (git submodule), and you can get tons of help from spring and other AI devs, in case you are new to it.

good luck!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: C/C++ AI Beginner

Post by AF »

AIs do not have to be GPL compatible.

SJ made a general excemption for AIs aftr the AI interface was first introduced so as to avoid legal wrangling and people leaving over being forced to opensource closed AIs.
SiriusDragon
Posts: 14
Joined: 21 Mar 2010, 07:13

Re: C/C++ AI Beginner

Post by SiriusDragon »

Yeah, I suspected that about Spring and GPL... as I said, it'll probably be open source anyway. Time will tell, need to write the darn thing first! :P

I'll probably use SVN, mainly because that's what I'm familiar with. Obviously if my AI ever makes it near the main Spring release or whatever I'll migrate it to git. We're starting to use git at work so I gotta learn it sooner or later :) As you can tell I'm very much a Windows based developer - I've done some Linux related stuff for work and of course uni, it's just never grown on me :oops:

I'm yet to start any serious development, hopefully tomorrow. Been a bit distracted by SupCom 2 and stuff :P Now THAT is a game that could use a new AI...
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: C/C++ AI Beginner

Post by imbaczek »

don't go svn->git, it'll bite your ass sooner or later. start with git and learn along the way.
kmcguire
Posts: 11
Joined: 23 Feb 2010, 04:45

Re: C/C++ AI Beginner

Post by kmcguire »

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: C/C++ AI Beginner

Post by AF »

Im using svn atm, purely because github makes me pay for privacy, probably better ways of doing it but meh
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: C/C++ AI Beginner

Post by imbaczek »

AF you can store your backup git repository anywhere, e.g. on your server via ftp, etc.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: C/C++ AI Beginner

Post by hoijui »

+1 to what imbaczek said.
as you can see, there are already 3 guys in here willing to help you with git and in #sy you will always find some, and it will save you time and nerves in the long run, if you start with it.
Post Reply

Return to “AI”