GtkRadiant <--> Irrlicht

A forum to store posts deemed exceptionally wise and useful
Post Reply
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

GtkRadiant <--> Irrlicht

Post by rt »

the goal of this tutorial is to help new users to irrlict as well as to GtkRadiant (hereafter to be referred to as 'GTKR'). this tutorial will show you the basics of how to use GTKR to create a simple room and import it into irrlicht. if you feel that i've missed something or just don't like any part of this then please post a reply and i will edit this post until it pleases the masses :) i haven't created any screenshots yet, but i could if there is a demand for them.

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
save the file as build_bsp.bat in your GtkRadiant folder. after running this file check your baseq3\maps folder and you should see MY_LEVEL_NAME.bsp. almost done! use winzip to create a zip file which contains the .bsp level as well as any textures that you used when creating the level. move that .zip file to your irrlicht project folder.

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) );
}
it might look familier because it is the same code used in the quake3 map tutorial (http://irrlicht.sourceforge.net/tut002.html). just use your file names for the level.

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 8)
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
- for more info on q3map2's command line options check out this page (http://shaderlab.com/q3map2/manual/). it's what i used to figure out how to compile my map
- lots of gtk tutorials here (http://q3lab.telefragged.com/maptutorials.shtml)
Last edited by rt on Sat Jan 03, 2004 6:54 pm, edited 1 time in total.
Guest

GtkRadiant

Post by Guest »

Thanks for the tutorial, I was able to get a simple room up and running in irrlicht quite quickly. I especially found the .bat file and the instruction on creating the zip helpful.

One note, I had to 'disable' the shader options in GtkRadiant in order for my textures to appear correctly (uncheck the show shaders in the texture menu).
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

I still got some missing triangles in my levels. :(
They dont start in one corner and goes to the next one, however.
One corner usually is somewhere in the middle of a wall.
I tried to use -nosubdivide with q3map2 but it didn't help.
(-nosubdivide was the only option i found in the manual that i thought could have something to do witht he problem, if you know of any other argument i could try, please tell me)
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

deps wrote:I still got some missing triangles in my levels. :(
They dont start in one corner and goes to the next one, however.
One corner usually is somewhere in the middle of a wall.
i think i know what you are talking about. please post a screenshot and your .bat file
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

Here is a screen of it
Image
That green block is not part of it i think. I have seen the bug alone on walls. But i dont have any good map to show a screenshot from.

and the batfile looks like the one you posted. Except that i once tried to add -nosubdivide on the first line, right after -game quake3
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

deps wrote:Here is a screen of it
That green block is not part of it i think. I have seen the bug alone on walls. But i dont have any good map to show a screenshot from.

and the batfile looks like the one you posted. Except that i once tried to add -nosubdivide on the first line, right after -game quake3
hmm.. i can't tell what's going wrong from that screenshot. could you create a simple box room (like the one i describe in the tutorial) and post a screenshot while looking at one of the walls? (kinda like the screenshots i posted in this thread http://irrlicht.sourceforge.net/phpBB2/ ... c.php?t=82)

does this problem happen on all .bsp maps? can you post a link to the .map or .bsp file that is causing the trouble?
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

I was unable to create a map that got the error. Looks like it is a bit random.
However, it doesn't help to recompile the map.
And i have tried some different q3map2 releases but they all creates holes.

But i found a small map i once made that got holes in the walls.
If you move the camera outside the room, all walls are invisible, not just parts of them.

zip with bsp and textures:
Click
And the .map file
Click again

hope that helps.

Sometimes the bug can dissapear if i change the size of the floors/walls.
But that can create new holes to. And i don want to change-compile-run-change-compile-run until they go away. :P
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

deps wrote:Sometimes the bug can dissapear if i change the size of the floors/walls.
But that can create new holes to. And i don want to change-compile-run-change-compile-run until they go away. :P
i was able to download the .bsp and i see two triangles missing.. one on each 'long' side of the room. very odd.
however i was unable to use your .map file, you seem to have created a .html from it, and i need the raw .map data so that i can load it into GTKR.

i notice that the decal along the walls is in front of the missing triangle, perhaps there is something wrong with the wall? if i had the .map file i could take a look
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Mawnee

Post by Mawnee »

When I use the converter..it is creating a .BAK file instead of a .bsp ?
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

sadly seems gtkradiant aint available either for comercial projects...

http://www.qeradiant.com/?data=legal
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

excuse me if saying very obvious things...I don't know nothing about map editing world.

quark army knife seems to be gpl. so not tied to id or something. At least, to generate the map file.

And it looks quite graphical and user firendly...


the problem is the q3 bsp compiler (as irlitch bsps are not Halflife ones, if not, hl bsps are freely compiled with the zhlt tools...)

But deps , that map compiler you said works ok?

Are the lightmaps -magically- generated in quark? That'd cut the need of having an expensive renderer like max to create the lightmaps...

btw, other compiler, but said to be quite wip yet...

http://map3bspc.sourceforge.net/


and a tool to parse lightmaps from a bsp..I am actually interested in a map editor that lets me create the lights (even if not possible radiosity) not a tool to parse from an existing created map...

ouch, cant find it now...

another tool
http://home.snafu.de/hg/vrml/q3bsp/q3bsp.html

a tut for q3map2
http://www.inficad.com/~mnichol/dummies/index

and a gui for it?
http://www.fileplanet.com/dl/dl.asp?/pl ... _setup.exe


well, I think is just a bit going to far with this. As supposedly the lmtools and FSRad are freeware or gpl tools to generate the lightmaps... I guess then is a matter of playing with the mesh and importin later the x file and the lightmap tga....


Anyway, the modelling tools in those level editors are quite basic compared to a full fledged modeller....
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

If anyone is interested in having the above tut in pdf get it here:

http://www.theshower.nl/cgi-bin/genesis ... torial.zip

btw. I'm gonna start collecting as many tuts as I can and put them all together in a single pdf file. Something like a guide for newbies like me.

more news to come!
Image
ThinG[evolve]
Posts: 1
Joined: Mon Mar 15, 2004 12:04 pm

Post by ThinG[evolve] »

vermeer wrote:Anyway, the modelling tools in those level editors are quite basic compared to a full fledged modeller....
Yes they are. World geometry is built from concave 'brushes'. Tools like GTKRadiant enable you to build a map quite quickly using this method. much like building with bricks, where the brick can be any size and shape you want (as long as it is concave). To add fine detail you would create a model in something like maya and import this into your map.
Post Reply