Property tag for B3D file format

Blitz3D Forums/Blitz3D Programming/Property tag for B3D file format

Klaas(Posted 2003) [#1]
Hi,
first of all, sorry for my bad english, i try my very best :-)

i've been thinking about about an additional tag for the b3d file format to store more specific data to entitys.

I've thought about a tag called "PROP" for property where certain data can be stored.
Data like, wich sound should be played if a bulled hit this entity or wich particle system should be spawned on destruction. There are lots of data wich can be stored there.

I got two different approaches to this, first i've thought it should be like the "ANIM" or "BONE" directly into the "NODE"

BB3D
__TEXS
__BRUS
__NODE
____MESH
____ANIM
____NODE
______BONE
______KEYS
______PROP
______NODE
________BONE
________KEYS
________PROP

PROP:
int id ;a userdifined ID wich speciefied the type of property
int size ;the size of the property (integer would be 4, a string would be stringlen + 1)
bin property ;a bank like data chunk

but this could end up in a lot of extra filesize, because a lot of propertys could be shared by the entitys ! As example, every wooden entity would have the same impact sound !

Well, the other idea would be to store the propertys as a property list just like "TEXS" or "BRUS" and point to them. This gives the ability to share propertys.
The NODE could have a property reference list then.,

PROP{
int id ;a userdifined ID wich speciefied the type of property
int size ;the size of the property (integer would be 4, a string would be stringlen + 1)
bin property ;a bank like data chunk
}

BB3D
__TEXS
__BRUS
__PROP
__NODE
____MESH
____ANIM
____NODE
______BONE
______KEYS
______PROR
______NODE
________BONE
________KEYS
________PROR

where "PROR" is the property reference list
PROR:
int reference_count ;the number of property references
bin references ;a chunk 4 x reference_count long

what do you think about it .. any other approaches ... or is this whole thing about PROP-Tag nonsense ?

well, if this property thing could be implemented into the Blitz entity structure to gain a fast access to these propertys, i think this would be greatly improve Blitz3D.
Then all these workarounds to store the entitydata in types and reference them with the handle() into the entityname() is unnecessarily.
I think about something like a pointer to a bank containing the property data.

i would like to hear what Blitz-Community and Mark Sibly himself thinks about this.


Sunteam Software(Posted 2003) [#2]
One thing you have to bear in mind is that Blitz won't know what these TAGS are. I should think it would just ignore them but you will probably have to test for that. Then of course it means that you'll have to parse the file twice, once using your own routine and once using Blitz' loadmesh unless you intend to construct the mesh using your own parser.

As far as the Blitz community is concerned it's up to you what you do with it. If you intend to release the code for others to use I'm sure they will be grateful. However the Blitz implementation for .b3d files will ultimately always be controlled by Mark and I'm sure he already has his plans laid out so don't expect anything you do on becoming a standard for others.

That said I've been down that path before and I must admit it is fun to play with the format as it is a nice format as it stands.


fredborg(Posted 2003) [#3]
For now, I think the best way is to store the properties in the node name, like this:

NodeName$ = "Box00
[PROP]
- property a
- property b
- etc
[/PROP]"
Because you won't need to make your own loader, and it is easy to access and extend.


Klaas(Posted 2003) [#4]
yes, i know that these TAGS will be ignored ... i just wanted to start a discussion about how we could make the B3D format a bit more flexible. Well if i deciede to implement it for me it could be that in future versions i collide with new TAGs in B3D. That's why i think it would be a good thing to reserve a sort of TAG thats allows programmers to store there data directly in B3D FF.

Surely, mark got his plans and he decieds wich feature will be implemented or not ! Is it some sort of blasphemy to just post an idea for an enhancement ?

This format is extendable .. i just want a know if other people think if this would be a good idea ? Maybe, a lot of people like that kind of enhancement. Why not give it a try ?


Ricky Smith(Posted 2003) [#5]
There's absolutely nothing wrong with discussing this - it would be nice if some standards were agreed upon( as long as it didn't infringe on the current flexibility) - however, as mentioned above, it depends on the author.
I don't think that having a standard is too important if you are building a game or an application because you will know your own format and use your own loaders - but would be useful for exchanging models between users.

Maybe Mark could publish a list of the PROPOSED tags he intends to support ? The .b3d format has been out quite a while now.