July 15th, 2010, 10:11 AM
Help compiling source code for AI bot dll
Can someone help me figure out what I am doing wrong? Basically I want to compile readily available source code into a dll for games, I'm following the API devs instructions but won't compile. I already have the .dll and the AI bot works, but I want to be able to compile it myself so later on I can make changes to the bot. Even with the included ivai.vcproj file I try to build from that the compiler gives me no errors but at runtime the bot still crashes the game.. yet the precompiled one works just fine! They should be identical!
I've never used Visual Studio before. Recently I became interested in tweaking with the AI bot of a particular game called Defcon. The API is explained here: http://www.doc.ic.ac.uk/~rb1006/projects:api and the actual bot with complete source code is here ( http://wwwhomes.doc.ic.ac.uk/%7Erb10...i_bot_v0.9.zip )
I was able to install the bot and play with it on the bot enabled version of Defcon.exe ( http://www.doc.ic.ac.uk/%7Erb1006/_m...pi&cache=cache )
But the whole point is I wanted to see if I could compile this successfully myself from scratch (actually the source code is made available, I just need to know how to get the darn thing compiled correctly for the game..) so that later on I can tweak the code in some ways to made improvements on the default bot AI..
I'm having trouble getting it to compile.. I followed all the instructions of "To be able to compile a dll for the use with DEFCON , follow these steps:":
1. Obtain the code for an existing bot, for example simplebot. Place the code into
any folder, for example DEFCON\AI\myBot\source.
2. Open Visual Studio and create a new project from the existing code. In our
example, use DEFCON\AI\myBot as folder. If possible, select Dynamic Link
Library as default project conﬁguration type.
3. Set the conﬁguration to Release.
4. The following settings will concern the project properties, viewable with Project-
>Properties. For the following settings, the location in the properties for Visual
Studio 20081 have been given in brackets).
5. (Optional) Set the output directory to $(SolutionDir) to create the .dll in the right
place for DEFCON to ﬁnd. (Conﬁguration Properties - General)
6. Add source/ as additional include directory (Conﬁguration Properties - C/C++ -
7. Make sure Runtime Library is set to Multi-threaded DLL (/MD) (Conﬁguration
Properties - C/C++ - Code Generation)
8. Specify the Module Deﬁnition File to source/dl l/bot.def (Conﬁguration Properties
- Linker - Input)
Now you should be able to compile a dll, which works with DEFCON ."
But I couldn't get it to work. No matter how many times I read his instructions I don't know how to do steps #4, #5, #6, #7, #8...
I've never used Visual Studio before but his instructions simple aren't intuitive and I believe there is a disconnect between what he is trying to instruct and what he actually did to get it to work for himself..
I was able to successfully play around with both the simplebot (which doesn't do anything) and the ivai.dll (IV AI aka Original4 bot) which is basically just the exact same thing as the default AI coded in the default game. So I got the bot enabled version of Defcon and did get the prebuilt and precombiled bots up and running..
However when I tried to compile I always run into problems following his instructions above.. they are not very clear nor intuitive.. so I found a ivai.vcproj file in the visualstudio_files subdirectory of the iv ai folder and compiled it that way.. basically this was the project he set up and saved and should be the project that he used to compile the ivai.dll that I was able to verify was working on my computer with the bot enabled version of Defcon..
Yet when I build and compile it (no errors ) the ivai.dll updates like it is supposed to do. I can't think of what I could be doing wrong. When I try to run the bot it crashes to desktop and gives me error code 3...
Does anyone know what I am missing and how I can fix this? Thanks
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!