Class to read additional informations from Quake3 .bsp Files

A forum to store posts deemed exceptionally wise and useful
plummi
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Class to read additional informations from Quake3 .bsp Files

Post by plummi »

Since the Quake3-BSP MeshLoader from the Irrlicht-Engine only loads the Mesh itselt, I've written a Class which is aimed to load all the other informations stored in those files.

I've startet with the Entities which you can easily place on .bsp-Maps in GtkRadiant for example. For now it only loads and processes the ammo_* Entites but since I need to extend the Class for myself, I think that in a couple of days (or weeks:D) it will process all (or almost all) of the other Entities, too.

In the Future it could be used to e.g. automatically place Enemies (in form of MD3-Files which could be loaded with madinitaly's MD3-Loader, of course!) or other things on the map.

It's quite simple to use and also documentation is avaible for it. If you want, please test it! I hope that it is useful for someone. :)
http://www.plummi.de/bspReader_0_1.zip

Greets,
Plummi
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Very useful. Some people at this forum were already asking for a feature like that. :)
plummi
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

new Version

Post by plummi »

Thank you niko! It's good to read that someone find my work useful but... whom do I write that! ;)

Just released a new Version.
I've added support for the following Entities:
  • Entity Worldspawn
    Entity info_player_deathmatch
    Entity info_player_start
And a litte Bugfix at the Dimension of the ammo_* Entities.

The latest Version will always be at http://www.plummi.de/bspReader_latest.zip

@all: Since I don't play Quake3 (I don't even HAVE Quake3) I need much feedback. Please, write me what is important for you.

Greets,
Plummi
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

Got some problems compiling.
It chokes on this one;

in function

Code: Select all

void CBspFileEntityReader::loadEntities(tBSPLump* l, io::IReadFile* file)
The line:

Code: Select all

c8 buffer[ l->length ];
expected constant expression
cannot allocate an array of constant size 0
'buffer' : unknown size

Using MSVC++6 and irrlicht 0.4.2

Got any clues of what i can do about it?
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

without knowing his code very well, typically you need to create a dynamic array:

c8 * buffer;
buffer = new c8[l->length];


and dont forget to clean up!
delete [] buffer;
a screen cap is worth 0x100000 DWORDS
plummi
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Post by plummi »

keless is right, sorry for that.
I don't have any experience with the msvc++ Toolchain, the GNU MinGW-Toolchain dosn't declare that as an error.

I've uploaded a corrected version...
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

Code: Select all

c8 * buffer;
buffer = new c8[l->length]; 
*smacks head*
I knew that! :P :wink:

Got another bug. I had to swap the Y and Z coordinates for the player_starts to be at the correct position in the q3 map.

Rotation seemes to be a bit off too. If I in gtkradiant rotate an info_player_start to 180 or 360 degreees it points in the right way, but 90 and 270 is pointing in the opposite direction.
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

Another compiler thing.

Code: Select all

tEntityPair pair = {"",""};
tEntityPair	classnamePair = {"classname",""}
msvc++ doesn't like that.

'pair' : non-aggregates cannot be initialized with initializer list
'classnamePair' : non-aggregates cannot be initialized with initializer list

I have to split them up and do

pair.key = "";
pair.val = "";
plummi
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Post by plummi »

deps wrote: Got another bug. I had to swap the Y and Z coordinates for the player_starts to be at the correct position in the q3 map.
I've searched for the reason of this and now I don't think it's my fault.
When you have time, please take my test-source from http://www.plummi.de/q3loader.zip
The map is loaded by the normal irrlichtEngine but nevertheless the Y/Z-Axis are switched!
Perhaps it's a problem of the Engine itself..?

Does somebody knows about a Problem with the axis with bsp-Maps?
plummi
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Post by plummi »

Y/Z-Axis and Angle are now calculated correctly.
The newest version should compile without any problems on the msvc++ compiler.

I don't want to flood the Forum with "new Release" Posts, so i decited to inform at http://www.plummi.de about new releases. (For the non german-speaking: Click on bspReader on the left to the Website, no fear it's in english ;) )
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

i actually have asked for a new forum topic specifically for project updates:
http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=986

there seem to be 10 'yes' votes-- so hopefully Sai (the forum keeper) will notice and start one soon.
a screen cap is worth 0x100000 DWORDS
Zaelsius
Posts: 38
Joined: Sat Aug 23, 2003 12:02 pm
Location: Alicante, Spain
Contact:

Post by Zaelsius »

Very nice addition, Plummi. I feared I'd have to do it myself... but you've just saved me a lot of work :D

Thanks I say, and keep up the good work!
patlecat
Posts: 27
Joined: Wed Feb 18, 2004 11:19 am
Location: Switzerland

Post by patlecat »

Super Sache plummi, echt! 8)
I also want my artists to be able to construct maps with entities. Say would you happen to know a bit more about the RTCW extensions of Q3 BSPs?

Keep it up mate!


PS: Pls use the unicode equivalents for text, just as irrLicht does.
Wolf Dreamer
Posts: 121
Joined: Tue Feb 10, 2004 6:39 am
Location: the land of chaotic dreams
Contact:

does Irrlicht .5 automatically have this?

Post by Wolf Dreamer »

Does Irrlicht .5 automatically have this included in it? If not, then why not? Seems like a logical thing to do.

I just noticed this, as someone recently posted to this month old thread, so I thought I'd ask.

http://www.flipcode.com/tutorials/tut_q2levels.shtml listed everything about the bsp format, and what things are stored where in it.
The last sane human being in a world gone mad

http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
patlecat
Posts: 27
Joined: Wed Feb 18, 2004 11:19 am
Location: Switzerland

Re: does Irrlicht .5 automatically have this?

Post by patlecat »

Wolf Dreamer wrote:Does Irrlicht .5 automatically have this included in it? If not, then why not? Seems like a logical thing to do.
Totally agreed!
Wolf Dreamer wrote:http://www.flipcode.com/tutorials/tut_q2levels.shtml listed everything about the bsp format, and what things are stored where in it.
Thanx for the link but it's not what I need (read my post again).
Post Reply