Tutorial: Making a game with DarkGDK

I’m stuck getting something working in They DoNotDie (I can read the file names of everything contained in a folder one by one and I can load map data from a pre determined specified file but I cant get the freaken thing to load from one of those files that I just read the name of which means unless I’m going to cap how many levels you can have and use predetermined names for all of them then I have no idea how to go about having multiple maps in the game) and getting kinda frustrated. Anyways I’ll go back and work it out later but right its got me feeling like starting something new so I figured I would make a basic shooter with some time controls (I always felt like Time Shift was cooler then people gave it credit for being) and I figured I would in the process write a game making tutorial showing how I did it to help anyone interested in making games get started. Basically everything here is based on the assumption that you want to make a 3D game and you want to make it with DarkGDK and I doubt there will be much that you can learn here that would translate to anything else. Also I should point out that this is how I do things which isn’t necessarily ever the ideal way to do things. Anyways lets proceed.

Part 1: The setup

First up if you don’t already have it then you should download and install Microsoft Visual C++. You can get the express edition free at the address bellow. You can use DarkGDK with other IDEs/compilers but I seriously recommend you get Microsoft Visual C++ 2008 Express.

http://www.microsoft.com/express/vc/

next up download and install the DirectX SDK

http://download.microsoft.com/download/3/3/f/33f1af6e-c61b-4f14-a0de-3e9096ed4b3a/dxsdk_aug2007.exe

Apparently there are problems with Using DarkGDK if you install it before compiling something so first open up visual c++ express and click file/new/project at the menu bar. Then under Visual C++/Win32 select Win32 Project and enter whatever you want for a name and select ok and just hit finish for the next window the pops up. then go to build/build solution (or hit F7) and it will compile the project that was just generated. Now you can exit out of Visual C++ express and if you want even delete that project.

Then go download and install DarkGDK.

http://go.microsoft.com/?linkid=7708310

Open up Microsoft Visual C++ 2008 Express again. Hit file/new/project. This time select wizard then Dark GDK – 3D Game and name it whatever you want to name your game (I’m going with Time Frack). Then go to build/configuration manger and set it to release. Now open up Main.cpp (it should be listed in the sidebar so just double click on it) so you can start making changes and your also probably going to want to read through it once to get a basic understanding of how to do things (anything with // before it which shows up as green will be ignored by the compiler and in this case that ignored text very well describes what everything is).

Now since DarkGDK’s built in collision detection is terrible if you want to check for collisions with 3d objects then your going to want to use Sparky’s collision detection which is pure awesome. So just slap #include “SC_Collision.h” right bellow #include “DarkGDK.h” near the top of into main.cpp.

Unfortunately it wont work now because SC_Collision.h doesn’t actually exist or at least not on your computer. So go get it. Remember you want the DarkGDK version. I think your also going to need to make an account at the Game Creators Forum to get the download but if anyone wants me to I’ll upload it here.

http://forum.thegamecreators.com/?m=forum_view&t=74762&b=5

Once you have gotten the download and extracted everything from the rar file your going to want to put the SC_Collision.h file (found in the include subfolder) and SC_Collision.lib (found in the libVS8 subfolder) somewhere and leave them there undisturbed. Personally I just took the include and lib folders and dropped em into my Time Frack project folder (which in my case is at C:Documents and SettingsOwnerMy DocumentsVisual Studio 2008ProjectsTime FrackTime Frack). Next up your going to want to tell your game where it can find those important files. So hit project/Time Frack properties. Then under Configuration Properties/ C/C++ / General your going to need to add the folder that SC_Collision.h is in (in my case “C:Documents and SettingsOwnerMy DocumentsVisual Studio 2008ProjectsTime FrackTime Frackinclude”) to Additional Include Directories. Next you need to do the same for SC_Collision.lib only this time under Configuration Properties/ Linker / General and add the address to Additional Library Directories. Then hit ok and then file/save all.

For now I suggest just leaving everything else as is and first hit build/build solution so we can compile the game and see if everything is working. In my case the compiled and ready to use executable was generated at C:Documents and SettingsOwnerMy DocumentsVisual Studio 2008ProjectsTime FrackTime FrackRelease but that might be somewhat different for you.

If that newly compiled executable works and when you run it some round polygonal shapes spin on screen then do a little celebratory dance and be happy knowing that your at least as smart as the average modern day child and can successfully install pre made software. If that executable doesn’t work or wasn’t generated or you got stuck on anything I said to do then feel free to vent your rage in the comments and I’ll do my best to calmly apologize for my mistakes or poorly phrased instructions and try to rectify the situation. This is getting a bit long so I’ll stop for now and continue tomorrow.