tree.klz think tank
Re: tree.klz think tank
Neplatny = "not valid"
Masivn = "solid wood"
Masivn = "solid wood"
http://malgolan.altervista.org/
Italian politicians - Not in my name!
Italian politicians - Not in my name!
Re: tree.klz think tank
Regarding 4x4 matrices...
What about fogetting OBB and XTOBB collisions?
We could create tree.klz which does not use those structures,
and instead uses only faces collision, cylinders, spheres, and ABB.
Faces collisions could be calculated automatically by a max script and
a list of meshes from a scene4ds.
Moreover, we can add UN-ROTATED spheres, cylinders and bounding box
which will be add by user using max.
What about fogetting OBB and XTOBB collisions?
We could create tree.klz which does not use those structures,
and instead uses only faces collision, cylinders, spheres, and ABB.
Faces collisions could be calculated automatically by a max script and
a list of meshes from a scene4ds.
Moreover, we can add UN-ROTATED spheres, cylinders and bounding box
which will be add by user using max.
http://malgolan.altervista.org/
Italian politicians - Not in my name!
Italian politicians - Not in my name!
Re: tree.klz think tank
Thanks for the translations, I'll add it to the list.
Sorry I made a mistake, the last column of the matrices in tree.klz IS [0,0,0,1]. I got confused with all that float variables there. Problem solved
// Update
The collision grid of HD2 is again very similar to the one lexov posted:
Sorry I made a mistake, the last column of the matrices in tree.klz IS [0,0,0,1]. I got confused with all that float variables there. Problem solved
// Update
The collision grid of HD2 is again very similar to the one lexov posted:
Code: Select all
// GridWidth*GridLength*GridHeight
[long] numObjects
[long] Reserved
[float] Height
[long] Reserved
[long] References[numObjects]
Last edited by hdmaster on Thu Aug 11, 2011 3:21 pm, edited 1 time in total.
Re: tree.klz think tank
Face col data can be created straight from the mesh data. For primitives col data we use the following approaches (or a mixture of them respectively):Ikaros wrote: PS: a question..
How were tree.klz generated, for Mafia?
Completely manually?
Or maybe exported from a 3d-editor?
Or even automatically calculated?
Thank you very much! :)
- Compute the bounding volume that corresponds to the primitive you want to create and convert it. This does of course only work well for those meshes whose shape roughly matches the one of the primitive.
- Create and transform the primitives by hand + copy'n'paste
- In Mafia, some model files contain dummy objects that can be used to create collision primitives. They have a parameter string that encodes the primitive type to create from that dummy as well as the material to use. In conjunction with the dummy object's transformation and AABB you can then create proper collision primitives for the entire model this way. The train station model is one of those models. It's rather complex (has stairs, platforms, walls, etc...) but with the help of the dummies you can quickly create detailed collision data for instances of it.
The tree.klz stores the plane for each triangle. A plane is a set of points x that meet the criteria x*n + d = 0 (with n being the plane's normal and d being the distance of the plane from the coordinate system's origin).hdmaster wrote: Collision faces have exactly the same strucure as in Mafia I. But what meaning/purpose has the value distance for each face?
The extends vector is the standard encoding scheme for oriented bounding boxes. It stores the distance from the box' center to one of the box' vertices. Normally, a single extends vector is sufficient, but the tree.klz also stores the inverse of the extends vector in Extends[1].hdmaster wrote: What's the purpose of the 'vector3 Extends[2]' values?
Yes, if you mean minimum for 'lower' and maximum for 'upper' vertex. :) At least for AABBs.hdmaster wrote: The bounding boxes are built just from one lower and one upper vertex, right?
From what I've read building tight fitting OBBs for arbitrary meshes is not easy. What we generally do is we compute the AABB of the untransformed mesh and then transform the box according to the instance's and parental transformation.
The primitives flags define additional behaviour or properties of the primitive. The only two flags I know are 2 which makes cache.bin objects destroyable (only works for certain models like roadsigns) and 64 which lets bullets penetrate the primitive.hdmaster wrote: What effects do the different flags have?
I don't think banning (XT)OBBs is a good idea as that would mean to either approximate OBBs using spheres, cylinders and AABBs or to resort to triangle collision data. Imagine you wanted to create collision data for a stairway. (XT)OBBs are perfectly suitable for that. Spheres, cylinders, AABBs... not so much. Triangle col data may work but chances are that it's too detailed which may negatively affect player movement on the stairway (like getting stuck at times, unsmooth movement, etc..). Remember that you can't create arbitrary (low res) collision meshes but that you can only convert the visible mesh into face col data.Ikaros wrote: What about fogetting OBB and XTOBB collisions?
We could create tree.klz which does not use those structures,
and instead uses only faces collision, cylinders, spheres, and ABB.
Faces collisions could be calculated automatically by a max script and
a list of meshes from a scene4ds.
Moreover, we can add UN-ROTATED spheres, cylinders and bounding box
which will be add by user using max.
Last edited by lexov on Thu Aug 11, 2011 5:00 pm, edited 1 time in total.
Re: tree.klz think tank
What about making arbitrary low-res meshes, handling face collisions with these meshes, and giving the meshes a completely transparent texture?lexov wrote: Remember that you can't create arbitrary (low res) collision meshes but that you can only convert the visible mesh into face col data.
http://malgolan.altervista.org/
Italian politicians - Not in my name!
Italian politicians - Not in my name!
Re: tree.klz think tank
Hm ok, or simply don't assign any material to it. That could work, indeed...
Re: tree.klz think tank
Unfortunately i had no time to finish a tool for the .klz files yet, but it seems that there's also another way to create collisions.
It looks like H&D2 uses some .4ds files for collisions e.g. for vehicles. These collision 4ds files have exactly the same name like the normal 4ds object but also the prefix 's'. So the collision file for 'la_tiger.4ds' would be 'sla_tiger.4ds'.
It looks like H&D2 uses some .4ds files for collisions e.g. for vehicles. These collision 4ds files have exactly the same name like the normal 4ds object but also the prefix 's'. So the collision file for 'la_tiger.4ds' would be 'sla_tiger.4ds'.
Re: tree.klz think tank
Do not worry, hdmaster! You've done so much until now and you have all the time you want, before turning again your efforts toward Hidden
I'm currently working on RevEngEd2 and it's almost done. Afterwards, I'll can start studying max script and try to write down a "tree.klz" exporter based upon my previous idea (all faces collision and transparent textures).
I'm currently working on RevEngEd2 and it's almost done. Afterwards, I'll can start studying max script and try to write down a "tree.klz" exporter based upon my previous idea (all faces collision and transparent textures).
http://malgolan.altervista.org/
Italian politicians - Not in my name!
Italian politicians - Not in my name!
Who is online
Users browsing this forum: No registered users and 67 guests