Robust Joints and Motors: Keys to Better Vehicles in ROBLOX

Advanced Physics - Robust MotorsAt ROBLOX Game Conference 2012, Kevin He dissected the steps he’s taken to refine ROBLOX’s water physics, hinges and motors so that vehicles – especially boats – perform more realistically. In this blog post, we’re recapping the key parts of the development process. You might be surprised at how much work goes into physically simulating real-world machines in a life-like fashion.

ROBLOX’s water, released in June, gives you the ability to create a boat that floats based on actual physical properties, rather than lines of Lua code. While the release of water marked a big step forward for ROBLOX, it has its limits; for example, if you want to create a propeller-powered boat, the propellers have to be on the side of the boat, as though they’re mimicking wheels on a car.

We’re working toward releasing a vehicle seat that gives players greater boat control, namely over rear-facing propellers that function based on real physical forces. It sounds simple, but it’s actually the culmination of two complex physics engine developments.

Water Physics and Buoyancy1. Advanced water physics

ROBLOX’s water accurately simulates buoyancy, so objects float (or not) and orient themselves based on the density of their material makeup. But the current water simulation doesn’t take into account the angle at which objects move through water and the resulting amount of water viscosity (or resistance).

The next water release will. As you can see in the videos below, objects will slide through the water on a trajectory that matches their angle, and at a speed that correlates with their size and shape. For example, a flat, angled part shoots through the water, while a wide object situated perpendicular to the surface will sink slowly. Compared to our original model, it’s more intuitive.

Parts move through water more accurately under our advanced water physics.

This is one key to working boat propellers. The fins of a boat propeller move through the water at an angle, not perpendicular to the surface.  Our advanced water physics simulate the force generated by the angled propeller fins spinning through the water, thereby pushing the boat forward.

2. Robust, stable hinges and motors

The force of a propeller is only as good as the propeller’s ability to stay rigid and strong under water. Rigidity and strength required that we make ROBLOX’s hinges and motors more robust.

The hinge, for a boat motor, is the axis around which the propeller fins spin. If the hinge is not rigid – or has a “weak constraint” – the fins will wobble and the force the propeller generates will go in multiple directions, which is not efficient for generating speed and maintaining a steady direction. If the motor is not strong – the result of insufficient joint stiffness – it will not be able to generate enough torque to rotate in water.

You can see our progress in the following video. Notice that the new joints are rigid (less wobbling and bouncing) and the new motors are strong (parts rotate rhythmically and with little wobbling).

More rigid joints wobble less and make for better motors.

Our goal is to make all joints in ROBLOX as rigid as they can be. However, we can’t make the physics engine arbitrarily stiff because it may over-correct simulation errors and eventually destroy mechanisms. Instead, we are introducing new optimizations to reformulate the joint constraints and make them more accurate. We’re also implementing a new formula to automatically pick the optimal stiffness constant for a given mechanism and a dynamic “physics-simulation step size” to add simulation detail to parts of the world that are particularly challenging to stabilize.

This video demonstrates robust hinges and motors on a battleship, speed boat and monster truck.

A vehicle seat for boats

ROBLOX players take control of cars by sitting in the “vehicle seat,” a special part that gives them control over the vehicle’s wheels. Currently, game creators are inserting vehicle seats on boats, which allows players to control side-mounted propellers. It works, but it doesn’t allow creators to build realistic boats.

We are developing the next generation of vehicle seat that, when installed on a boat, automatically detects back-mounted propellers and lets users control them using the keyboard.  The new vehicle seat will be implemented in Lua, exposing to scripters the underlying logic that wires the wheels and propellers together. Not only will it support boats, but also be more customizable than the current vehicle seat.

Demonstration of the vehicle seat controlling two rear-facing propellers (and their power).

This next-generation vehicle seat wouldn’t work without robust hinges and motors. And they wouldn’t work without advanced water physics. So, while the new vehicle seat is relatively simple, we had to focus a lot of effort on further developing our physics engine to give it purpose.

We’re also working on additional joint types, which we will cover in the future:

  • Revolute joint/motor
  • Rope joint
  • Rod joint
  • Spring joint
  • Ball/socket joint

As abstract as those joints may seem today, they’ll open up a world of possibilities for ROBLOX game developers in the future. Stay tuned for more.

423 thoughts on “Robust Joints and Motors: Keys to Better Vehicles in ROBLOX

  1. Wait, does this mean i can make a hydro plane? WOOOOOOOOOOHOOOOOOOO!

  2. I’m going to add propellers to my car, it will then be an amphibious recon light transport tank thing

  3. so will you have to make the propeller your self because i dont know how to slant objects

    • Theres a rotational tool within studio you can use. Just set a block down, place thin wood blocks on around it, like ROBLOX did in these videos. Afterwards, use the roation tool to slant them. Easy as that! :)

  4. i would love to see a submarine seat…. i may do a bit of script exploring on the new seats too! one more thing i’ll start doing is working on a capsize-able boat for my game as a transport for troops! if you want it to be a model when i finish it send me msg!

  5. Im glad they are trying to fix the witchcraft hinges that would spaz or break at too much weight, but couldnt they fix other simple problems as well such as when your seated, it makes you look like your standing? Or cylinders which are really just a mesh for a sphere.

  6. agreed the terrain lags my new laptop and my old compuer and the water makes it worse so why make boats and add studio back to normal build mode.

    • Well Terrain and water DO lag but not if used in moderation. As for putting Studio back in Normal Build mode ROBLOX made a mistake ever removing it and we need it back a lot of my friends NBC AND BC are quitting. A few of those NBCers were thinking about buying BC but they say “What’s the point when I can’t even build?” because of them removing Studio from Build. ROBLOX, do us AND U a favor. Bring Studio back to Build.

      And make this new Preferred Browser thing optional I have a lot of friends who preferred the old ROBLOX browser. I’m happy with Google Chrome as for me it’s faster and less laggish but for a few of my friends the old browser actually worked better. PLZ bring it back and make this “Preferred” Browser thing optional. (Preferred is in “”s because some people preferred the old browser.)

  7. Roblox needs to think about people whos computer can’t handle terrain. It taker me a half hour sometimes just to find the classic base plate to build on because the stupid new terrain base plate! No wonder Roblox’s number orf player descreased! It sucks!

  8. I am totally against roblox updates, but those new hinges don’t seem half bad.

  9. Ddude!!!this is awesome!!!! keep up the good work roblox dev’s also…i know tons about computers and pc games so i think i could be a big help in roblox development!! so maybee i can help?

  10. This is great! For us who make machines in Roblox, this will make life much more easy. And the new joints that are being worked on, just blows me away! The spring joint will make all my suspenison cars out-dated, but it just means I can make more advanced things. Keep the great work going guys!

  11. I gonna try out propellers now (Just with a Motor and that propeller thingy :P) and place it under a floating plate xD

    • Thank you for the interest. Please hold testing it until we release it on Gametest.

  12. These updates in physics are going very well! although, I think roblox should focus on it’s stability in other ways. If people can copy places, then they can also steal accounts, and get into credit card accounts too. Roblox is doing well with all of it’s new updates, but I constantly fear being hacked, especially since a recent roblox update made me change my password. I don’t think you really NEED two numbers in your password, a hacker would just need to think within the parameters of ten different digits. roblox should probably ask you personal information when you log in from a different IP. or, you could only let certain IPs log into your account, and you could set the IPs from your “account page.” and if an unlisted IP tries to log into your account, the account will be “locked” until a listed IP logs in.

    • That would be a problem if you bought a new computer, and your old one broke, because you wouldn’t be allowed to run the Computer because you now cannot modify settings to allow the IP address because the computer is broken, To prevent that from happening, it would be best to manage that with a parent account.