CMP to SUR Conversion Tests
-
Quick question from a SUR newb:
Would the creation of a utility for triangle-by-triangle conversion create too memory intensive a SUR for practical use?
I only ask because of how vanilla SURs possess just as many polygons as the actual ship model, creating a 100% seamless fit for hit and collision detection.
-
**@ Arvis - that actually is not a good idea. For one is the concavity issue, another is the poly count. When I was working on the original version in 2008 i did exactly that. It killed my frame rate and if I shot the ship the server and client CTD…
As it is being built now, it generates a convex mesh for each sub-mesh in the model. Each mesh is actually based on the texture. Multiple textures, multiple meshes. As far as others have discovered, only the root sur has to be convex. This means that once I get the initial test version of the program going I will start working on Delaney triangulation. As it stands now a convex hull can’t be used for a tradelane since it has holes in it. That is what Delaney triangulation would solve since it would help build a form fitting sur hull.**
-
When I said “triangle-by-triangle” I was speaking of Delaney triangulation.
Essentially I was asking if having the converter split each triangle into it’s own surface (meaning NONE of the verticies are acutally shared between triangles, essentially tripling the number of verticies in the model but the polycount remains the same) would cause haneous lag when hits and collisions are detected.
-
I only ask because of how vanilla SURs possess just as many polygons as the actual ship model, creating a 100% seamless fit for hit and collision detection.
As far as I’m aware, this isn’t true for vanilla SURs; vanilla SURs are much, much simpler than the ship models.
On a more practical note, will this utility directly create working SURs that, in theory, should work indentically to vanilla SURs, or will it simply be a model that we export from Milkshape?
MK
-
**@ Arvis - that is possible but undesirable, too many sur polys for most ships
@ mknote - it creates a sur**
-
Then I guess my second question/assumption/issue would be:
If we follow identical naming conventions, would it be possible to build a sur from a “dumbed-down” model of our ship (built from simple geometry with no concavities) and have the SUR function given that all model objects have identical names?
OR
Following the same idea, would all the objects be compressed down to the “ROOT” with only that single object in both the SUR and the CMP?
(If that confuses anyone, I apologize in advance. I’m a veteran FL modder but VERY new to the SUR arena.)
-
**@ 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.