|
Level Editing with GTK Radiant
A major part of and game development is content creation. I think anyone who has worked on game content will agree having good tools is incredibly important. However as hobbyist game programmers developing a tool set can be just as much work as developing the game itself. In this case using 3rd party tools can make a lot of sense as they allow you to focus on what you want to focus on... game development.
In this section I am going to talk about id software's freely available quake map editor and how to save time by taking advantage of it as your level design tool.
What is GtkRadiant?
GtkRadiant is a 3d level design tool designed by id Software for use with the quake series of games and other licenced products using the quake engines. GtkRadiant is free software distributed under the GNU GPL and is available for download here http://www.qeradiant.com/cgi-bin/trac.cgi .
Why use GtkRadiant?
-Like using any prebuilt system you are saving yourself time and effort by not designing and building the editor yourself.
-GtkRadiant is designed to be customized and can be easily setup to work for many different games.
-The entity system is very flexible, and allows for the import of custom models and properties.
-GtkRadiant is proven technology, dozens of commercial games have been created that used GtkRadiant as their level design tool.
Why not use GtkRadiant?
-The Map format is difficult to parse
-Geometry is limited to convex polyhedron
-You have to learn how to use it
Setting Up GtkRadiant
To setup GtkRadiant you need to create a working folder, a game definition file, and a game configuration folder. We also have to define some game entities. To do this easily we can copy an existing definition file and configuration folder and just rename a few parameters to get it started as our own.
1. Create a new folder to be the base folder for your game type. This folder can be located anywhere you like and will store the maps, textures, and models used by GtkRadiant. For this example I created the folder c:\myGame
2. Define a new game type by going to the GtkRadiant game folder (default c:\Program Files\GtkRadiant 1.5.0\games\ ) and making a copy of the q2.game. Rename the q2.game copy to your game name, for this example I named my file "my.game". Open your .game file in your favorite text editor and change the following lines
name="Name of the Game Here"
texturetypes="jpg bmp png"
Don't worry that a lot of the other lines still read quake 2 this won't effect our use of the file.
3. Create a .game folder in the GtkRadiant folder by copying the q2.game folder and renaming it to your .game name. This must match the .game file name from step 2.
4. Inside our new .game folder there is a file called entities.def this defines all of the different entities that will be available to add to a level inside GtkRadiant. Right now this file has all of the quake 2 entities defined in it. For now open the file and delete it's contents. Later we will add entities specific to your game.
5. Finally run GtkRadiant. You will be prompted by The Global Preferences window to select a game. Select your game from the drop down and press ok. You will be prompted that the engine path cannot be found. Browse to the folder you created in step one and press ok. GtkRadiant should now start.
Processing Map Files
The Map files produced by GtkRadiant are in an unfortunately unfriendly format. Geometry is defined as convex hulls defined by the intersection of 4 or more planes. I imagine this definition was for optimized processing by lighting and visibility calculations done when compiling into a quake BSP. For our uses this is not ideal, and we need to convert the plane representation into a triangle mesh. This process is actaully quite painful to describe so I am providing this C# project (.map converter) which parses the .map format and creates an XML file with all the entities and level geometry as triangles meshes in a human readable format. The source for the map converter is messy and uncommented, but provided in case it may be useful, or to allow changes to the converter if needed.
Loading XML
Comming Soon...
|