Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (Quad, alibaba, rki, 7th_zorro), 365 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
WMB7 BSP #352692
01/05/11 12:32
01/05/11 12:32
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
Hi. I was wondering if you could document the BSP data in the WMB7 file format.
I am not asking for a BSP implementation or any trade secrets, just how to interpret the data for use with my BSP tree for a project I am working on which I hope will benefit many 3DGS users.

I am using the "WMB7 Simple Level format" documented in the manual. The lists I am looking for are:
Quote:
bsp_leafs
bsp_nodes
aabb_hulls
bsp_blocks
pvs

Thanks.

Re: WMB7 BSP [Re: sheefo] #353015
01/07/11 11:13
01/07/11 11:13
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The BSP structures are harder to document and explain, that's why we documented the Simple Format only. Even worse, I had to do it as such documentation is my job. But when I have some time in the next months I'll document the BSP structures.

Re: WMB7 BSP [Re: jcl] #353446
01/10/11 12:44
01/10/11 12:44
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
Thanks.

I have a few other questions about the WMB7 file format.
How are the number of lightmaps calculated? The code I use only works for lightmaps compiled at the highest setting.
Code:
DWORD dwNumLightmaps = header.lightmaps.length / (1024 * 1024 * 3);



Also, why was path.num_edges encoded like so? Took me a while to crack.
Code:
DWORD dwNumPoints = (DWORD)path.fNumPoints;
DWORD dwNumEdges = (path.num_edges - (dwNumPoints * 3)) / 2;



Re: WMB7 BSP [Re: sheefo] #353556
01/11/11 12:22
01/11/11 12:22
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The lightmap size is optimized for minimum file size. When the total lightmap length is above 1024*1024*3, they a calculated like in our code, otherwise divide the length by 512*512*3 or by 256*256*3, whichever gives the smallest size.

The strange path format has historical reasons, it had to be compatible to an earlier path format where a node always had two edges.

Re: WMB7 BSP [Re: jcl] #354038
01/14/11 21:41
01/14/11 21:41
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
Thanks for the help so far. Just a few more questions.
Is sequential reading of the WMB file recommended? I know that there are offsets specified in the header but for speed reasons I would prefer to read sequentially.

This is the order I have discovered so far. I don't know what data legacy7 and legacy1 contain, but they are not empty.
Would it be possible to tell me where the remaining structures fit in the sequence so in case they are not empty I can tell my parser to skip the length of those blocks?
Quote:
header
legacy7
legacy1
blocks
materials
textures
palettes
lightmaps
lightmaps_terrain
bsp_leafs
bsp_nodes
aabb_hulls
bsp_blocks
pvs
objects


PS: Sorry for attempting to "rape" the WMB7 file format.

Re: WMB7 BSP [Re: sheefo] #358337
02/10/11 20:18
02/10/11 20:18
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
I was considering upgrading to the new A8 engine but I have a few questions regarding the implications this may have on my project.

First off, will the file format currently used (WMB7) become obsolete? Will there be any changes in the A8 engine that I need to know about so my code can parse the newer WMB files generated by the A8 engine.

Secondly, is PVS data still only avaliable for Pro version? Since I own A7 Comm I cannot use this data anyway. I really only need to know how the BSP data is stored so I can generate my own BSP tree for my project.

Lastly, the question from my last post; Is sequential reading of the WMB file recommended? If so could you give me the order of the structures.

Thank You Very Much! I look forward to upgrading to A8 very soon!

PS: I hope you haven't forgotten about me wink

Re: WMB7 BSP [Re: sheefo] #358453
02/11/11 12:42
02/11/11 12:42
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
All Gamestudio file formats can change anytime. A change of the WMB7 format is not planned at the moment, but it can happen during the lifetime of A8.

Yes, PVS and BSP data are used by Pro only.

Reading the WMB file sequential or not has probably no effect on speed. The engine does not read the file sequentially. In any case you can skip the legacy chunk and all other chunks that you don't need.

Re: WMB7 BSP [Re: jcl] #363902
03/15/11 15:42
03/15/11 15:42
Joined: Oct 2006
Posts: 23
Turkey
_cash_ Offline
Newbie
_cash_  Offline
Newbie

Joined: Oct 2006
Posts: 23
Turkey
what is lightmap format? (bitmap or vector)
how i view lightmap data?

thanks.

Re: WMB7 BSP [Re: _cash_] #363977
03/15/11 19:56
03/15/11 19:56
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
according to the manual:

Quote:
The lightmaps list is just an array of quadratic lightmaps with 3 bytes per pixel (blue, green, red) and a size of 1024x1024 pixels each


So when you can calcualte the offset, and retreive the lightmap-bytes from the WMB, you could tranfrom it into a 1024x1024 RGB Bitmap.


Re: WMB7 BSP [Re: Damocles_] #364870
03/21/11 17:48
03/21/11 17:48
Joined: Oct 2006
Posts: 23
Turkey
_cash_ Offline
Newbie
_cash_  Offline
Newbie

Joined: Oct 2006
Posts: 23
Turkey
in help,
they say lContent is always 0,

////////////////////
typedef struct {
float fMins[3]; // bounding box
float fMaxs[3]; // bounding box
long lContent; // always 0
long lNumVerts; // number of VERTEX structs that follow
long lNumTris; // number of TRIANGLE structs that follow
long lNumSkins; // number of SKIN structs that follow
} BLOCK;
/////////////////////

but i check some wmb7 file,
lContent is set -80 or -128 or 0

whats meaning of this parameter?

Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1