CMP to SUR Conversion Tests
-
I am having some problems with the Sur builder. So far, I have had very good success in getting it to make multi-part surs for everything I could have dreamt about. However, in the case of some models, the sur builder tends to forget about some parts (that is, meshes).
I have attached two of the cmp files in question, and one sur. Please note that this has happened to cmp files intended for ships as well, both small and large in size. I have played around with all the settings, including duplicate radius. This sometimes had some results (like 6 of 7 sur meshes output instead of 4) but usually to no avail.
-
Thank you for the report and the test files, BBalazs. I am glad that most of your models produce good SURs.
The SUR builder can sometimes be picky about things such as welding… a CMP may look good to the eye but have some small quirk that the SUR Builder does not know how to handle.
-
Your terrain model is only 1 group, is that the one you meant to send?
And it’s a long way out from the origin too. I don’t know if that will affect the sur builder.
I can’t see anything wrong with the cm_hill1.cmp file.
Could it be a numbering problem in sur-builder, as all groups are named cm_hill1_n where n = 1 to 7?
It looks good and complete in the preview animation in sur-builder.
I renamed the _1, _2 to _A, _B and re-exported the cmp, ran sur-builder - got 4 sur parts only.
Welded all vertices and re-exported, ran sur-builder - same, only 4 parts.
Tried no Type 1 sort & no Type 2 (got no preview display!) - got 5 parts.
Type 1 sort only - got 6 parts!
Type 2 only - got 5 parts.
Type 1 only & dup radius = 0.1 - got 6 parts.
BW - We have a problem!
-
Since this subject came up, this is a scenery cmp, so the sur type that is generated should be Type 2? (type 2=scenery, type 3 = weapon/damage object, type 4 = ship/station according to FL Model Tool) ??
And on the same subject, the cmp exporter v03 plugin for MilkShape can be set for Ship / Cockpit / Weapon - but no Scenery.
Could these be a factor in the problem, or in the working of the sur in its role?
-
I thought that that option only determinde how the perts where referenced in the CMP eg ships use Fix for their parts and weapons pris which can be changed through utf editing in the cons part (o btw adoxa if you see this can you put a tool in the utf editor to create fix/pris/rev nodes so that you can say how many parts will be in each node since I have been coming up with problems once I get to around 30 groups when doing it by hand :/) but yes back on topic I think that is the only difference (i don’t know what it is exported as for cockpits). Just looking at some of the scenery models the majority of them are mainly fix but some have pris, rev and even sphere (what does sphere do anyway?) for what i guess is their animations, if you look at manhatten cityscape you can see all four types of cons.
Ozed
-
Surs don’t have a type, it was a misunderstanding of the format. What was thought to be the type is actually the number of tags within each object (I believe this was covered earlier in the thread).
For example, let’s look at bw_fighter.sur. Here’s the first 32 bytes.
000000 76 65 72 73 00 00 00 40 2d 8f 68 12 04 00 00 00 [email protected]..... 000010 21 66 78 64 65 78 74 73 60 7b da c0 3f 6c e5 bf !fxdexts`{..?l.. ```The first eight bytes form the header tag: vers = 2.0f. Everything after that is an object. It starts with the CRC of the name (0x12688f2d = Root; this is zero for 3db surs) and the number of tags for this object (4). Now come the tags. The first is "!fxd", which contains no other data. Then there's "exts", which contains six floats describing the bounding box. The remaining two are "surf", where the bulk of the data is, and "hpid", a list of the hardpoints in "surf". That continues for each object (0xF4082FBD = bw_engine01_lod1 @ 0x3224, 0xFE3AEE4E = bw_port_wing01_lod1 @ 0x356C & 0xF51D449E = bw_star_wing01_lod1 @ 0x3A38), until EOF. [SurDump](http://adoxa.110mb.com/freelancer/surdump.zip) covers all the details.
-
Oh, I thought you said you had problems with the calminor terrain too?
-
@adoxa: Would it be possible for you to write your knowledge about the sur format down into some sort of txt file, so that it would be possible to implement a sur reader and writer according to this text?
-
NO
-
BBalazs - yes I did, but sorry I don’t follow, which terraforming generator works? Is it the MilkShape plugin, did you use that to generate the terrain?
Gisteron - well LS decided to make the sur builder and generate surs from cmps directly. It’s almost done!
We do have a sur export plugin for MilkShape already, but it is not 100% reliable. It is better when we use the Convex Tool plugin first and then generate surs with it. (Actually there are 2 plugins, but 1.2 is far worse).
But so far this sur builder has been very good according to people who have tested ship surs in-game. I haven’t done that extensively yet, I test for at least 30 minutes because bad surs have taken 10-20 minutes to crash in the past. I proved this by using standard FL surs for all ships, gave them to hostile NPCs and let them fight - and it ran overnight! Then substituting 1 of my suspect surs it ran for about 20 minutes then crashed, so I use this longer test time as standard now.
-
It surely is great to have a cmp to sur converter, but from a modders point of view, seeing we are still in stone age as regards sur exporters is kinda annoying, especially when you want custom surs because of high model complexity and similar issues.
-
Yes, sadly the authors have tended to depart before completing the plugins, so we are starting from scratch each time some kind Knight takes it on.
-
@Schmackbolzen: SurDump reads sur files no problem; source is text, so just look at that. I had thought of adding sur to the XML Project, but I feel the format doesn’t lend itself to easy manual editing.
I shall be updating the sur exporter, soonish. The “Problem - IDS?” topic inspired me to work on a better infocard maker. For example, you give it “Battleship \i{Osiris}.\n” and it will give you (compiled into a DLL) “<rdl><push><text>Battleship</text> <tra italic=“true”><text>Osiris</text><tra italic=“false”><text>.</text><para></para></tra></tra></push></rdl>”.
That ConvexHull tool is pretty much what I was going to make from the shrink-wrap option of the current sur exporter. No source, though (for the plugin; the actual generator has source), so I still will, so I can choose my own names and create a single convex mesh for a group of meshes.
-
@ST: If you have a look at the california minor planetscape (landing sequence), you can see brown pyramid-like structures. I referred to them as terraforming generators. The sur builder has built a very good sur for them, and they are completely scenery objects. Conclusion is that the sur builder can create good surs for scenery objects as well.
The other files that I have attached in my previous posts (a simple hill and a terrain) all have this problem mentioned earlier: some meshes don’t get built. -
@adoxa: Well the one thing missing is, how to calculate the opposite offset of each vertex in the triangle list. Any hints?
Edit: Never mind, got it from the ms sur exporter
-
I did a bit more testing last night and found one of my small fighters got a bad sur made by sur-builder with missing sur parts over the left wing.
I looked at the cmp and found it had both the wings made as tops and bottoms, not complete. Can’t think why I had done that. But the right wing surs were gen’d fine.
Anyway, going to regroup it and try again and will report back.