Introducing Aerodynamic Forces [Studio Beta]

Update 4/16/2024:

Hi Developers,

We are thrilled to announce Aerodynamics is now available in Studio Beta! The first step in our vision for fluid dynamics, this new fundamental system is integrated into the Roblox physics engine.

You can now bring realistic aerodynamic forces like lift and drag into your creations, taking your experiences to new heights (literally!).

Building upon the success of our previous Wind beta, and thanks to the feedback from the creator community, this release enables you to add Aerodynamic forces to all parts in your experiences (even avatars!).

Before we dive into the details, a few quick caveats:

  1. The Aerodynamic force model included in this Studio-only Beta is still experimental and subject to change until the final release. When the force model is updated it could cause slight differences in the way your creations react to the forces and you might need to re-tune your experiences. While we may expand the API later in the beta, we expect the current API elements to be final so any scripts should not require tweaking.

  2. Aerodynamics currently runs locally in Studio (edit, play, and test on a local server). It can’t be used in production experiences during the Studio Beta. We plan to have an Open Beta soon that will allow you to publish experiences. We’d like to incorporate your early feedback before releasing this to production.

With that out of the way, let’s get to the fun!

Enabling the beta

To get started with the Aerodynamics beta in Roblox Studio, follow these simple steps:

  1. Open Roblox Studio and navigate to the “File” menu.

  2. Click on “Beta Features”

  3. Enable the “Aerodynamics” studio beta by checking the corresponding checkbox. (see screenshot below) and press Save

  4. If you are prompted to restart Studio, go ahead and restart Roblox Studio

New APIs and Properties

To harness the power of Aerodynamics, we have introduced several new APIs and properties. Here’s a breakdown of what you can expect:

1. FluidForces (Workspace enum):

  • Set the Workspace > FluidForces property to Experimental to activate aerodynamic forces globally throughout your place.

  • All parts will start experiencing aerodynamic drag and lift when they move.

  • Parts will also respond to any global wind specified by the Workspace.GlobalWind Vector3 property.

  • Workspace | Documentation - Roblox Creator Hub

2. EnableFluidForces (Part property):

  • This property is found under any Part instance and is set to True by default.

  • You can disable it for specific parts to prevent them from being affected by aerodynamic forces.

  • [Studio Beta only] You may need to toggle this property off and then on again for pre-existing MeshParts and PartOperations (e.g. Unions). See the Known Issues section below for more details.

  • BasePart | Documentation - Roblox Creator Hub

3. AirDensity (Workspace property):

  • Aerodynamic forces scale with the local air density.

  • The Workspace > AirDensity property allows you to modify this density in an experience.

  • This property represents the air density at y=0, and its default corresponds to realistic sea-level air density at standard temperature and pressure.

  • Note: The AirDensity property is expressed in RMU/stud^3 and you can use this handy units conversion guide to convert between real world and Roblox units

  • The aerodynamics model also includes a decay of air density with altitude, similar to the real world. This decay is tuned so that the local air density is 5% of the Workspace > AirDensity at an altitude of 100,000 studs (or 28,000 meters). Below y=0 we assume a constant density value of Workspace > AirDensity.

  • Workspace | Documentation - Roblox Creator Hub

Example usage:

workspace.AirDensity = 10 * workspace.AirDensity -- Modifies AirDensity to be 10x the original value

Wind Profile

In the real world, wind generally transitions from a “low” speed near the ground, where the surface slows the wind down, to a “higher” speed at several hundred to thousands of meters. The average velocity through this transition (or boundary) layer looks something like the following diagrams.

To balance simplicity with realism, the Roblox Aerodynamic system has a wind profile that automatically scales the horizontal (x-z) wind speed relative to altitude. We chose a profile that is fairly realistic for a wide variety of conditions, with the top of the transition layer at 1000 studs (or 280 meters). If you have already started playing around with the globalWind property to get realistic looking grass / clouds / particle visuals, you might have noticed that the clouds move at a different speed from the grass. Our aerodynamic wind profile matches this behavior.

With this release, when you set workspace.globalWind, the system interprets that as the required wind speed at a common Avatar’s head height (y=5 studs). The default wind profile automatically scales the wind according to a realistic profile such that at y=0, the wind speed is ~10% of the globalWind property and at y=1000, the wind speed is ~3x the globalWind property.

Examples

We are sure you will come up with some incredible experiences with Aerodynamics. To provide some inspiration as well as some best practices, here are some examples of how you could use Aerodynamics.

Example 1: Spinning Things

spinnything 240410.rbxl (50.3 KB)
(Updated on 4/16/2024 and re-tuned for the improved force model)

The geometry of a part affects the aerodynamic forces it experiences. This example place has a simple spinner with blades.

Instructions:

  1. Try hitting run (F8) with workspace.FluidForces set to Default. Notice that the spinner simply falls to the ground without any aerodynamic forces that act on it

  2. Try enabling fluid forces on the spinner by setting workspace.FluidForces to Experimental and ensuring Part.EnableFluidForces = true for all the parts under spinnything. Now, when you hit Run (F8), you should notice the spinner gracefully fall to the ground while it spins due to the aerodynamic forces on the blades.

  3. You have just created your first Aerodynamic experience!

  4. Next, try playing around with the angles of the spinner blades (or duplicating spinnything and changing the angle of the blades in each copy). You should notice the angle of the blades make the spinner fall at different rates due to the realistic aerodynamic forces.

  5. Finally, try adding in some global wind by modifying the workspace.globalWind property. (Or by using the View > Wind Direction widget) You should see the spinner get blown around in the direction of the wind you introduced.

Example 2: An Airplane

F15 240416.rbxl (291.1 KB)
(Updated on 4/16/2024 and re-tuned for the improved force model)

In this example, you will find a fully functional model of an F15 airplane.

Notes:

  • The wings of the plane have articulating ailerons, the tail has an articulated rudder, and the elevators rotate.
  • You can control the plane’s roll, yaw, and pitch by actuating these control surfaces while the plane is moving.
  • (Update 4/16//2024) This F15 model has been updated. It now has a much more realistic mass and can fly with a more realistic air density now that the force model has been improved.

F15

Instructions:

  • Hit Play to try flying the airplane.

  • You should be able to run up to the airplane and press and hold the E button to get into the cockpit.

  • Start by increasing the throttle slightly (R) and then pitching the plane up (S) to take off.

  • Once you are flying, you can use the following controls to move the control surfaces which in turn can fly the plane.

Throttle: `R` (Increase)  /   `F` (decrease)
Pitch:    `W` (Down)      /   `S` (Up)
Roll:     `A` (Left)      /   `D` (Right)
Yaw:      `Q` (Left)      /   `E` (Right)
Example 3: Controllable Glider

glider 240410.rbxl (259.7 KB)
(Updated on 4/16/2024 and re-tuned for the improved force model)

Note: This example requires enabling the New Character Controller beta.

In this example, your avatar can equip a glider, jump off a ledge and deploy it to gracefully glide down.

glider

Instructions:

  • Ensure you have the new Character Controller beta enabled

  • Run and jump off the cliff

  • Equip the glider by pressing 1

  • Use the U/J/H/K keys to control the glider as you fall

Notes:

  • Take a look at StarterPack > PanelGlider to see how the glider is set up.

  • You will notice that it is made up of three very simple panels and some rope constraints.

  • Take a look at StarterPack > PanelGlider > LocalScript script

  • All the script does is to change the length of the various rope constraints when the U, H, J and K keys are pressed

  • The aerodynamics of the panels then change allowing your avatar to experience the joy of gliding!

  • Try swapping out outfits on your avatar to get different aerodynamic interactions. For example, an avatar with wings on its back will react differently because of the extra surface area of the wings

Example 4: Maple Trees and leaves

mapletree.rbxl (680.9 KB)

This, rather chill, example contains some maple trees in the workspace as well as some sample maple leaves and maple seeds in ReplicatedStorage

leaves_and_seeds

Instructions:

  • Hit Run (F8) and enjoy the maple leaves and seeds falling realistically in the gusting wind

Notes:

  • The Workspace > GustingScript script shows how you can script the workspace.globalWind property to create realistic gusts of wind

  • Under each Workspace > Tree, you will also notice a FallingThings script that clones in maple seeds and maple leaves at random locations within the tree.LeafBox and then drops them

  • Notice how the maple seeds spin instead of just falling like the leaves. This is due to their different geometry

  • Finally, notice how any piled up leaves and seeds also move around in a realistic way as the wind gusts

Performance

The aerodynamic force system was engineered to scale across your experience and range of devices. Our vision is for fluid forces (like Aerodynamics) to be as fundamental as gravity or collision forces on the platform. With that vision in mind, the team has spent a great deal of effort optimizing various aspects of the engine so Aerodynamic forces can be ON for everything in your experience. In fact, this is why the per-part EnableFluidForces property is set to true by default.

Enabling aerodynamic forces adds a small performance overhead to your place depending on the complexity of mechanisms in your place. For already complex mechanisms with many constraints, you shouldn’t see much additional overhead when enabling aerodynamics.

Some things to consider if you find performance issues:

  • Reach out to us, we’d like to diagnose and fix the problem!

  • Complex assemblies (many complex individual parts welded together) require more up-front pre-processing; simplifying the assemblies to just the parts that need to be aerodynamic can mitigate this.

  • Many simple parts, whose dynamics primarily involve aerodynamics, simulated on a single client may impact performance. This happens even now, but you might see the performance impact a little sooner with aerodynamics. Again, turning off aerodynamics on parts that don’t really need it mitigates this issue.

  • We don’t have wind occlusion yet (see the Known Issues section below), so turning off aerodynamics on parts inside buildings and vehicles can improve both performance and realism.

Best practices

Aerodynamic simulation provides a pretty powerful new tool to create immersive experiences. In order to get the most out of it, here are some best practices we have found through internal testing:

  1. Closed meshes with outward pointing normal vectors work best for Aerodynamic parts

  2. If you have trouble getting a visible aerodynamic response on your parts, try reducing gravity or increasing the workspace.AirDensity property.

  3. MeshParts and CSG operations (e.g. union) should have their collision fidelity set to Default, Hull, or PreciseConvexDecomposition. (see Known issues below for a caveat on unpublished CSG assets)

  4. As you explore this new system, feel free to drop in other Best Practices in the forum below so the entire community can benefit from this!

Known Issues

These are early days with the aerodynamic model, and we know we have improvements to make. Here are some things to watch out for, especially in this experimental release:

  • Studio-only beta (for now)! Since this is a Studio-only beta for now, you will not be able to publish experiences with Aerodynamics on. We are still working out some bugs and hope to switch to an Open beta (with publishing) soon. Stay tuned!

  • The force (lift/drag) model may change during the beta phase! While we have tested and tuned the model over a variety of test cases, we know there are still some areas we’d like to improve. Creator testing in the beta phase will help us prioritize improvements to behavior and performance. We don’t expect dramatic changes, but some tweaks may happen before our full release.

  • Wind is not occluded by objects, terrain, or water! Wind affects aerodynamic forces on parts, but it is not occluded by parts, so wind is present even inside buildings and vehicles. You may have noticed this if you played around with the GlobalWind property and had grass or particles inside buildings too. We plan to work on this as we develop the model further. Until then, you may want to turn off aerodynamics on objects inside buildings and vehicles.

    Code snippet to automatically disable Aero on an avatar when in a vehicle

    You can use the following script to turn off aerodynamics when avatars become seated within a
    vehicle.
    Usage: Place this script in StarterPlayer.StarterCharacterScripts

    local character = script.Parent -- the player character
    local humanoid = character:WaitForChild("Humanoid")
    
    function onSeated(isSeated, seat) -- when the player sits
        local descendants = humanoid.Parent:GetDescendants()
        for i = 1, #descendants do
        	   if descendants[i]:IsA("BasePart") then
                    descendants[i].EnableFluidForces = not isSeated
     	   end
        end
    end
    
    humanoid.Seated:Connect(onSeated) -- when the player sits, run the function
    
  • The force model does not work in water - Yet! We plan to incorporate some of these changes into improvements to the behavior of objects in water.

  • Team create requires each team member to enable Aerodynamics! If you and your team use Team Create for collaboration, each member of the team will need to separately follow the Usage steps above to enable Aerodynamics while the feature is in Studio beta.

  • Existing places with MeshParts might not get Aerodynamic forces automatically (for now)! If you open an existing place with MeshParts and turn on Aerodynamics, some MeshParts may not react to the new forces automatically.
    Workaround: Go to the MeshPart and disable/re-enable the EnableFluidForces property. This will re-trigger the appropriate process to generate Aerodynamic forces on that part. You can also use the script below to automatically trigger this process for all MeshParts in your place.

    Code snippet to automatically disable/re-enable EnableFluidForces on all MeshParts

    This snippet can be copied into and run directly in the Studio developer console or can be
    incorporated into a script.
    Note: This only needs to be run once on a place

    descendants = game.Workspace:GetDescendants()
    for _, descendant in pairs(descendants) do
      if descendant:IsA('PartOperation') or descendant:IsA('MeshPart') then
         if not descendant.Anchored then 
            descendant.EnableFluidForces = false
            descendant.EnableFluidForces = true
         end 
      end
    end
    

Looking to the future

There are a lot of enhancements we would like to add, and we could use your feedback! Here are some areas we plan to improve:

  • Improved lift modeling: there are some situations where the aerodynamic force model generates unrealistically low lift forces, we’d like to improve that and get creator feedback during the Beta phase.

  • Wind occlusion: right now, the global wind exists everywhere, even inside buildings. We’d like to develop a system that automatically detects occlusion of the wind and incorporates that into the aerodynamic model.

  • Buoyancy: an air buoyancy model would allow us to create realistic balloons that interact with the wind! This is in progress so stay tuned!

  • Tooling and Usability: Designing stable flight vehicles and understanding what aerodynamic forces are doing can be challenging. Studio-based tooling that allows creators to visualize aerodynamic forces and torques would aid the development of interesting aerodynamic mechanisms and vehicles.

We can’t wait to see the incredible experiences you’ll create using Aerodynamics! Feel free to share your feedback, showcase your creations, and discuss any challenges you encounter below.

Happy developing and stay breezy,

@beastierpanda, @chefdeletat, @FGmm_r2, @kckhem, @miladrakhsha, @narheas, @SmithVonMars, @TheRabbitDeveloper, @vovoheli and @W_0DY

462 Likes

This topic was automatically opened after 11 minutes.

8f1b405e1ee3f1b6eed6ed53831ad19b34e57abb (2)

103 Likes

Even tho game devs have been able to replicate this system this should make things much easier, and allow for more possibilities. Great Feature!

31 Likes

Oh! Simply amazing!

After the new topbar, I was thinking we finally exited the good update streak but I see we’re simply restarting. Somebody, please alert the plane games and all games surrounding kites, etc!

43 Likes

These changes are truly incredible, thank you so much and congratulations to the team who made this possible!

I do have one major concern, with recent Roblox features it seems much of the inner workings are harder for developers to modify or read. Will Roblox be working on how customizable the systems that make stuff like wind and terrain work in the future?

32 Likes

That’s huge! Building games just might have a comeback.

24 Likes

I don’t think I can even express how awesome it is to see this actually built into the physics engine.

By far my favourite example there is the maple tree leaves - such a subtle detail, but still the sort of thing I absolutely adore in any game.
Maybe 3D particles are back on the table! Would still be awesome to see an actual inbuilt 3D system where we can specify meshes or something to be emitted, I think it’d pair really nicely with this.

Love it. Can’t wait to see where you guys take it!

35 Likes

This feature is so good, I’m looking forward to see the way people use this!

27 Likes

This opens up so many possibilities! Thank you so much!!

24 Likes

Thank you for this update! I can’t wait to see how games use this update especially flight games @Orange12345

25 Likes

SUPER cool! Makes me wonder if it’s possible to make fully physically simulated flying characters. How cool would it be to control a dragon that uses physics to animate and aerodynamics to fly. This is huge, and better simulation for lift is going to be even bigger, opening possibilities for all kinds of flying contraptions.

It would be cool if we could get detailed documentation at some point about what influences lift and drag in detail, i.e. part shape, how to create an effective airfoil, etc.

Further, I would love to see some tuning parameters so we can increase the effect of aerodynamics on a part to get exaggerated or less prominent behavior. E.g. if I wanted a physically simulated cartoony plane, it might not be physically possible to make my artistic vision behave properly (e.g. rudders are too small, or wings too short).

30 Likes

Hello! This looks amazing.

Could you share some insight into how the aerodynamic model actually works? Can it calculate a custom model for any mesh?

Eagerly awaiting your reply!

21 Likes

Are there any plans in the future to expose what factors will affect the lift and drag simulation - i.e. does part shape affect it in anyway (as though its an airfoil).

Are there also any plans to expose properties such as the angle of attack, or the amount of lift force being generated? Also, is there any possibility of allowing the lift and drag coefficients to be exposed/altered (allowing for a sort of pseudo-airfoil for realistic aircraft)?

22 Likes

Finally. Fluid Forces. Now I don’t have to simulate it at 6 fps.

20 Likes

I can already kind of imagine some of the things that I can make with this new feature. Although it is currently a beta feature, aerodynamics is very neat and would make for some good uses, like the original post has mentioned. I am really looking forward to wind occlusion, since that would bring in more realism and prevent aerodynamic-related issues inside of buildings

15 Likes

This is kind of a game changer this is actually insane!

14 Likes

This will be a game-changer for the aviation community. Thank you.

20 Likes

This is next level guys. Great work

34 Likes

This could be potentially useful in some cases however, I feel as if this is something which was already largely done by the community. Perhaps if this was met with a particle system it would feel useful?

20 Likes