the setup above is wrong (sorry teach me to write things when tired)
thats the right one, simply call that 1.01
-- Header ----
-- identity [dword 4 byte]
-- version [byte 1 byte]
-- Entity Set [char 8 byte]
-- VisTree Size [word 2 byte]
-- Num Textures [dword 4 byte]
-- Num Vertex [dword 4 byte]
-- Num Face [dword 4 byte]
-- Num Entities [dword 4 byte]
-- Ofs Textures [dword 4 byte]
-- Ofs Vertex [dword 4 byte]
-- Ofs Face [dword 4 byte]
-- Ofs Entities [dword 4 byte]
-- Ofs VisTree [dword 4 byte]
-- Data ----
- Texture
-- Name [char 64 byte] **including directory, from base
-- Position [word 2 byte]
- Vertex
-- Position [vec3 12 byte]
-- UV Map [vec2 8 byte]
-- LNV [vec3 12 byte]
- Face
-- Vertex A [dword 4 byte]
-- Vertex B [dword 4 byte]
-- Vertex C [dword 4 byte]
-- Vertex D [dword 4 byte]
-- Texture Position [word 2 byte]
- Entity (variable)
-- Size of Entity [word 2 byte]
-- Position [vec3 12 byte]
-- Type [word 2 byte]
-- Reserved [n/a * byte]
- VisTree
Position [vec3 12 byte]
Num Face [word 2 byte]
Node Faces [array [Num Faces] byte]
- Tree
-- Node
--- Leaf [byte 1 byte]
right now thats fixxed i can get onto explaining how it all works
first of all there is the identity of the format, this is a 16bit value (because for some reason a DarkBasic Standard dword is only a 16bit value) ... well that aside it is a BitShifted ASCII 3 Letter Designation.
in this case RBW (Raven Binary World)
to calculate this value its
dwIDALIAS = bitRight(asc(W),16) + bitRight(asc(B),8) + asc(R)
and for those who don't know howto calculate BitShift Values (remember in DarkBasic Pro these are >> and <<
Right/Left BitShifting
`// bitshift 1.1
function bitRight( dwInput, dwStep )
dwReturn = dwValue /( 2^dwStep )
endfunction dwReturn
function bitLeft( dwInput, dwStep )
dwReturn = dwValue *( 2^dwStep )
endfunction dwReturn
right now the ID is checked, we then have to check the version. Later versions will have updates and different data structures, i say will rather than do - because i've thrown away fmtBSP 1-8 (so this is really a brand new breed of the format)
for now the format is counted as
1 - if i change anything major thats when we update the format version
well not thats out the way how about we get down to the actual data setup.
now notice i've used the denotation Char, instead of string - this is because i've stored the names in ASCII Character byte format, single character per byte.
this is why i added this function
function char( dwFile, byChar )
`// private declarations
dim pChar( byChar )
`// array and build string
for index = 0 to byChar - 1
read file dwFile, pChar( index )
strBuffer$ = strBuffer$ + chr$( pChar( index ) )
next index
undim pChar( byChar ) :`// release memory
endfunction strBuffer$
it will return the string value of the ascii stored

there are a few reasons for this, but mostly so that i can use C to make a compiler for this format as it is considerably quicker.
Also notice some values are Vec3/Vec2 ... this means that they are either X Y Z tri-float values, or X Y dual-float values.
right now the textures are setup what might seem really weird to you - however it does make alot of sense. Rather than having ALL the textures renamed each time a face wants to call them, all of the textured used for that level are assigned a number 0 - 65535.
Then as the texture is loaded into the BSP Texture Array, that number becomes the Array index which points to the real number it was loaded at
hopefully that makes some loose sense (^_^) but it makes perfect sence to me and saves me 62bytes per face.
Each of the Vertex arn't setup that differently to the DarkBasic Mesh's - they're just in a more interesting order, as you have thier Position X Y Z, then the UV Position U V and finally the Vertex Normal Vector (or Light Normal Vector)
if you don't know howto calculate LNV, then don't worry too much about it as you should just compile that from the DirectX file directly - however Flipcode do have a pretty good calculation routine for it somewhere on the site
... the faces are pretty self explanitory really so if you can't figure them out then - well perhaps you should check another post
now the entities are special so i'm gonna start another post first (^_^)
Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?