figured it wouldn't be a bad time for us to start considering this, new object chunk data specifications.
here is what I think would be good.
first off the basic OBJ2 isn't bad for the most part, in the upper levels I wouldn't change much, the biggest two additions I can see would be the addition of an orientation matrix and an index to another OBJ3 chunk that holds the identical geometry data. these two together would allow a significant improvement in the number of vertex and index buffers required in game, or if we should chose to make the move to shared buffers it would make the resultant buffers smaller, that's not as significant of an improvement, but it's still better than what we would have otherwise.
in addition we could add binary animation data, if it is locked inside the model then the model editing program would be able to make nesisary adjustments to parent bounding boxes to ensure proper colision detection (especaly important if we ever implement transitional animation)
these specs are the less than obvius portions, I will omit things like chunk identifiers and sizes
OBJ3 spec
float radius
int parent
vector offset
vector min_box
vector max_box
string name
string properties
int movement_type
int movement_axis
int geometry_owner
//other subobject that has my geometry, -1 if I own my own geometry
int BSP_size
//0 if I don't have my own geometry
void BSP_data[BSP_size]
//will elaborate later
matrix orientation
//the orientation of this object in it's nutral resting position
I formed that so it would not break backwards compatibility with the existing code, geometry_owner is in an unused block of space and orientation would only be read in if the chunk id was OBJ3. if you look at the pof specs, there is very little diference, the big changes come in the BSP specification.
BSP chunk order
defpoints
polys
tree
unlike the existing BSP chunk the new one will have it's data a little more organized, raw poly data will be accessible without a need for running through the tree. I've considered breaking the BSP tree into two, a true BSP tree and an octree, but I'm not sure if that would offer much advantage, for the moment I'm going to stick with one BSP\octree. one of the reasons I'm thinking a single tree would be better is due to the addition of detail control into the tree, I want to import the exsisting detail box and sphere feature into the BSP structure, this will allow the polychoping benefits of the detail feature without incuring the multable subobject penalty. the existing detail box code should remain unchanged to allow animated objects and destroyable subsystems the option of only being drawn when near them. the basic idea, is that the first few steps in the BSP tree will be sorting through detail data, the child nodes of the detail reigons will be full trees similar to how data is now, but it will be in the same. the ingame implementation would read through these subtrees and construct an index buffer out of them, the vertex buffer would remain static always.
below is a visual aid for understanding the detail region's place in the BSP tree, detail boxes (red D's in boxes) should only exist near the root, this is because each detail region has as children either more detail regions or the root sortnorm of a BSP tree (green S's in circles), and the leaf geometry nodes of these diferent BSP trees will not be in sorted order, however it can be assumed that detail geometry will more or less be on top of it's parent's geometry from a visual point of view. note it is not a coincidence that I have as the first children the BSP subtrees, this is to ensure the parent->child rendering order.

so in addition to the existing node types, of the sortnorm bounding box and tmappoly, there will be two new detail region nodes:
detail box
vector min
vector max
int type //-1 render when out, 1 render when in
int offset //to consectutive child nodes
detail sphere
float radius
vector pnt
int type
int offset
in addition we might as well revamp the sort norm chunk and strip out some usless stuff
sortnorm
vector norm
vector pnt
int front_list
int on_list
int back_list
vector min
vector max
now we've gotten into the very interesting part, the geometry as I mentioned earlier poly data is now seperate from the BSP tree, were polies once were we will now have references to polies, in the form of poly lists. it's a simple enough idea you would simply have the number of polys in the list (rarely will be more than 5, oftine will be just 1 or 2), an index to which vertex type all polygons in the list will use (I'll explain this in a minute) and n_poly*3 ints or shorts (depending on how big the vertex buffer is), for this last bit we will probly have to define two separate poly list nodes.
poly list
int n_poly
int vertex_idx
int polys[n_poly]//reference to the poly list
int/short tri_list[n_poly][3]
before I get to the polygon definition I need to cover that vertex type thingy I mentioned. there are a number of different vertex data options available in OGL (and D3D) but they are not always used for all situations, so if a model is not going to need lighting data it's waistfull to send it off, some models in the future may have multable sets of UV coordanants in multable dimentions, I think it's best to leave the exact vertex format undefined and have it specified via flags, what sort of data is preasent, there already exsists in FSO code for handeling this in this exact way, no code in game realy needs to know what the hell is going on within the vertex buffer. now of course you must be thinking to yourself 'colision detection? those decals you've tried half a doesen times to implement? a thousand other bits of code that use the raw geometry?' well these bits of code only use the position of the vert and the polygon normal so as long as we can still find this information out this code should be relitively unharmed. so in addition to the graphic verts there will be a seperate list of vectors which will be nothing but the position of each vert. now into details, there needs to be the ability to specify more than one class of grverts, so in the defpoints you will have sevral lists of vertex data, and a single list of vertex point data.
defpoint
int n_cpoints
vector cpoints[cpoints]
int n_vertex_types
for(n_vertex_types){
int format
int n_gpoints//there is, or should be, code for finding the size of a vertex of a given format
void gpoints[n_gpoints*gpoint_size]
}
with this we can construct vertex buffers simply by passing the raw buffer to the abstraction layer code.
now finaly, polygons. the basic form of the polygon I don't plan on changeing too radicaly, but there will need to be an additional index for the vertex type. also I think there should be an additional radius added, one such that if you are within the radius and intersect the plane then you are defninately hitting the polygon, this I think could vastly speed up colision detection, because otherwise you have to project the vertex onto the plane of the polygon and do a very expensive test to see if the hit point is outside the poly.
but to me the most important change will be the addition of neighbor data, there needs to be a way to figure out which polygons are nearby, this information is extremely important to getting a fast decal and shadow code working, and could posably be used to speed up colision detection. the way I see it every polygon can have either one or no neighbor along each edge, and each edge is comprised of one point and the next point, so the n'th neighbor should be the one which shares point n and n+1, and obviusly there would be as many neighbors as there are points in the polygon (if you include the potential -1 null references to nobody).
polygon definition
vector norm
vector center
float max_radius // if you are outside this you are definately not hitting
float min radius // if you intersect the plane and are within this radius you definately are hitting
//alternatively we could try to use a bouning box
int vertex_type
int n_vertex
for(n_vertex){
int c_idx//index to the colision vert
int g_idx//index to graphic vertex (might not be needed as these are in the poly list in triangulated form already)
int neighbor//index to another poly that uses point n and point n+1
}
well that's my thoughts on it, anyone else whant to comment?