What do you need to build an AI
Moderators: hoijui, Moderators
What do you need to build an AI
Hi Guys,
I've been meaning to do some coding for ages. What do I need in order to build an AI in terms of tools? I already have the GNU C++ compiler installed and I'm using Eclipse as an editor, which works out the build dependencies etc. So say I wanted to modify JCAI, would do I need to build it apart from the JCAI source?
Thanks in advance
Munch
I've been meaning to do some coding for ages. What do I need in order to build an AI in terms of tools? I already have the GNU C++ compiler installed and I'm using Eclipse as an editor, which works out the build dependencies etc. So say I wanted to modify JCAI, would do I need to build it apart from the JCAI source?
Thanks in advance
Munch
Unfortunately you can't compile current windows spring version on GNU C++ right now. However I recently submitted a patch for linux port to get it compiled on Visual Studio. Meaning the linux port at the moment will compile on Windows with both GCC and VS, but I couldn't get it to run because of a crash somewhere in minizip code.
To cut a long story short you can:
-get Visual Studio + boost to compile the clan SY version and JCAI.
-use GNU C++ and get the OpenAL, libjpeg, zlib and boost libraries to try to get the port running on windows, fix the global AI dll loading port code and build JCAI...
I think option number one is the easiest :)
To cut a long story short you can:
-get Visual Studio + boost to compile the clan SY version and JCAI.
-use GNU C++ and get the OpenAL, libjpeg, zlib and boost libraries to try to get the port running on windows, fix the global AI dll loading port code and build JCAI...
I think option number one is the easiest :)
Just the AI
Hi Zaphod,
Thanks - that's helpful, are you saying that the whole of Spring can't be built with GNU tools or the AI dll? It's only the AI that I want to build.
I'm hoping that thought the main body of the Spring code might contain some unpleasant proprietary MS stuff that the interface to the Global AI is clean?
I'm (perhaps naively) hoping to be able to build an AI DLL against a given API, so that I don't have to compile the whole of spring, but instead just drop the DLL into the right folder and hey presto it picks up my DLL at runtime instead of the default one.
All this is based on the assumption that since the AI is entirely self contained, it doesn't contain any proprietary anything and can just be written in standard C++... which may not be a valid assumption!
Cheers
Munch
Thanks - that's helpful, are you saying that the whole of Spring can't be built with GNU tools or the AI dll? It's only the AI that I want to build.
I'm hoping that thought the main body of the Spring code might contain some unpleasant proprietary MS stuff that the interface to the Global AI is clean?
I'm (perhaps naively) hoping to be able to build an AI DLL against a given API, so that I don't have to compile the whole of spring, but instead just drop the DLL into the right folder and hey presto it picks up my DLL at runtime instead of the default one.
All this is based on the assumption that since the AI is entirely self contained, it doesn't contain any proprietary anything and can just be written in standard C++... which may not be a valid assumption!
Cheers
Munch
In that case, I could be changing the std::map for the list of buildoptions, all the use of std::string and the other std::vector usage in the UnitDef and FeatureDef. But then it would still depend on structure alignment and how RTTI is implemented by the compiler.
Another option would be to implement a sort of IUnitDef and IFeatureDef interface. That's the best solution I guess.
However for the next 2 weeks I have to learn for exams so I do not have time for my AI or the AI interface...
Another option would be to implement a sort of IUnitDef and IFeatureDef interface. That's the best solution I guess.
However for the next 2 weeks I have to learn for exams so I do not have time for my AI or the AI interface...
OK Zaphod, well I'll look forward to whatever you come up with =) For my money you always want structs to be padded to the correct alignment - apart from being portable, it gives you more speed. Also you want a clean API that doesn't have any dependencies on the rest of the code. But then I'm not doing the work so I really appreciate anything that lets me get compiling!
Thanks again and all the best with the zams.
Munch
Thanks again and all the best with the zams.
Munch
Sorry, but I think it's too much trouble for what you get. Aside from creating an IUnitDef and IFeatureDef interface, which is quite a lot of work already, you also need to modify the rest of the interface to stop using STL. That is GetCurrentUnitCommands(), Command class and a bunch of IGroupAICallback stuff. All the current AI code depends on that so you have to change that as well.
If anyone wants to go through all this trouble and implement this, ok. I personally will not do this, the linux port is being worked on and when this is ready you can you use that to create an AI for. Sorry if I sound a little harsh, but I don't want to keep you waiting on nothing either.
If anyone wants to go through all this trouble and implement this, ok. I personally will not do this, the linux port is being worked on and when this is ready you can you use that to create an AI for. Sorry if I sound a little harsh, but I don't want to keep you waiting on nothing either.
For one, the SY are very restrictive in giving away SF accounts, and also because of all the changes required, the porting would leave the codebase unusable for a working window version for quite some time. It wasn't just adding linux code, it was removing all the windows code and replacing it with portable code using SDL,OpenAL and boost::thread
Also some of the linux devs really hated CVS and wanted to use subversion.
So because it had to be a seperate branch anyway, they decided to use a subversion repository.
Also some of the linux devs really hated CVS and wanted to use subversion.
So because it had to be a seperate branch anyway, they decided to use a subversion repository.