Quake 3 BSP Loader

Nice, I'd love to see profiler results on where CPU time is spent when the frame rate starts crawling at certain locations.

Ok folks, here you go.  A link to the zip file containing the relatively cleaned up version of the Quake 3 BSP and MD3 loaders.  I didn’t have time to write an app to actually view MD3’s yet, but I figured some people would want to take a look at the loading code ASAP.  :smiley:



http://snipehunt.net/devel/bspTestSrc.jar



Now I really need comments on this, I would love to get this into the jme engine and have some help cleaning/improving performance with it.

Hey, don't mean to rain on your parade but your code had some problems, as in the boundingbox constructor that didn't work, I fixed all the compile time errors but still when I run it I get null pointer problems:

java.lang.NullPointerException

at snipehunt.glutils.loader.bsp.ui.BspMenu.<init>(BspMenu.java:51)

at snipehunt.glutils.jme.BspTest.doBspMenu(BspTest.java:45)

at snipehunt.glutils.jme.BspTest.main(BspTest.java:39)

java.lang.NullPointerException

at snipehunt.glutils.loader.bsp.ui.BspMenu.<init>(BspMenu.java:51)

at snipehunt.glutils.jme.BspTest.doBspMenu(BspTest.java:45)

at snipehunt.glutils.jme.BspTest.main(BspTest.java:39)



I had to actually put your code with the jme code, I mean maybe if you could take out your engine specific stuff and just had a stripped down version I could check your code in order to optimize.  thanks though keep up the great work.

-Nate

Ok, the jar file at the same url as before is now updated with a set of files that allow it to run against a completely unmodified CVS checkout of jme.



http://snipehunt.net/devel/bspTestSrc.jar





To run this, you’ll also need the resources zip file in your classpath, which is here:



EDIT: Url is fixed now, thanks mojo



http://snipehunt.net/devel/jnlp/rez.zip



That should enable you to get started from the command line.

http://snipehunt.net/devel/rez.zip appears to be an invalid URL.

Its not invalid your missing a directory, but the file does in fact tell me that the jar file is corrupted when I downloaded it, and even though I got some files out of it, an error occurs when SkyGenFunctions.java cannot be found.  So I'm not sure if you still have other files that you didn't include but do you think you could let us know how this all fits together as well?  Thanks a lot

I'm not sure which file you got was corrupted, but I just downloaded them both and compiled them in a separate directory, and nothing is complaining about SkyGen stuff, I took all of that out.  Can you re-download the source jar file?



The way I have it working in a nutshell is I created an extension of Node called RootPartition, which contains Partitions, which contain PartitionMeshes.  The RootPartition holds the visibility map loaded from the BSP, and every time draw is called on the RootPartition, it finds the partition the camera is currently in, and checks the visibility information to see which partitions are visible from the current one.  Then only those partitions are drawn, and those partitions draw their PartitionMeshes, which is basically a TriMesh, with a few other added things to handle the Quake3 data and geometry.

I'm sorry, guys, that I do not post so often lately, but real life kept me away from jME and it will continue to do so for quite another few weeks. It looks though as if Bakchuda has done a tremendous job here.



How is the memory consumption when loading a larger map, because that's what stopped me from further developing my version?

That's what I hope to do some more benchmarks on.  I can load a quake 3 map straight out of the demo, and just about everything loads correctly, but it's painfully slow.  I know a lot of profilers for Eclipse show call graphs and such, anybody know of ones that do well to show memory use, especially with java.nio.ByteBuffer?



In general though, the data that is loaded into memory is really tightly packed, and there's a good amount of info in the BSP that is not loaded, since it's used by the map editor.