Page 1 of 4
Class to read additional informations from Quake3 .bsp Files
Posted: Mon Jan 12, 2004 8:40 pm
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
Posted: Tue Jan 13, 2004 10:26 am
by niko
Very useful. Some people at this forum were already asking for a feature like that.
new Version
Posted: Tue Jan 13, 2004 1:30 pm
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
Posted: Tue Jan 13, 2004 2:16 pm
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:
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?
Posted: Tue Jan 13, 2004 2:57 pm
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;
Posted: Tue Jan 13, 2004 3:19 pm
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...
Posted: Tue Jan 13, 2004 3:28 pm
by deps
Code: Select all
c8 * buffer;
buffer = new c8[l->length];
*smacks head*
I knew that!
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.
Posted: Tue Jan 13, 2004 3:45 pm
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 = "";
Posted: Tue Jan 13, 2004 7:55 pm
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?
Posted: Wed Jan 14, 2004 3:21 pm
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
)
Posted: Wed Jan 14, 2004 4:21 pm
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.
Posted: Mon Jan 19, 2004 10:26 pm
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
Thanks I say, and keep up the good work!
Posted: Wed Feb 18, 2004 12:11 pm
by patlecat
Super Sache plummi, echt!
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.
does Irrlicht .5 automatically have this?
Posted: Fri Feb 20, 2004 9:54 pm
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.
Re: does Irrlicht .5 automatically have this?
Posted: Sat Feb 21, 2004 10:30 am
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!
Thanx for the link but it's not what I need (read my post again).