Breaking the Laws of Physics
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.
This post was orginally published on our blog by Creative Director Alex Beachum.
So we finally tried updating the Outer Wilds project to Unity 5 this week! After several thrilling hours of tweaking the entire code base to work with the new (admittedly much-improved) Unity API, the last compile error finally vanished and I eagerly pressed the play button.
A cursory glance at the error output window revealed the source of the issue.
In most games this isn't a problem. The most common use for convex colliders is level/terrain geometry, which by definition is usually static. Objects that need to be simulated with physics tend to be simple enough that their shapes can be approximated by one or more convex colliders.
In Outer Wilds,¬†literally everything in the game¬†is moving at very high speeds due to real-time physical forces. Each planet is a non-kinematic rigidbody that is actually rotating about its axis as it zooms around the sun. Every planet also features a ¬†terrain that relies on a non-convex mesh collider to prevent smaller physical objects (like the player) from falling through it. Likewise, your ship is a dynamic rigidbody that needs a non-convex collider so that the player can walk around inside the cabin while it's in-flight (fun fact: we have to apply a counter-force to the ship at its point of contact with the player, otherwise the player's weight would cause it to spin ever so slightly).
A quick google search revealed that the ability to marry non-convex mesh colliders with non-kinematic rigidbodies was discontinued by the physics engine itself. Unity 5 uses the latest version of Nvidia PhysX, which apparently no longer supports that feature (probably for performance reasons). In short, it's not something that's going to be fixed anytime soon.
That leaves us with a few options:
We're still weighing these options against each other, but right now we're leaning towards either 3 or 4. It just goes to show that when you make a game that blatantly ignores how its game engine is intended to be used, these types of problems simply come with the territory.
Then again, I suppose we wouldn't want it any other way.