BSP Loader doesn't work
hey,
i saw there was another post like this already, but my problem's a little bit different. I am also basing my loader off of the gametutorials stuff, however when i run the program, i get "malloc vm_allocate errors" saying that the memory couldn't be allocated. it wants to allocat like 2200 megs for face data. someone brought up the question is my hard drive full, no it is not. i haven't tried endian swapping, but i did go through the trouble of downloading radiant, a quake level editor and just making a simple room and compiled it as a bsp file, and the program still doesn't work. i still get the same allocation error. mind you, this is a c++ program and i'm using new in it, so that's probably why the program is terminating when the memory can't be allocated (a point someone else brought up about malloc returning a null pointer). If anyone has gotten a bsp loader working on the mac, and can enlighten me as to what files will work and whatnot, what i'd have to do to compile them so they'll work on the mac, anything. i'm really stuck.
thank you.
i saw there was another post like this already, but my problem's a little bit different. I am also basing my loader off of the gametutorials stuff, however when i run the program, i get "malloc vm_allocate errors" saying that the memory couldn't be allocated. it wants to allocat like 2200 megs for face data. someone brought up the question is my hard drive full, no it is not. i haven't tried endian swapping, but i did go through the trouble of downloading radiant, a quake level editor and just making a simple room and compiled it as a bsp file, and the program still doesn't work. i still get the same allocation error. mind you, this is a c++ program and i'm using new in it, so that's probably why the program is terminating when the memory can't be allocated (a point someone else brought up about malloc returning a null pointer). If anyone has gotten a bsp loader working on the mac, and can enlighten me as to what files will work and whatnot, what i'd have to do to compile them so they'll work on the mac, anything. i'm really stuck.
thank you.
The GameTutorials.com BSP loader doesn't handle endianness correctly, amongst other major flaws. I'd suggest not using it at all, but swapping the bytes appropriately as they're loaded from the file might be enough to get it working.
hey,
could you explain how it doesn't handle it correctly. because when i compile a .bsp with gtkradiant on a mac, it still thinks there are like 180,000 vertices, when in actuality, there are 8. obviously an endian error of some sort, but why does it still happen, the map is compiled on a mac. wierdness. why does the tutorial handle it wrong, just wondering.
thank you.
could you explain how it doesn't handle it correctly. because when i compile a .bsp with gtkradiant on a mac, it still thinks there are like 180,000 vertices, when in actuality, there are 8. obviously an endian error of some sort, but why does it still happen, the map is compiled on a mac. wierdness. why does the tutorial handle it wrong, just wondering.
thank you.
BSP files are always little-endian, regardless of where they were made. q3map2 does the right thing -- the tutorial doesn't.
The tutorial doens't handle it correctly because it was written by ignorant Windows programmers, and ported to Linux by lazy Linux programmers
The tutorial doens't handle it correctly because it was written by ignorant Windows programmers, and ported to Linux by lazy Linux programmers
I actually downloaded the bsploader (SDL version) tutorial a while ago and I eventually got it working. If you want, I can send you my code. it was actually only a matter of converting little endian values to big endian, which took me about an hour to figure out.
bobby, I would absolutely love that! I converted the SDL code using a lib keith created here to solve the endian issue, but for some odd reason my code doesn't work (and the only difference I can think of between my efforts and yours is keith's code....hrm...).
If you could contact me via AIM and send me the files I'm be very appreciative.
btw, all of a sudden I develope interest in .bsp files and it seems the iDG commumity follows my interest.
Does this make me God?
If you could contact me via AIM and send me the files I'm be very appreciative.
btw, all of a sudden I develope interest in .bsp files and it seems the iDG commumity follows my interest.
Does this make me God?
Seth wouldn't mind looking at that either if Bobby would let him. 
That would at least lessen the burden to figuring out HOW THE CRAP(?!) Radiant works...

That would at least lessen the burden to figuring out HOW THE CRAP(?!) Radiant works...
OneSadCookie Wrote:The tutorial doens't handle it correctly because it was written by ignorant Windows programmers, and ported to Linux by lazy Linux programmersI resemble that remark!
Because I'm a Windows/Linux/Mac programmer. Oi my head hurts.
If people are still looking at this, it should be said that the tutorial is very broken with respect to rendering the level geometry. It'll work with maps generated with old versions of the q3map tool, but not with maps generated by q3map2.
http://onesadcookie.is-a-geek.net/svn/repos/Q3A_BSP/ is a partially-implemented loader that works on both Mac OS X and x86 Linux, at least. It isn't as complete as the GameTutorials one, but it does render the geometry correctly
http://onesadcookie.is-a-geek.net/svn/repos/Q3A_BSP/ is a partially-implemented loader that works on both Mac OS X and x86 Linux, at least. It isn't as complete as the GameTutorials one, but it does render the geometry correctly

