Skip to main content

Blog Archive

Announcing New Physical Material Properties

November 10, 2015

by Val "Khanovich" Gorbunov


Archive Creators Developers News

Materials on parts have always been a part of ROBLOX, but short of changing appearance of the parts these materials provided little influence to actual gameplay. When the update rolls out, users using the new system will find that picking a PartMaterial now affects the elasticity, friction, and density of objects to better match the real-life material! Fear not, those of you that like to customize every facet of their game will still be able to customize Friction and Elasticity of their parts, with the added ability to customize Density as well!

PhysicalPropertiesCustomUI2

 

Cool Stuff

We’re very excited about the amount of new gameplay possibilities that this new feature opens up. From being able to make large light objects that a player can push around (in addition to those that they can’t),

LightBallheavy

or just a ball that can push through obstacles much more easily,

DensityPen

to emergent behavior based on the material of the terrain.

MaterialSlope

You may have also noticed the addition of the Friction Weight and Elasticity Weight properties in one of the above screenshots. These properties are purely optional but provide the user with some interesting gameplay possibilities. In every case, friction and elasticity between two objects is based on the interaction of the two objects, so when you combine a high friction object with a low friction object, their interaction ends up somewhere in between. With Friction Weight  you can designate one of these objects as more important when it comes to friction and make the interaction value much closer to its friction value.

For example, if you wanted to make Ice slippery no matter what surface touches it, you can set it’s FrictionWeight to 100, and as long as surfaces that interact with it have much less Friction Weight, they will all slide on Ice according to this Ice’s Friction property!

 

It’s all in the Details

By default, parts created will have CustomPhysicalProperties set to nil, meaning the PartMaterial will pick the elasticity, friction, and density values appropriate for the interaction (The table for these “default” values will be available soon, but we’re currently testing and finalizing the vlaues). If a user enables CustomPhysicalProperties by clicking on the checkbox in Studio, object will inherit the physical properties of the current material, but from that point on they are free to customize whatever properties they see fit.

 

Lua API

  • Set custom properties on a part: Part.CustomPhysicalProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight = 1, elasticityWeight = 1)
  • Disable custom properties on a part: Part.CustomPhysicalProperties = nil
  • Access read-only components:
    • Part.PhysicalProperties.Density
    • Part.PhysicalProperties.Friction
    • Part.PhysicalProperties.Elasticity
    • Part.PhysicalProperties.FrictionWeight
    • Part.PhysicalProperties.ElasticityWeight

 

Interaction

  • Friction and Elasticity between two interacting objects is determined by a pairwise weighted average function.
  • (Friction_a * FrictionWeight_a + Friction_b * FrictionWeight_b)/ (FrictionWeight_a + FrictionWeight_b)
    • You can see how if FrictionWeight_a >> FrictionWeight_b, the result ends up coming out as FrictionWeight_a.
    • If FrictionWeight_a ~ FrictionWeight_b, the result is right between the two values.

Release Strategy

Since changing Material behavior of parts is a very large-scale change we will be proceeding with a unique roll-out strategy that ROBLOX has never attempted before. When the feature releases, at first you will see a new option under your Workspace properties in Studio:

Workspace

This property will be set as Default for all places, implying that no action has been taken by the user on this place to migrate early, or slow migration. The entire migration process should take about 3 months, with the following steps:

 

  • Month 1: Workspace property introduced
    • Changing PhysicalPropertiesMode to New will allow users to migrate early and test their games with the new System.
    • Leaving PhysicalPropertiesMode as Default will automatically enable the new PhysicalProperties system during the next stage of the migration process.
    • Changing PhysicalPropertiesMode to Legacy will grant users more time in the old PhysicalProperties system, perhaps allowing them more time to migrate their games to use the system manually.
    • Users who have set their property to New or Legacy will not see any behavior changes after switching to these modes during the next section of the Migration.
  • Month 2: By default, PhysicalMaterialsMode is now enabled
    • Places that left PhysicalPropertiesMode as Default will now be automatically migrated to the new system.
    • Places that chose to set PhysicalPropertiesMode to Legacy have another month of using the old system.
  • Month 3: The great migration
    • All places regardless of PhysicalProperetiesMode will begin using the new PhysicalProperties system.

 

We expect the opt-in option to be available as early as the week of Novemember 16 – 20.

 

What this means for Developers

Most games will be unaffected by this change as the automated logic will transfer old system content to work with the new system, however we encourage developers to try switching to the new system early to verify that everything works as expected. If sliding, bouncing, or weight-based behavior seems off please verify that this is fixed by switching PhysicalPropertiesMode back to Legacy.

 

Game Types that may be affected by this change

  • Zero Gravity games may be affected by density change, we encourage you to use the “GetMass()” function to correctly cancel out gravity!
  • Physics-Based Submarine and Boat Games may be affected by new Buoyancy and Density behaviors.
  • Flight Simulators that use airfoil simulation may find that the center of mass has moved on objects that have different materials.

 

PLEASE NOTE

In the unlikely case that you are having issues, please note that switching PhysicalPropertiesMode back to Legacy is a temporary solution and will become an invalid fix in a few month’s time. If you find that you have to switch to Legacy to make your game work, check if your game has any of the above-listed content.

 

* Note that these times are subject to change.

** ROBLOX will internally migrate Elasticity and Friction settings to be utilized on the new systems, but due to the fact that we previously had unchangeable density and buoyancy behavior we are unable to migrate settings that rely on these two properties. Please use this migration period to make sure your game works with the new system!