CMP to SUR Conversion Tests
-
**Sorry for the delay but I have a feeling this may be worth the wait….
I am in the process of designing a group separator for the CMP files. This means that you can simply export all of your groups in 1 group and this will rebuild the CMP file with as many groups as you originally intended, in the process breaking the 18 group barrier limit. In the meantime it will build new VMeshRef and Cmpnd sections to match, you know how I am, click a button and it’s done
The reason I’m doing this is that I have found that individual meshes take hits alot better than one big mass mesh. There is a good chance it will be integrated at the beginning on the sur creation process so it will be fully transparent to the sur building process. Plus I never much cared for the 18 part limit and this is an easy way to remedy it.
So keep your spectacles on old man, it’s coming soon.
On a side note, I did test how surs work and found something interesting. Surs can have holes in them. This opens the possibilty of attaching surs inside of surs simply by creating an opening. Anyways, enough experimenting, back to the grindstone.**
-
That is phenomenal news, LS! I think many of us are on the edge of our seats watching your sculpt your masterpiece
-
LancerSolurus wrote:
I am in the process of designing a group separator for the CMP files. This means that you can simply export all of your groups in 1 group and this will rebuild the CMP file with as many groups as you originally intended […].That means that it will make all groups from milkshape separate? What about parts consisting of 2 or more meshes (maybe because of texture)? That would also generate multiple surs for example one wing…that means i can’t just use it as [CollisionGroup] because each part of the wing would be a separate destructible component…
edit: by the way - has anyone of you taken a look on co_base_rock_large01.cmp and its sur? It has a multiple part sur for the root!!!
-
@ Quark - It will split meshes up into parts only if they contain more than 1 mesh. It is determined by the VMeshRef. I will make it optional. The main reason is because I haven’t got the bits linkage part worked out yet and the separate mesh part is already fully working. I will continue to work on figuring out how it’s designed so hopefully I can get the multi-part working (multiple meshes in 1 sur part). Tests show that without the linkage it uses the last sur with the same crc. As in if there are 10 parts named Root, only #10 will be used for collision.
-
ST thinks this is well worth waiting for and buys boxes of dried crackers, pull-to-open cans of bully beef and bottled water…
-
… added some chocolates and Nutella today…
-
ST… washed and dried his sleeping bag today, it was getting a bit smelly from the dampness in this unused room…!!
-
(grabs a pom pom… stands next to ST)
Lancer Lancer… he’s our man… he cant do it… noone can…
L.A.N.C.E.R. (shakes pom poms)… dam not enough for a human pyramid yet… oh well back to the start…
-
Hehehe it’s getting close. I will post when I have good news.
-
-
… it’s awfully dark in here…
-
**Actually the holdup has been the mesh rebuilder. I have completed that part of the code but unfortunately the mesh isn’t being recognized by FL. I believe the problems lies in the Fix format. After studying multiple different Fix, Pris and Rev nodes in binary, something is amiss in the current knowledge about those node types. Maybe Adoxa might be willing to help determine what values are actually used (hint, hint)
The current is for Fix…
Parent name string
Child string at offset 0x40
Center x,y,z at 0x74
Position offset at 0x80
3x3 rotation matrix at offset 0x8c
Next part at offset 0xb0I’ve noticed the 0x70 is always 0x00000000
The position is always valid floats so that part looks good.
The rotation matrix is a different story, the only consistent values are the x,y,z floats, ie at 0x8f, 0x9f & 0xaf, the rest sometimes contain totally invalid float values such as 0x0000000F or 0x80000000 (infinite value, same as 0x7FFFFFFF). For a matrix this doesn’t work since it invalidates the matrix.Everything else seems to work at the present time, the UTF editors and HardCMP have no trouble loading the rebuilt cmp files, any help would be appreciated.**
-
Here’s all the Cons nodes (from the XML Project - when I said it decoded everything I really meant it).
struct Vector { float x, y, z; }; struct Matrix { Vector i, j, k; }; // \Cmpnd\Cons\{Fix,Trans,Loose} // Trans isn't in any of the vanilla files struct FIX { char parent[64]; char child[64]; Vector position; Matrix orientation; }; // \Cmpnd\Cons\{Pris,Rev} struct REV { char parent[64]; char child[64]; Vector position; Vector offset; Matrix orientation; Vector axis; float minmax[2]; // don't seem to be used }; // \Cmpnd\Cons\Cyl struct CYL // not in any of the vanilla files { char parent[64]; char child[64]; Vector position; Vector offset; Matrix orientation; Vector axis; float minmax[4]; // don't seem to be used }; // \Cmpnd\Cons\Sphere struct SPHERE { char parent[64]; char child[64]; Vector position; Vector offset; Matrix orientation; float minmax[6]; // don't seem to be used }; ```I've called it **position** here, but after looking at the UTF Editor, I probably should have stuck with **origin**. I only think it's minimum and maximum angles, but a quick play with the debugger showed they were never read; the problem is some of the bases uses really large values, which seems to belie their use as angles. I've used Matrix as three Vectors, because that's how Paul Isaac defined it in **View UTF**, a mod utility for Conquest: Frontier Wars. (It's a bit temperamental, which is why I've never mentioned it before now. There's also an unpack utility, which should create/extract UTF files, but it didn't work at all.)
-
**Thanks, thats pretty much the same layout I’m using for each of the nodes. Hadn’t seen the CYL type though, good find. I have seen sphere used in the cityscape models.
In this case I will simply run FL in debug mode and see why it’s giving me a ‘can’t create compound part’ error. It gives me exactly the number of errors as there are new parts. Odd since the program completely rebuilds the Fix node from the data it reads and also has all of the children for the VMeshRef’s + the Cmpnd entries…**
-
Drat!
Shaved my long grey beard off, thinking I would have LS’s utility by now and have to do some fast serious work needing sleek streamlined facial lines…
It’s so cold without it!
And I notice some stray mice have moved in here too…
-
**After bugging FF for awhile about FL Dev
Ok, the model rebuilder is not working which means the sur builder is not working….
Something is missing in the understanding of the cmp model format. I have generated Cons-Fixed entries, VMeshRef entries and all of the Cmpnd entries perfectly according to the layout that is currently understood to be the proper formats. Unfortunately this is is not working…
HardCmp displays it correctly…
UTF editor shows the nodes in the proper place and exports the data as it should be…
FL only shows the the original VMeshRef’s sometimes…One thing I found during this is that ‘lod1’ is NOT a requirement, look at nomad_lair.cmp for an example…
Any help would be appreciated, files upon request…**