Document Revision 0.2
what is GtkRadiant? it's a program which can be freely downloaded and is used primarily to create 3d levels for Quake and other first-person-shooter style games. we are going to use it to create a small room which will then be compiled to a .bsp and loaded up using irrlicht.
first download GTKR from http://www.qeradiant.com/?data=files&files_dir=1. i have the quake3-RTCW version 1.3.13 (nov 10 2003) running on windows.
after you install it you should have a quake III folder (for me it's at C:\Program Files\Quake III Arena) and a GTKR folder (C:\Program Files\GtkRadiant-1.3). when you create new maps they will by default be saved under the baseq3\maps folder in the quakeIII folder.
start GTKR. the left subwindow (the one with the grid) is where you can create new objects. let's create a rectangular room. leftclick and drag a rectangle in that left window.. make the rectangle about 128x256. you've just created a box! to add some height to the box you must locate the little blue box in the very thin window to the extream left of the screen, now leftclick a bit above it and drag up to increase the height of the box. you should be able to see the box in the 3d view at this point. (the upper-right window)
if you cannot, then right-click in the 3d view window and press DOWN arrow to fly away from the box.
you can select the box in the 3d view if it is not already selected by holding down shift and leftclicking on the box. now click on selection->CSG->Make Hollow (or click the 'Hollow' button on the menubar) and poof! the box now has 4 walls a roof and a ceiling.
now it's time to texture the inner walls. in order to import textures into GTKR simply create a folder such as baseq3\textures\my_textures, then in GTKR click on Textures->Directory List and select the folder. of course you must first place whatever .jpg's you want to use into that folder.
if your box is still highlighted then simply click on one of the thumbnails in the texture preview window and your whole box will be covered with that texture. press ESCAPE to de-select the box and fly around, make sure all walls are textured.
at this point we can convert the .map level to a .bsp which is what irrlicht wants. as you can read from this thread (http://irrlicht.sourceforge.net/phpBB2/ ... c.php?t=82) if you compile the level with the -meta tag then irrlicht will not be able to properly display the level. my solution is to create our own batch file to compile the level. GTKR uses a program called q3map2 to compile the level, so we can use it too.
create a new text file and add this:
Code: Select all
"C:/Program Files/GtkRadiant-1.3/q3map2" -v -game quake3 -fs_basepath "C:/Program Files/Quake III Arena/" "C:/Program Files/Quake III Arena/baseq3/maps/MY_LEVEL_NAME.map" > "C:/Program Files/GtkRadiant-1.3/junk.txt"
pause
now to load the level in c++ we do this:
Code: Select all
device->getFileSystem()->addZipFileArchive("my_bsp_level.zip");
IAnimatedMesh* mesh = smgr->getMesh("MY_LEVEL_NAME.bsp");
ISceneNode* node = NULL;
if (mesh) {
node = smgr->addOctTreeSceneNode(mesh);
node->setPosition(irr::core::vector3df(0,0,0));
node->setScale( irr::core::vector3df(1,1,1) );
}
this concludes the (rather hasty) GTKR-irrlicht tutorial. like i said at the beginning, if you feel this is lacking some important information please let me know and i will try to update this posting. i hope this helps someone so that they don't have to waste as much time as i did figuring it all out
maybe i should add on to this tutorial by adding a 3rd person camera and perhaps some dragging of nodes around on the floor of the room using the mouse...
Notes:
- the .bat file will create a level with full bright light. if your level has it's own specific lighting then after running the first .bat file run this one
Code: Select all
"C:/Program Files/GtkRadiant-1.3/q3map2" -v -game quake3 -fs_basepath "C:/Program Files/Quake III Arena/" -light "C:/Program Files/Quake III Arena/baseq3/maps/MY_LEVEL_NAME.map" > "C:/Program Files/GtkRadiant-1.3/junk.txt"
pause
- lots of gtk tutorials here (http://q3lab.telefragged.com/maptutorials.shtml)