A Deep Look at ROBLOX’s Buoyancy and Water Physics

Boats. Waterfalls and geysers. Swimming and diving. Flowing rivers and deep pools. With version 1.0 of ROBLOX’s buoyancy and water physics, carefully crafted and researched by our Physics Team, these things are not only possible, but also realistic. We’re featuring ROBLOX Physics Engineers Kevin He and Tyler Mullen today, as they explain the latest iteration of buoyancy (see the original here) and its implementation in ROBLOX.

Water is more than a texture in ROBLOX. It has its own unique properties and behaviors, all of which integrate into ROBLOX’s existing physics engine. Objects float on water surfaces, bob up and down with pressure changes and sink if they’re too dense. Water flows, pushing objects along its path, with user-defined directions and velocity. Players dive underwater and swim the depths or wade on the surface.

The physics of water are rooted in buoyancy – the tendency of a body to float or to rise when submerged in a fluid, according to the Merriam-Webster dictionary.

Water physics in action: A working water wheel in ROBLOX.

Buoyancy is a simple concept, but challenging to simulate in a virtual world. We approached the challenge with a few goals in mind. At a high level, we focused on clean architecture so the behavior of objects and characters in water looks and feels like a natural extension of ROBLOX’s existing physics. This included integrating buoyancy into our standard contact pipeline. We actually consider a body of water a special physics object and apply buoyancy to floating objects via the contact (or collision) between them and the water. This way, the collision between water and floater, floater and floater, and floater and sunken objects are all simulated in a unified engine.

Our architecture also unifies all the forces – buoyancy, water viscosity (drag) force, water-flow force, gravity, contact forces and other external forces. The movement of a floating object is a net result of all these forces on a rigid body following Newtonian laws. That’s why you’ll see underwater collision happening in the same, natural way it does on land.

This video demos player control in and out of water, under water and on floating objects.

We also strived to implement buoyancy and water physics with a high level of detail and accuracy. We came up with a couple solutions based on the type of object we’re simulating.

Cubes and wedges in water

Think about dropping a cube into water. After gravity has submerged it in water, it’s likely going to tumble and re-orient itself as the water’s buoyancy forces it back to the surface. In ROBLOX, we efficiently and elegantly simulate that re-orientation by dividing the voxel cube into eight segments, each of which has its own positional data. By dividing up the force of buoyancy, voxel objects (cubes, wedges and corner wedges) orient themselves properly and respond to changes in force – a character standing on one corner, for example – with realism. We also apply water viscosity force against both linear and rotational velocity to dampen the motion and achieve a good, float-y feel.

Spheres and cylinders in water

Now, think about dropping a ball (or sphere) into water. Because the smallest point of the ball enters the water first, it gradually decelerates until the buoyancy force shoots it back up. We don’t need to worry about how the ball re-orients itself, but we do need to know how much of the sphere is below water.

If x is the percentage of the sphere’s height that is under water, then the percentage of the sphere’s volume that is submerged is:

And the buoyancy is weight of object × percentage of volume submerged ÷ SPECIFIC GRAVITY.

Cylinders are the trickiest of all. When cylinders are floating straight up and down, they should act like cubes. When cylinders are floating completely horizontally, they should act more like spheres. The trick, for cylinders, is to blend the two approaches.

If x is the percentage of the horizontal cylinder that is underwater, then the percentage of the cylinder’s volume that is submerged is:

Again, the buoyancy is weight of object × percentage of volume submerged ÷ SPECIFIC GRAVITY.

This blend of the two approaches allows cylinders to behave realistically in water.

Our final goal was to allow a wide variety of practical applications through water and buoyancy. You’ve already seen how objects behave in water, but we’ve also developed swimming and diving states that let players jump in and out of water, and swim downward to explore the depths.  Users will be able to construct realistic boats real boats for their games and set up water-based platforming courses. With flowing water, your landscapes and architecture will benefit from waterfalls, geysers, whirlpools and streams.

There’s a lot of new ground – or, should I say, water – to explore.

485 thoughts on “A Deep Look at ROBLOX’s Buoyancy and Water Physics”

1. This all is nice but its gone to far, why cant we have the old tools and baseplate back!
Some people dont like it
you guys are changing it to much!

2. ADD THIS,THIS A EPIC THING THAT NEED ADDED ON ROBLOX,But the water look not realy realy. Maybe give another texture?

• You are quite right. I am also so glad I’m in grade eight, because I understand all of these math formulas and physics, and even density. :D

• i think it should be more transparent on the surface (make a different texture with somewhere around 75% transparent lines instead of waves, make one with 3-D waves that stick up and you can alter how far apart they are and how high the waves are, and they should make crystal-clear water bricks and you should be able to make all three sparkle, be able to change how much it sparkles, and you should be able to change its color whenever you want in-game or come in multiple colors with more to change it to.

• i forgot to mention that i have NO IDEA how to change the speed, so if ROBLOX COULD MAKE A TUTORIAL, that’d be great. also, has ANYONE NOTICED THAT ROBLOX IS TEMPERARILY (and if anyone can give me the correct spelling of, if it is is not spelled correctly, ‘temperarily’) DOWN??????????

3. OH MY GOSH THIS IS REALLY AWESOME!!!!!! the water looks so cool! YAY! :D

4. Sucks if the texture is forced to the part, but otherwise about time(?)

5. This is crazy epic. Keep up the great work, and by that, I mean upload this now.

6. Hey, is this like a stamper tool object yet? i absolutley love building with the new stamper tool? Is it a model? Please PM TechRoblox34 or reply :)

7. I also noticed how the player doesn’t get all glitchy on a moving object. I’m more eager for the fix more than the water.

• does the water have to flow a certain direction? could you make it so you can just float around or even maybe walk on it possibly?like have a bouyancy property as well and then you can make it so they can walk on it without the water moving them a certaind irection

• Simply use the Velocity property of parts… research before asking questions like this.

• You can make the water ‘Still. By using the instructions the other reply said. But you can not make it so you can “Walk” On the water. And why would you want that any way? Its water.

8. Hay ROBLOX team make sure you add it to the insert service, not just a ROBLOX models, like when you insert a brick, a seat, or a wedge, but instead it will be “Buoyancy brick” or “Water part”

P.S. We would be able to take off the water decal, right? That would get annoying if we couldn’t…

9. Water should revolutionize game play. With the added axis of Y, players can get more of their environment, while the builder can make less objects such as stairs.

tldr; this could kill lag and add space.

10. This IS AWESOME!!!!!!!!!!!!!!! AD IT SOON !!!!! IM GONNA TELL AL MY FRIENDS!!!!!

11. hola…this could add a big impact to roblox games.espically the sail boats!

12. I have to say it’s pretty cool except for the fact you said it’s realistic when it’s not. A way to do that is maybe add a blueish blur? Like fog only comes into effect under water?

13. Sorry, but I dont like it. ROBLOX is getting to advanced. I like the 08 days, when I joined.

.A 08ers Logic.

14. The texture is already in Roblox files. Just look at it! :-)

• The only thing I don’t like about it is it doesn’t have any transparency.

• I wish it was trancparent too. But the problem is that you would see the outline of all the cubes. Thats why they didnt. Believe me, It looks better without the trancparency.

15. AWESOME! when does this come out or is out

yet tell me =O it looks awsome i wanna know when it out now! or is it out!

16. This could be a new way to make a new “Build a Raft to a Giant Waterfall”.

17. Wow! This is great, yet the texture and all we should be able to select. If we could select its settings, we could make it invisible and have a space game, where you can float around!! I love how things float, how the velocity can be directed. It’s still ROBLOX, too!

18. I love this! This feature looks like it will have a great impact on building. I’m looking forward to it :)

Wouldn’t it be nice to keep the physics of the water, but, make it invisible and use some other custom part anchored in place with some script inside it?

Like, to make it looks like acid for some rafting game in space?

20. You should add a air bar when underwater, that should make it seem more realistic

• That’s exactly what I was thinking. It would be really cool. But for those people who want actual underwater games, the builders of the game can toggle the bar on/off.

21. Nice! However, there should be an option in a model’s Properties to have all it’s children ignore the water velocity, so it’s easier to simulate boats in ROBLOX physics. Like the sailboat, just sailing on the water, following it, doesn’t look very realistic.

22. Cool! But i just hope all the games won’t be like this. Roblox is starting to go Minecraft…. ( In a way)

• ROBLOX is trying to be minecraft. Give it a couple of years and it will be called Mojank.

23. This is probably the best thing ROBLOX has done since I started, which was 2010, when all the bad things were updated. Finally, ROBLOX has done something good with their time. I only have a few suggestions:

-You should give us a few options on what color the water should be. (Ex: blue, brown, green, red, orange, yellow, black)

-You should give us control over the speed that the water is going, and possibly make it so it doesn’t move at all if we want.

-When we go underwater, maybe the water color we chose could apply underwater as well, so it looks like we’re actually underwater.

This is an amazing advance in technology, even for ROBLOX. Keep it up, and maybe you could get some rage-quitters back.

24. Wow…that’s gonna be SOOO COOL!!! I’m so excited, just thinking about it! =D

25. Wow well returning to lava concept from bob we could have a special script the kills people and melts anything in contact with it, we could do it after awhile when we finish the water concept.

26. This would be awesome in my game! Can you die in the water? And can you change the color or the flow of the water?

27. I can’t wait to see this in action.Especialy if the boat starts to sink. i wonder what would happen?

28. The water I think should be a separate class of it’s own that has all the characteristics of regular Parts, but with the additional water Properties. CanCollide for the difference between ice and water and all those properties.

29. Just yes. But they need ot be completely customizable. In color and texture. As well as flow speed. But I could totally see these being recieved well. Next up: lava

• Lava doesn’t need the Devs to create. Take Standard Obby Lava, Stick a Texture on it. Because ROBLOX is typically flat and Lava is too dense to move fast on a flat surface, you don’t have to make it mobile at all.

Creativity knows no bounds.

• The water most likely will be able to be modified to be red and have killing properties…

Also i think its a horrible idea. All of a sudden your going to see lame games all over using it as their main theme or challenge. Its going to be overused. Roblox is just making users lazy and babying them so that they don’t have to script as much

30. Wow I can’t wait to get this update! Also I can’t wait until Titanic gets updated with this water!!!!!!!!!!!!!!!!!!!!!!!! OmG CAN’T WAIT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

31. This is awesome!! Color change should be added and lets also add something where if you swim underwater your screen transparently becomes the color of the water.

32. epic but could u make it so we could agust it in color and stuff!?!?!?!?!?!?!?!?