Questions about SUR format
-
Interesting. Had a hunch that not all data might be of use. Some redundant others being a byproduct. Having PartID hash tailed at every vertex in vertex buffer was baffling too.
-
What a time for me to have a nostalgia trip lol
Okay digging this out of the depths of my brain as it’s been about 9 years since I last looked at a SUR, hell it’s been nearly 9 years since I last looked at Freelancer.
4. Is shrinkwrap mesh (type 5) necessary? - if this is what I think it is then it depends on how you built the item your slapping a SUR on. They are designed to spread the damage to everything they cover, for example a wing on a ship that can be blown off, if it has a couple of hardpoints then anything on those hardpoints takes some damage when the wing is damaged directly.
-
Some progress. Mostly at importing functionality.
-
Sorry I wanted to answer, but forgot due to my (hopefully) last two exams. The bits section is a tree which you traverse (I can look details up if you still need it) its something like in-order traversal, but don’t know from memory.
The outer convex hull is used to determine whether the tree has to be used for collision. Thus, if you only have one node in the tree you don’t need it. You never can collide with it so that’s why it has the special flag.
Since most physics engines use a BSP tree, I suppose it is one. I only implemented a KD tree and it seems to work, but not always.
I am considering to make my sur tool open source. I already sent FF my tree creation (it is written in Free Pascal), but he never had time to use it. -
Hi. Thanks for explanation. Can you send me tree-related code as well?
Yes, I’ve noticed outer hull is available per part only when it contains more than one collision hull. And nodes forming tree when I visualized their bounding spheres in scene as well.
I’ve covered most of the stuff so far (importing-wise, exporting is another story), even made a tool to “paint” convex meshes, which is a modified selection brush for vertices and edges that updates convex mesh generated by Nvidia PhysX tool. Generating offsets will be most annoying I’d assume.
Another benefit working in 3ds max directly is that outer ‘shrinkwrap’ mesh can be built with the knowledge of compound hierarchy and part transformations, particularly when a part contains fixed children which it seem to need to envelop as well.
While I hadn’t much experience with free pascal I don’t think it’ll be a problem to figure it out and re-implement in 3ds max.
-
Minor improvement for importing:
Reworked .sur importing, so that only parts and hardpoints present in model have their hitboxes meshes constructed and attached.
HUD wireframes (VMeshWire/VWireData) are loaded and are going to be exported as well.
On a side note about vertex normals and smoothing groups. Normals can be can be imported and assigned explicitly, but that has several drawbacks, so I’ve made it optional feature. Smoothing groups cannot be restored back from explicit normals and they remain unaffected by smoothing group you’d set their faces to (kinda obvious). I think what I can do is to export smoothing groups into custom UTF entry (let’s say VMeshSmoothingGroups alongside VMeshData, which the game will ignore) but importer will recognize and restore those.
Animations are going to be major headache. They have no direct equivalent in 3ds max animation system, being far simpler and restrictive. Approximating it to max motion controllers might do for importing, but exporting that into FL’s animation isn’t going to be simple.
Coincidentally if anyone have a good idea what all those flags in compound animation scripts do it would help greatly. There’s only so much I can pull from junk pile that is C:FW source code, and even that might have changed for FL.
-
I have sent you a pm with the code.
What I don’t understand is, what is the benefit of having it in Max? Is there something wrong with my tool? Maybe I can make some changes there. At least then you are not forced to use Max (which I don’t have). -
Thanks for the code.
The benefit of having it in MAX is fairly simple - coherent development pipeline. I’ve initially started the toolkit to import and export models, not just meshes but proper hierarchy, constraint types, hardpoints, HUD wireframes and more which existing tools do not cover or only partially and never to extent the formats permit. I have custom objects and properties (which are persistent, so they’re saved into scene files) to facilitate entities special to Freelancer. Naturally I’d like to add support for SUR, not just importing but exporting as well. There are many obvious benefits to this as everything remains within single software, and everything can be manipulated by wide array of native instruments available to 3Ds MAX user, not to mention countless popular third-party plugins to satisfy all modelling needs for Freelancer formats. Of course the price of any tight integration is portability. Initially I had worked on Collada converter but quickly realized its support varies greatly between modeling software to such extent that common denominator dataset is barely able to cover minimal support I seek.
So far I’m making slow but steady progress, adding early support for DFM while rummaging through landfill of C:FW source code to pick up anything applicable to FL.
-
While i admire your efforts in this Treewyrm, i have no understanding of it and don’t wish to, I’m with Schmackbolzen on this regarding the question why?
There are plenty of us, me included who do not have MAX, and have no intention of getting it. The advantage at the moment with those of us who mess with sur files is that the sur tool that Schmackbolzen wrote works for a large percentage of models, both static and those with parts. While I agree a MAX plugin and exporter will be nice for those that have it, plenty of us don’t.
If any upgrades need doing, the two of you should discuss what needs fixing (if anything) and update accordingly, so everyone can use the sur utility, instead of limiting any major upgrades to MAX users only.