Class to read additional informations from Quake3 .bsp Files

A forum to store posts deemed exceptionally wise and useful

Class to read additional informations from Quake3 .bsp Files

Postby plummi » Mon Jan 12, 2004 8:40 pm

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
plummi
 
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Postby niko » Tue Jan 13, 2004 10:26 am

Very useful. Some people at this forum were already asking for a feature like that. :)
User avatar
niko
Site Admin
 
Posts: 1758
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria

new Version

Postby plummi » Tue Jan 13, 2004 1:30 pm

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
plummi
 
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Postby deps » Tue Jan 13, 2004 2:16 pm

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?
deps
 
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Postby keless » Tue Jan 13, 2004 2:57 pm

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
keless
 
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Postby plummi » Tue Jan 13, 2004 3:19 pm

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...
plummi
 
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Postby deps » Tue Jan 13, 2004 3:28 pm

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

Postby deps » Tue Jan 13, 2004 3:45 pm

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 = "";
deps
 
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Postby plummi » Tue Jan 13, 2004 7:55 pm

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

Postby plummi » Wed Jan 14, 2004 3:21 pm

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 ;) )
plummi
 
Posts: 12
Joined: Wed Dec 31, 2003 7:41 am
Location: Hannover, Germany

Postby keless » Wed Jan 14, 2004 4:21 pm

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
keless
 
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Postby Zaelsius » Mon Jan 19, 2004 10:26 pm

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!
Zaelsius
 
Posts: 38
Joined: Sat Aug 23, 2003 12:02 pm
Location: Alicante, Spain

Postby patlecat » Wed Feb 18, 2004 12:11 pm

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.
patlecat
 
Posts: 27
Joined: Wed Feb 18, 2004 11:19 am
Location: Switzerland

does Irrlicht .5 automatically have this?

Postby Wolf Dreamer » Fri Feb 20, 2004 9:54 pm

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
Wolf Dreamer
 
Posts: 121
Joined: Tue Feb 10, 2004 6:39 am
Location: the land of chaotic dreams

Re: does Irrlicht .5 automatically have this?

Postby patlecat » Sat Feb 21, 2004 10:30 am

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).
patlecat
 
Posts: 27
Joined: Wed Feb 18, 2004 11:19 am
Location: Switzerland

Next

Return to FAQs, Tutorials, Howtos, and external tool lists

Who is online

Users browsing this forum: No registered users and 0 guests