Trying to load MOHAA .BSP
Trying to load MOHAA .BSP
Hi
I played a bit with the Irrlicht engine to see if I could load a MOHAA map. It has a different .BSP format, the order of lumps is changed, and there's some more lumps for other stuff. Apart from that it should be compatible to Q3 .bsp format (see http://openmohaa.sf.net/)
So I changed the code to adapt to the changes. Now what I got looks like this:
Nearly all of the map remains undrawn. You can compare it to what it should look like ( screenshot taken from approx. the same position)
Notice how it says 342 polys.
something seems to be wrong. since it's getting late, i might have overlooked something.
any help appreciated.
I played a bit with the Irrlicht engine to see if I could load a MOHAA map. It has a different .BSP format, the order of lumps is changed, and there's some more lumps for other stuff. Apart from that it should be compatible to Q3 .bsp format (see http://openmohaa.sf.net/)
So I changed the code to adapt to the changes. Now what I got looks like this:
Nearly all of the map remains undrawn. You can compare it to what it should look like ( screenshot taken from approx. the same position)
Notice how it says 342 polys.
something seems to be wrong. since it's getting late, i might have overlooked something.
any help appreciated.
Re: Trying to load MOHAA .BSP
So, ahem, you wrote a bit of code that you hoped would work and it didn't? Well, that is really where the work begins.
So, you can try and debug the huge scene you are trying to load, or you can create a test scene. If you feel you cannot create a (small) test scene, then you really need (it's your code, right?) to identify the "lumps" as you load them. Take just one of these lumps and look at the data. For example, see if the position is correct - perhaps your scene is put behind the camera, perhaps the Y-value is 999999.999999. You can turn-off culling of back faces to see if you can see more of your scene. You can render as a wireframe. Some elements are displayed - try to identify these from the model you are loading. And so on.
So, you can try and debug the huge scene you are trying to load, or you can create a test scene. If you feel you cannot create a (small) test scene, then you really need (it's your code, right?) to identify the "lumps" as you load them. Take just one of these lumps and look at the data. For example, see if the position is correct - perhaps your scene is put behind the camera, perhaps the Y-value is 999999.999999. You can turn-off culling of back faces to see if you can see more of your scene. You can render as a wireframe. Some elements are displayed - try to identify these from the model you are loading. And so on.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Trying to load MOHAA .BSP
Yes, there's definitely some more work to do before not only the basic lump layout is adapted, but also all q3 specific hacks are ported properly. The very good q3 bsp support is only possible with additional code as shown in example 16 and 21. But I also think that it would be nice to have more support for such bsp files. And maybe even the q3 loader author will jump on here. So can you please upload the code or host it somewhere so others can check and extend the code? Meanwhile I'll move this topic to advanced section, as it's definitely not a typical beginner thing.
Re: Trying to load MOHAA .BSP
Of course you're right. No need to get sarcastic there.mongoose7 wrote:So, ahem, you wrote a bit of code that you hoped would work and it didn't? Well, that is really where the work begins.
I was tired and felt like an outsider's opinion would be of help. Especially since there might be some traps in the Q3 BSP loader I wouldn't know about (as hybrid suggested)
Thanks for your input. I'll tell you when I found out more...
Re: Trying to load MOHAA .BSP
Sorry. My remarks were inappropriate.
Re: Trying to load MOHAA .BSP
OK I finally got around to investigating more. It seems Irrlicht does not draw vertices when it can't load any texture for them (not even in Wireframe mode).
A simple hack in loadTextures() in CQ3LevelMesh.cpp to load textures directly by their file name instead of looking them up in the .shader files reveals more of the map:
which means the problem is in the shader loading
A simple hack in loadTextures() in CQ3LevelMesh.cpp to load textures directly by their file name instead of looking them up in the .shader files reveals more of the map:
which means the problem is in the shader loading
Re: Trying to load MOHAA .BSP
are you going to release your mohaa loader?
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Re: Trying to load MOHAA .BSP
sure, but right now I broke Q3 bsp support. I think I better redo it with clean latest SVN revision, and do it with BSP version distinction. do you want me to just post a diff or set up a seperate SVN?Sudi wrote:are you going to release your mohaa loader?
Re: Trying to load MOHAA .BSP
can't you release as a seperate loader? then people who want to use it can simply attach the new loader without recompiling.wombat wrote:sure, but right now I broke Q3 bsp support. I think I better redo it with clean latest SVN revision, and do it with BSP version distinction. do you want me to just post a diff or set up a seperate SVN?Sudi wrote:are you going to release your mohaa loader?
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
-
- Posts: 70
- Joined: Tue Oct 28, 2008 12:59 pm
Re: Trying to load MOHAA .BSP
You can upload your source for everybody test. Thankx
Re: Trying to load MOHAA .BSP
yes, i redone it minimally invasive seperate files and class for CMOHAAMeshLoader based on CQ3MeshLoader. + a small change in CBSPMeshFileLoader.cpp to automatically choose the right MeshLoader. I'll test and upload it later this day.
Re: Trying to load MOHAA .BSP
OK I uploaded what I got so far (not much). It needs proper shader loading, and LOD terrain drawing (the blank spots on the ground), which I'll take care of soon.
http://home.arcor.de/wombat23/irrlicht-mohaabsp.7z
CMOHAALevelMesh.cpp and .h must be added to source/Irrlicht/ they are a modification based on the pre-existing CQ3LevelMesh files. they should be added to the project / makefile.
The archive also contains a slightly modified CBSPMeshFileLoader.cpp, that will load the first 4 bytes of the .bsp to automatically choose between Q3 and MOHAA mesh loader.
A test example can be found here: http://pastebin.com/ecb7Fe1i
http://home.arcor.de/wombat23/irrlicht-mohaabsp.7z
CMOHAALevelMesh.cpp and .h must be added to source/Irrlicht/ they are a modification based on the pre-existing CQ3LevelMesh files. they should be added to the project / makefile.
The archive also contains a slightly modified CBSPMeshFileLoader.cpp, that will load the first 4 bytes of the .bsp to automatically choose between Q3 and MOHAA mesh loader.
A test example can be found here: http://pastebin.com/ecb7Fe1i
Re: Trying to load MOHAA .BSP
can you repost complete demo please ?
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
-- https://github.com/netpipe/Luna Game Engine Status 95%
Re: Trying to load MOHAA .BSP
https://github.com/netpipe/IrrMOHAA no response from wombat so i will be trying to freelance this to a usable state.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
-- https://github.com/netpipe/Luna Game Engine Status 95%
Re: Trying to load MOHAA .BSP
seems to be loading now but crashing still.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
-- https://github.com/netpipe/Luna Game Engine Status 95%