CMP to SUR Conversion Tests
-
**@ Arvis - if you want to do that simply use the sur exporter in Milkshape, it will do exactly what you are asking about…
I am posting here that I have successfully built a fully working single hull sur file based off of a cmp model. I have also successfully built a routine to calculate the scaling value in the bits section (aka the color value).
SUR File Format Compiled By Lancer Solurus with Adoxa's help All values in HEX unless otherwise noted (Size in decimal) ***************************************** Size(d) Type Comment ** Header 4 string 'vers' - Version 4 float 2.0 ** Section header 4 ULONG CRC 4 ULONG Surface Type Count (!fxd, exts, surf & hpid) 4 string '!fxd' - Part header 4 string 'exts' - Tag 12 XYZ Box minimum 12 XYZ Box maximum ** Surface tag 4 string 'surf' - Surface ** Surface header 0x00000034 4 ULONG Surface offset, bytes to next HPID or section (this addr + offset) ** Surface base pointer 0x00000038 12 XYZ Center 12 XYZ Inertial damping 4 float Radius for visibility (set this large enough to surround entire object to keep it from 'popping', 1.5*radius is good) 1 byte Flag or Scaler? 3 byte Duplicate of surface offset above 4 ULONG Bits section offset (surface header start addr + offset) 4 ULONG 0 unused 4 ULONG 0 unused 4 ULONG 0 unused ** Face list header (size = 16*face lists) 4 ULONG Vertex list offset (this addr + offset) 4 ULONG Cmpnd/HP CRC or bits offset if 'last face group flag' is set 1 byte Type 4-normal face, 5-face linkage (final face list entry) 3 byte Referenced vertex count, unused by FL, simply set to 0 4 ULONG Face count ** Face list (size = 16*Face count) 12 bits Face number nn xn xx xx (4 bytes) max 16,384 faces 12 bits Opposite face xx nx nn xx 1 byte Flag xx xx xx nn 2 WORD Vertex index 1 nn nn xx xx 15 bits Opposite offset xx xx nn nn (bits 0-14) 1 bit Last Face Group Flag xx xx xx nx (bit 15) (only set if more than 1 face group) 2 WORD Vertex index 2 15 bits Opposite offset 1 bit Last Face Group Flag 2 WORD Vertex index 3 15 bits Opposite offset 1 bit Last Face Group Flag ** Vertex list (size = 16*Vertex count) 12 XYZ Vertex position 4 ULONG Cmpnd/HP CRC ** Bits section (as in 24 bit bitmap) 4 ULONG Sibling offset {Bits base addr + offset) 4 ULONG Triangle offset (this bits base addr - face base offset (0-fbo)) (if sibling offset is not 0, this is 0) 12 XYZ Center 4 float Radius 4 ULONG Scale (XX YY ZZ xx) - xx is always 00 since it's unused ** HpID section - hardpoint IDs 4 ULONG Count 4 ULONG Hardpoint CRC list (size = 4*Count) ```**
-
I’m afraid Darkness would have something to say about that.
-
-
-
Love is in the air lol
-
I could stare at that all night….
-
ST drooooooolllllzzzz silently in the dark corner with one eye on Darkness, the other on LS, the next on everyone else… and the last one scanning the dropzone ready to pounce on the beta release as soon as it’s dropped…
His straggly wispy white beard now 15" longer and 15 shades whiter on the Tide Scale…
-
Wow. Incredible, LS. Congrats on this accomplishment!
-
Thx, I am currently testing it on a new update of my mod of the 15 most flown ships. So far no crashes and everything seems to working as it should. I will be releasing a test version within a couple of days for you guys to play with.
-
Ello ello ello…
Umm…
I finally got to see the video…
Why ship not blow up, B’wana?
And pls don’t forget we need shield bubble for small ships pls?
Or - do we?
And no sur where a ship has long booms with empty space between?
-
**Hehe, I got a pair of scissors waiting on you…
The ship didnt blow up because I used a shatter fuse on a single component mesh which doesnt destroy it, just makes it shatter.
Shield bubble, that will be later but from testing there is no need for it. It will be an optional feature.
Empty spaces are not handled yet, I will have to learn how to do Delaney triangulation to do that. What I will be releasing is a test version only and still has a problem with faces inside of the hull on some models. This can be allieviated to some degree by adjusting the duplicate points radius but a good fix has not been implemented yet. Also only a whole mesh sur is currently supported, nothing more.
So far though, everything seems to be functional.**
-
Well, so far, it’s awesome. I know I’m going to have great use for this for FW:ToW. Thanks for working on this project so hard, LS. It will revolutionize FL as we know it.
-
**OK, here is the first test version. Feel free to give your thoughts on it. I would like to thank Aodxa for his help in figuring out the unknown parts of the sur file. Also Freindly Fire for testing it earlier and suggesting a fix and the ‘recalc’ addition. Also for those pushing me to get this project completed that have posted in this thread.
Click here to download 0.001 of the FL Sur Builder
Make sure you backup your mod files before playing with this tool, you may need to put your original sur files back in. All sur files are output into the ‘Output’ folder.**
-
(ST leaps out from the shadows and grabs the file before it hits the ground…
… too tired to try it immediately he rushes to the vault and deposits the file, tripping over his beard and coming a right cropper just in front of the doorway…)
-
**Got something for that beard…
;)**
-
Forgot to mention to adjust the distance setting for very small ships. Usually they require 0.1 for the radius or smaller. A setting of 0 turns it off. I’ve also noticed funny named vmeshdata’s can cause problems such as | in the name. It can’t save out the name properly in that case. That will be fixed by the next update. Feel free to send me the file and I will see what’s going on with it.
-
I’ve been running tests on this all day. Since this is a beta atm, and seeing as we talked about this earlier today LS, i think everyone whose tried this will agree its a huge improvement over any other method used so far. Firstly, planetary surs. Oh hell yes, these are now truly round as they should be. The converter seems quite happy if the sur is for a ship, piece of equipment, a solar, they all seem to work fine.
These surs gift wrap awkward ship models and until the Delaney triangulation part of it is perfected, none of us will get figure hugging surs on odd shaped models, i’m thinking Enterprise, Tie fighters etc. Once LS has perfected that, i’m sure that will change, fingers crossed.
I tried to make new surs for Aldeberans modular station pack and succeeded in about 90% of the models so that’s a major plus for those of us that use those.
Hat’s off to a superb tool and a real thankyou from me and anyone else whose tried to make a sur and just started screaming uncontrolably when they didn’t work. Hotly anticipating the next update. Have a drink on me LS, you fully deserve it :pint: