Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / fmtBSP version 1.0 (for DarkBasic Enhanced)

Author
Message
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Feb 2003 08:52


interested?
more will follow very soon (^_^)
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?
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 23rd Feb 2003 17:39
VERY COOL RAVEN!

I can't wait! Hope more is coming soon!

Current Project:

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 04:26
the setup above is wrong (sorry teach me to write things when tired)

thats the right one, simply call that 1.01


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


and for those who don't know howto calculate BitShift Values (remember in DarkBasic Pro these are >> and <<

Right/Left BitShifting


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


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?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 04:54
oki... well entities are probably one of the more interesting things i've had to script

and also the most enjoyable (^_^)
the entity size is how large it is in bytes, so really from 14bytes (+2 for size) to 65535 bytes ... however i doubt you'll ever need to define that many perameters.

Standard Setup is the Position + Type - a value from 0-65535 which determines what function to run. You use the reserved perameters to extend the information required...
This is useful as for say a door you'd set it up like



obviously thats quite a wasteful setup but you get the idea
remember the entity set, and/or position depends upon the loaded entities set

what is entity 1 for standard fmtBSP (say a door) would be something else in Zelda.ent (say a fire)
so its upto your entity setup really what is used.

now for the all important visibility tree

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?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 05:17
the VisTree is actually one of the most uncomplex versions of Visibility you're likely to encounter - however the benifits are just outstanding

Now first of all the Tree Grid setup...
You take the Max X Z Y Value and then the Min X Z Y Value and within that you devide it up by the size


(the 4 is for position Vec3 + NumFaces)

you then place the node pointers in there as the nodes are variable size memory blocks which are used kinda like a type is within dbpro

for the nodes you then have 26 nodes per tree grid (each is a 45° area which is calculated from the cameras vector)

right now from this you have the Leaves, you have NumFace/8 = Leaves in the Node
the Face index's within the node are calcuated and outlined as part of the Grid Header, and then Setup from
Max X Z Y to Min X Y Z centre position ... the Leaves then go from the indexbase -> indextotal (as you'd expect)

using 8 faces per byte, and using bitshift you check for the value ... 1 = Solid or Visible 0 = Clear or Non Visible

then what happens once that is all done is you take all the Visible faces (which you arrayed within a previous loop) send it over to the Rendering Memblock, now the fastest way to render is just build and texture the Mesh from the Nodes with a cross reference to the data stored from the main geometry.

However in version2 once i have enough people using this, i'll explain howto create and add a lightmap array to the end so you can calculate and display lightmap based worlds.

over the next week i'll be posting up the code on howto create the compiler and the rendering code for this

but hopefully this has given everyone something to really think about in the way of world formats and possiblities within DarkBasic Enhanced and Professional without needing to access the core code

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?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 11:10
this does all make sense to some of you right ... explaining this format isn't gonna be a big waste of my time is it?

be annoying to explain it all and have no one want to use it

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?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 13:07
oki... i've got a few hours today free (YAY!)
so it looks like i can finally work on the compiler / display program.

What i'd like thought is a LARGE range of worlds to test this on properly - i'm going to make one or two demonstrations worlds, but not right now (sorry but time scheduals) ... so the only demo world i'll release will be something too blasted basic.

if your interested in doing a world, hop over to the 3d forum i'm gonna post there in a sec the details

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?
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 25th Feb 2003 14:40
weeeeeee!!!!
That's REALLY cool raven... will it work with DBPro (It will take a bit of work in the translation, but possible I think), because it is obviously far superiour to DBP's BSP

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 15:59
i suppose i could make a darkbasic professional veiwer as well - would require an extra line or two of code for a Professional veiwer.

but really i wanna develop primarily for Enhanced first
this is a complete rewrite btw ... i've changed and simplified alot of this, and it also has the fmtBSP 9 style VisTree.

The compile keeps making all the faces visible from all angles right now - which is quite annoying
luckily the test level is literally 4,000 polygons ... but still it is an annoying bug - i think the Epsilon calculation is out of wack, and isn't properly checking the faces orientation based on the camera vector.

The ZBuffer Calculation is working well though (^_^)

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?
Killer Sponge
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United Kingdom
Posted: 26th Feb 2003 15:10
what, confuzled dont have time to read entire thread, what are you coding to do with bsp

Current Project: Lode Runner Db (Working Name)
Killer Sponge
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United Kingdom
Posted: 26th Feb 2003 15:11
ALSO seems to be a problem with IE, cant expand the code snippet boxes

Current Project: Lode Runner Db (Working Name)
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Feb 2003 03:56
code snippets expand for me... i'd see if your IE is oki

that aside - i should have a working compiler and veiwer in 2-3hours (its working now but not to a degree that i'd class it as actually working )

however i won't be posting once i'm complete, everyone is gonna have to wait until tuesday for the actual compiler.
As i've decided cause its taken so long i'm going to burn to CD and Rose will be the first one to use it (well cept me of course )

however i'm likely to be uploading the veiwer and some test worlds before 6-7pm GMT

everyone have fun working on your DirectX worlds whilst i'm away

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?
rapscaLLion
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 27th Feb 2003 04:28
weeeeee....
you are amazing raven

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors

Login to post a reply

Server time is: 2025-05-17 06:36:24
Your offset time is: 2025-05-17 06:36:24