Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
64 user(s) are online (32 user(s) are browsing Forum)

Members: 0
Guests: 64

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +30€

Current balance: -190€
(last updated 04/2017)

Please make a donation if you want to help keeping The-Starport online:

Bitcoin address:
Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 66 users playing Freelancer on 35 servers.
October. 19, 2017

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



SURs - How to: #2 - About Surface (SUR) Files
Just can't stay away
Joined:
2010/2/17 20:45
From Germany
Group:
Registered Users
Senior Members
Posts: 466
Offline



.OBJ to .SUR Converter - How To:

#2 - About Surface (SUR) Files



Freelancer needs SUR files to generate collisions/physics of objects and their groups. A SUR group always must have the same name of the CMP group it is assigned to (do not forget the common _lod1 ending!). Because of this, SUR groups always move with their parent CMP group. They do not move with other SUR groups. Every single SUR group can consist of multiple convex meshes (see last Chapter).


For Freelancer there are four kinds of SUR groups:

The following explanations are valid for NPCs and just partially for players! (See below)


Root Group

Root groups are assigned to the CMPs/3DBs root group. They can't be animated, moved or separated/destroyed. They will always collide as long as it's parent group exists.

Static Groups

For multi part objects you need to use Static groups. They are, as always, parented to the CMP group with the same name. They can be destroyed/separated and their assigned CMP group moves with them through space as soon as this happened. Static groups are not recommended for animated groups!
Static is cheap to compute and must be always used if the additional group is not meant to be animated!

Moveable Groups

To create physics/collisions for animated CMP groups, you have to use Moveable groups and assign them to their CMP counterpart. They can also be separated/destroyed and act as Static groups.
Just use Moveable groups if the group is meant to be animated, because they are more expensive to compute!

Hardpoint SURs

Hardpoint groups must have the exact name of the hardpoint they are assigned to!
These groups are used/activated as soon as the hardpoint is used. However, they are not separable. They are a health proxy for the equipment mounted there. They also collide with other objects.


You can of course parent groups to other groups. And if a group in between gets separated or is animated, its child groups will always move together with their parent. In case of animations, Hardpoint or Static groups will follow this animation, but aren't updated often ("jumping around").



Freelancer-Caused Problems With Group Collisions

We all know, Freelancer always has surprises for us. And for SURs we have some problems caused by how Freelancer works.
All those things you read about the groups so far are valid for NPCs. For players, there are some limitations/bugs:

Static Groups

If a player loses a Static SUR group of his own ship (for example a wing), he will still collide with this "not existing" part.
(Sometimes there are bugs that cause no collision, but this is not intended.)

Moveable Groups

The player never collides with Moveable SUR groups of his own ship. So, always try to avoid Moveable SUR groups on player ships!

Hardpoint SURs

Hardpoints on the players own ship will never be deactivated. They will always collide, even if there is no gun attached to.


Additional, a player will never be able to collide with his own debris (if you lost a wing, you can't collide with it).



Other players are always treated like NPCs! So their Moveable groups will collide with you, their destroyed Static parts will not hit you, their debris will damage you, their not used hardpoints will not collide with you. Like NPCs.
All those limitations you just read are only valid for your own ship you are flying and nobody else.



Some technical background information for interested people:

Static groups will always be twice in a model. One version of it is always where it is placed in the OBJ file. The second one is placed on the center coordinates (by default: 0,0,0). The first one is working for collisions if it is still part of the ship, the second one gets activated as soon as the part gets separated.

Moveable groups will always just exist once in the SUR. This makes them freely moveable, because they are "separated from beginning on".




Any questions? Ask!

Posted on: 2012/11/7 22:55

Edited by Skotty. on 2012/11/7 23:02:44
Edited by Skotty. on 2012/11/7 23:03:39
Edited by Skotty. on 2012/11/7 23:05:02
Edited by Skotty. on 2012/11/7 23:06:15
Edited by Skotty. on 2012/11/7 23:29:56
Edited by Skotty. on 2012/11/7 23:32:11
Edited by Skotty. on 2012/11/7 23:34:44
Edited by Skotty. on 2012/11/7 23:37:11
Edited by Skotty. on 2012/11/8 0:17:12
Edited by Skotty. on 2012/11/13 15:49:10
Edited by Skotty. on 2012/11/19 20:15:42
How to create .SUR files - Tutorial
Top