Archived

This topic is now archived and is closed to further replies.

Moe

Quake 3 map loading questions…

Recommended Posts

Moe    1256
I have a few questions for those people who have loaded Quake 3 maps in either OpenGL or DirectX. I have found a link to the Quake 3 map specs, and how the files themselves are arranged. I haven''t seen any actual code to load the maps. How did you make the jump from reading the specs to actually loading a map? Did you just make a really simple map and look at it in something like notepad? What programs are used for creating the maps? (I can''t remember the name of the only program that I have heard of. Quake 3 Radiant?) Are these programs relatively easy to learn/use? I noticed in the map specs a lump called vis (or visibility). This is for determining what parts of the levels are visible and what parts aren''t? How hard is it to get this working properly? I realize that some of these questions may seem simple, but I am just trying to learn how to do this. I can imagine some of you guys are seasoned pros that learned this sort of thing from the original Quake maps. So far the only type of 3d files that I have done are .x files and Milkshape text files. I really like the Milkshape models because it''s an easy program to work with and the files are easy to load. Moe''s Site

Share this post


Link to post
Share on other sites
SirKnight    316
q3 maps are made with either Q3Radiant or GTKRadiant. There are a lot of q3 bsp viewers out there. Just search in google for some. The most well known are Aftershock and Titan engines. I would recommend looking at Aftershock, some of the code in the Titan engine was taken from Aftershock and Aftershock has less code so its easier for a beginner of this type of thing to get going. The Aftershock web page also has a msg board and the creator Martin Kraus (sorry if i misspeled your name Martin ) is there to help on any questions about q3 engine stuff.

-SirKnight

Share this post


Link to post
Share on other sites
Vetinari    133
OK now I can answer your questions.
quote:

How did you make the jump from reading the specs to actually loading a map? Did you just make a really simple map and look at it in something like notepad?


Nope, .bsp files are in binary so it would look like garbage in notepad. I started out by loading the whole thing into memory. I then played around with the data until I plotted all the verts using GL_POINTS. I built from there...

quote:

I noticed in the map specs a lump called vis (or visibility). This is for determining what parts of the levels are visible and what parts aren''t? How hard is it to get this working properly?


Yes, but this is really one of the last steps in the process. I would get 10-40 fps on my TNT2 with no visibility testing. I now get rates equal to Q3, course they do a few more things per frame than me.


Mike

Share this post


Link to post
Share on other sites
Moe    1256
Ok, so I guess I will bump the visibility down on my list of priorities.

I have another question. Have you got the texturing and lightmapping to work properly? This is part of the reason I don''t want to write my own level editor, is because I don''t know how to generate light maps. I could probably figure it out with a bit of research, but that means I would be using time...

Moe''s Site

Share this post


Link to post
Share on other sites
siaspete    208
That sounds like how I did it.

Just focus on drawing a huge list of points, then you can move onto drawing all the polys.

There is a pretty big jump in there when you start going through all the nodes and leaves.

Share this post


Link to post
Share on other sites
craymail    122
Moe, send (or post here) your email address and I will send you a DLL I created for loading q3 .bsp files into a usuable class. I don''t think it is 100%, but it is a quick hack.

If anybody else is interested (and wont judge the hack of a code, I did it in a few hours) then I can post it online for everyone to download.

Cray

Share this post


Link to post
Share on other sites
Moe    1256
rcjbvermilion@hotmail.com

Thanks! Oh, and don''t worry, I won''t try to rip your code. I like to understand code before I make my own version of it. I don''t suppose you can send me an example map with it too, can you? I am on dial up and I am still downloading Q3Radiant.

Moe''s Site

Share this post


Link to post
Share on other sites
craymail    122
Moe, I really don''t care that much if you rip my code because it pretty much sucks, and I will be using the code from your particle artile (well, as a base).

Yes, I am the same guy

PS. I don''t really have an example map that is small. I just downloaded some from planetquake.com (faster download there then from me)

Cray

Share this post


Link to post
Share on other sites
craymail    122
As far as I Know that does not have the actual map loading routine made available since that is actually not the game engine''s source, but rather the source to the dll that controls how the game acts.

Cray

Share this post


Link to post
Share on other sites
Moe    1256
Ugh, I hate this. I am still debating with myself if I should go with the .bsp file format or the .t3d file format (Unreal Tournament text file format). They both seem fairly confusing and I don''t want to end up making my own level editor. Maybe I should try loading in some sort of heightmap first...

Moe''s Site

Share this post


Link to post
Share on other sites
craymail    122
What you should do is create your own file format (internal) that displays the data how YOU understand it and then write convertors for other formats.

Whenever I have been playing around with this type of stuff I have created an internal map, or world, or whatever, class that actually holds the data in a way I can understand / remember. Then I either create internal conversion code or plugins that takes the format I want to import and convert it to the data that I internally created.

This allows me to use editors to create data easily while still working with the map data in a form that I can understand and that suits my needs.

Cray

Share this post


Link to post
Share on other sites
Vetinari    133
What''s confusing about the BSP format? I''d start by just loadking up the vertices and displaying them all as points...


Mike

"The state is that great fiction by which everyone tries to live at the expense of everyone else." - Frederick Bastiat, The Law

Share this post


Link to post
Share on other sites
Moe    1256
I suppose I am confused because there is a lot to a .bsp file. The most complex file format that I have loaded before this is the Milkshape .txt files, and even that was with a bit of help. I suppose I panicked there a bit in saying what file format I want to use. I have made up my mind that I want to use the .bsp format.

One more question about the format: Do I need to do some sort of shader thing to get an outdoor looking level? I want to be able to do my own skybox thing, and I want to be able to do outdoor areas without a huge amount of trouble (eg: messing with shaders).

Moe''s Site

Share this post


Link to post
Share on other sites
Vetinari    133
There''s no reason you can''t do a skybox without shaders. Of course, a skybox is probably a way off. I would expect that it could take a while before you get the BSP format done. It took me a good month to get most of the things implemented. It should only take a few days to be able to fly around some polygons though (if you ignore the BSP tree, etc).


Mike

"The state is that great fiction by which everyone tries to live at the expense of everyone else." - Frederick Bastiat, The Law

Share this post


Link to post
Share on other sites
Moe    1256
The thing that got me worried about not being able to do my own skybox was a tutorial that I was reading on making a simple level. They use a shader to show that a certain area should show the sky through it, otherwise the object would be just like a regular wall.

What exactly do you mean by "a skybox is probably a way off"?

I think what I would like to do is write a converter that converts it from binary to text file format. I like working with text files more because I can crack them open in notepad to see what they are like. Once I have them into a text file format I can try to make another converter that converts them to a file format that I can use more easily.

Moe''s Site

Share this post


Link to post
Share on other sites