Tutorial on compiling AIs?
Moderators: hoijui, Moderators
Tutorial on compiling AIs?
I'm interested in starting up some AI tweaking and creation, but am having trouble even getting off the ground.
I'm trying to compile some of the existing AIs from the Spring source in Visual Studio .NET 2003, but I keep getting a bunch of errors. Could someone give me a step by step list of things I need to do to get an AI compiled? I'm familiar with some other programming languages, Java, Pascal, Matlab, and some C, but not much experience with C++ or with Visual Studio.
So far I've tried opening up the .vcproj files, opening the TestAI.cpp and running the "Build Solution", "Build TestAI", and "Compile," all of which give file not found errors. The files are present in a different directory, however. Do I need to set the PATH for some of these files? I didn't see too much on how to do this in the readmes or on the Wiki.
Thanks for anyone who can help! :)
-QMan
I'm trying to compile some of the existing AIs from the Spring source in Visual Studio .NET 2003, but I keep getting a bunch of errors. Could someone give me a step by step list of things I need to do to get an AI compiled? I'm familiar with some other programming languages, Java, Pascal, Matlab, and some C, but not much experience with C++ or with Visual Studio.
So far I've tried opening up the .vcproj files, opening the TestAI.cpp and running the "Build Solution", "Build TestAI", and "Compile," all of which give file not found errors. The files are present in a different directory, however. Do I need to set the PATH for some of these files? I didn't see too much on how to do this in the readmes or on the Wiki.
Thanks for anyone who can help! :)
-QMan
I think what you want is to try and run one of the projects in the svn, if you have the entire svn in a folder and dont mess around with folders then try to build NTAI or JCAI you shouldnt get any problems.
If you've downlaoded a later NTAI version (XE4+) then be aware that only XE6/7 will compile atm, or XE4 (from the svn only).
OTAI should need a VS project setup which i wouldnt be able to tell you atm, and AAI is closed source.
If you've downlaoded a later NTAI version (XE4+) then be aware that only XE6/7 will compile atm, or XE4 (from the svn only).
OTAI should need a VS project setup which i wouldnt be able to tell you atm, and AAI is closed source.
huh? My thoughts would instead be to simpyl remove all the NTAI files save globalAI.cpp/h and itnerface.h, maybe keep include.h, rename the project and delete any code referencing the global class. Once thats been done you should have a raw project all presetup, you might wanna change the output tho from NTAI.dll to whatever.dll
- unpossible
- Posts: 871
- Joined: 10 May 2005, 19:24
Not a chance. Spring headers are incompatible with VC6, and even if they were you'd still need to compile spring on VC6 which will not work (It's using partial template specialization which vc6 doesn't support)
Your options are compiling spring on mingw (ie: GCC for windows), and developing your AI using that, releasing the source and let others compile it for vs7.
However mingw has not been supported as a build platform yet, so it needs a lot of work to get it building. If you take this path, check http://www.devpaks.org for a lot of precompiled devcpp libraries which can save you a lot of time.
The other option is getting vs7.
Your options are compiling spring on mingw (ie: GCC for windows), and developing your AI using that, releasing the source and let others compile it for vs7.
However mingw has not been supported as a build platform yet, so it needs a lot of work to get it building. If you take this path, check http://www.devpaks.org for a lot of precompiled devcpp libraries which can save you a lot of time.
The other option is getting vs7.
I made OTAI for a good while with VC6!
You can download the VC2003 Toolkit and order VC6 to use it's libraries, headers, and executables by specifying those directories. It's not very convenient, but it is possible.
I'd recommend following AF's advice, though. (I will myself next time I remember to bring a blank CD. Express is nearly half a gig!)
You can download the VC2003 Toolkit and order VC6 to use it's libraries, headers, and executables by specifying those directories. It's not very convenient, but it is possible.
I'd recommend following AF's advice, though. (I will myself next time I remember to bring a blank CD. Express is nearly half a gig!)
- unpossible
- Posts: 871
- Joined: 10 May 2005, 19:24
I wouldn't recommend using VC6 at all, for one you cant just open an existing AI project and remove AI specific code to get it working.
You can use a gcc based compiler, or the enterprise compiler+codeblocks, DevC++, or try and go it alone using one of the other languages such as delphi/vb/c#/asm etc....
VC.iso (visual studio C 2005 express) was something like 480MB for me, and the platform SDK was soemthign like 1.5GB for em some have said it was 500-800MB for them, but I'd install it then try and compile then get the sdk, if it needs libraries and the sdk si too big then you can use an existing VS installation (anythign above VC6 but not including VC6).
If you want to compile spring you also need the directx sdk adn the vclibs installer zaphod made
You can use a gcc based compiler, or the enterprise compiler+codeblocks, DevC++, or try and go it alone using one of the other languages such as delphi/vb/c#/asm etc....
VC.iso (visual studio C 2005 express) was something like 480MB for me, and the platform SDK was soemthign like 1.5GB for em some have said it was 500-800MB for them, but I'd install it then try and compile then get the sdk, if it needs libraries and the sdk si too big then you can use an existing VS installation (anythign above VC6 but not including VC6).
If you want to compile spring you also need the directx sdk adn the vclibs installer zaphod made
Another question to you AI devs out there. Is there an easy way to check a unit's last hit damage (hit for X, missed for 0, etc), total damage output (hit for XX total since creation), total damage received, and # of kills?
Also, can anyone tell me the formula Spring uses to give xp to a unit?
-QMan
Also, can anyone tell me the formula Spring uses to give xp to a unit?
-QMan
When it becomes idle the engine will call your UnitIdle(int unit) function.
Otherwise it's a messy business with context etc. I once tried calling a unitidle if its current command id was CMD_STOP, and JCAI tracked every command and checked each unit was doing what it was meant todo.
On issuing a command if it returns -1 it is also as good as idle....
Otherwise it's a messy business with context etc. I once tried calling a unitidle if its current command id was CMD_STOP, and JCAI tracked every command and checked each unit was doing what it was meant todo.
On issuing a command if it returns -1 it is also as good as idle....