CMP to SUR Conversion Tests
-
Right, I agree with most of that.
One detail, for the sake of clarity for all readers:
StarTrader wrote:
And it may take several attempts to get a good-looking one.Just to be sure that we are all on the same page here, “good-looking” is irrelevant for a SUR.
The SUR is the computer’s Point of View (POV) of an object. For most things, a blob is all that is required to track movements and hits.
Even with form-fitting SURs, the goal is extremely low poly count. Close-fitting is irrelevant. Looks are irrelevant. We just want an approximate fit that uses minimal polygons.
The rest of your note sounds right to me.
-
To be honest, I don’t understand the approach of the Sur Builder anyway. To my understanding the problem was a wrong implementation of the sur format which the exporters and the other tools messing with surs use. So why not just fix the tools and let people decide how much polygons they use. There are pretty sophisticated algorithms for polygon reduction already available in many modeling programs. Alternatively you just build your own simple mesh out of some boxes etc.
I would even try to build a .obj->.sur converter, if there was a an easy to understand documentation of the sur format.
Concerning the memory use of the Sur Builder: From my viewpoint, there is absolutely no excuse for using 1,7GB of memory other than broken by design. There are so many ways of allocating memory so that you don’t need to allocate it all on startup. Even then just building a simplified mesh out of some vectors would never need so much memory.
-
I do not disagree, Schmackbolzen.
However, I will say that the SUR Builder is a convenient tool for making a SUR in a few minutes.
Lack of documentation on the SUR format seems to be the weakest link. Everybody appears to be guessing about it.
The memory thing appears to be due to some library code, but it is not mine, and some of it appears to have been originally written in straight C. I am not allowed to publish the code, so it is not worth a lot of time for me to figure it out, or to update it. The original author has said that he is willing to help, but he has been busy with professional work. Remember that nobody is getting paid for this work, so when the design decision is a choice between “quick” and “good”, then “quick” usually wins!
So it is a cool tool as it stands, but I agree that a reliable exporter would be valuable, as well.
-
Mirkha wrote:
if we want a more accurate hitbox we need a multi group cmp, right?Yes.
yet i can build a cmp with x groups but still one VMeshLibrary
Is there a link or maybe i don’t understand what “Multi-Part Sur creation requires model with one mesh per cmp part.” means ?
I believe that you need a mesh for each group. To be honest, I hope that one of the modelers will answer that better for you.
-
Bullwinkle wrote:
Right, I agree with most of that.One detail, for the sake of clarity for all readers:
StarTrader wrote:
And it may take several attempts to get a good-looking one.Just to be sure that we are all on the same page here, “good-looking” is irrelevant for a SUR.
The SUR is the computer’s Point of View (POV) of an object. For most things, a blob is all that is required to track movements and hits.
Even with form-fitting SURs, the goal is extremely low poly count. Close-fitting is irrelevant. Looks are irrelevant. We just want an approximate fit that uses minimal polygons.
The rest of your note sounds right to me.
“Good looking” is in the eyes of the beholder, BW.
You misunderstand me. I’m not talking about sleek and sexy here. I’m talking specifically about a ship like the Shadow Crab Cruiser. A one-piece sur would be bad for such a ship, because it would give it a very large hit & collision surface.
What I’m saying is the cmp needs to be split up into sensible groups and the sur generated may still have bad coverage, or cover several arms, if you understand now - that is a bad-looking sur!
So in such a case the user will need to break it down again and generate another sur until he gets what he is looking for - good looking in this sense.
In the case of the sur builder each group will always have a convex sur part. So it’s not a matter of this, it’s a matter of how well it covers the ship is what I mean, and this is for the modeller to decide.
For my use, if I remember correctly I split the Crab into one group for the body and 1 to 3 groups for each arm. It’s a big ship and I wanted collision detection if a small ship hit one of the arm tips. Then I had to rationalise (reduce and recombine cmp groups) because I had more than 18.
To make the arm sur I used hex cylinders for some closeness to the body, tapered them to follow the arm. I made all the sur parts by hand in this way and spliced it, and I got a very “good-looking” sur!
But - it crashed when tested in my game, so I couldn’t use it! I remade a new sur, but the same happened. Did it again a few more times until I got fed up and resized a standard sur.
There’s another lesson. I suggest all sur modellers make at least 20 surs by hand!
For the Kilrathi Dreadnought I did it the same way, making sur parts by hand and splicing them, and that one worked very well, here’s a shot below.
It’s always intended that the sur should have as few polys as possible. Standard FL uses simple boxes very often, sur modellers should check a couple of standard FL models using the importer and they will see that.
But lastly - you can never dictate minimalism to people that think 4GB RAM should be standard for a Netbook! rofl!
(ADMINS - CAN WE PLEASE HAVE A ROFL SMILEY?!)
-
“Yes” would have sufficed, but thanks for the detail, StarTrader!
-
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.