Mobius Digital
  • Games
    • Outer Wilds - Echoes of the Eye
    • Outer Wilds
    • Beacon 38
    • Terra Chroma
  • News
  • Team
  • Jobs
  • Press
  • Support
  • Contact
  • More
    • Outer Wilds: A Thrilling Graphical Text Adventure
    • Privacy Policy
    • Fan Content Policy

Breaking the Laws of Physics

7/1/2015

 
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.

This is what I saw.
Picture
Those who have played Outer Wilds before know that the game begins with the player character looking up at the sky. This is technically a screenshot of that scene, albeit with a few notable discrepancies. Let's ignore all of the weird graphical artifacts for a moment (those are to be expected when upgrading a project) and focus on the fact that the player character has fallen through the ground and is well on her way to the planet's core. If you haven't played Outer Wilds, I should note that this is not how the game typically starts.

A cursory glance at the error output window revealed the source of the issue.
Picture
The console contained 999+ identical errors reading "Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5". Non-convex (or concave) refers to geometry featuring negative topology (valleys, caves, tunnels, etc), and non-kinematic rigidbodies are objects that can be moved by physical forces. This error essentially means that dynamic physics objects can no longer have negatively-curved geometry in Unity 5.

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:
  1. Replace every non-convex mesh collider in the game with a bunch of convex mesh colliders. This is almost definitely a terrible idea (imagine trying to create a tunnel out of convex shapes).
  2. Secretly make every planet static...it only looks like they're moving. This is problematic because we'd lose all of the cool side-effects of actually simulating planetary motion (try jumping straight up on the moon and notice how you drift across the surface depending on your distance from the equator). Theoretically you wouldn't notice a difference if we correctly simulated Coriolis forces, but that is a massive "if".
  3. Make every planet a kinematic rigidbody (instead of non-kinematic). Kinematic rigidbodies can still be moved manually, but they are not affected by forces. We'd have to write our own physics simulation to achieve planetary motion and crazier stuff like the islands on Giant's Deep. We'd also need to choose an integration method that closely approximates the one used by PhysX (the internet says it's probably this one: https://en.wikipedia.org/wiki/Semi-implicit_Euler_method).
  4. Keep using Unity 4.
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.

--Alex

Join our mailing list for all the latest news on Outer Wilds!

* indicates required
George Zackrison
7/8/2015 06:02:56 am

That sounds like a huge mess, hope you guys figure it out though!

Matt Steinhauer
7/8/2015 01:27:21 pm

Regarding your question I would all most 100% chose 3. It may delay development. However if you go with 3 then you will be able to have more control all the forces side of the game. Option 4 is the lazy way out IMO and Outer Wilds deserves better than that.

Fun1k
7/21/2015 01:26:13 am

What does Unity 5 offers to Outer Wilds that the game actually needs? On Unity 4 the game seems to run swimmingly, so unless Unity 5 brings something really cool that would improve OW, then why not keep U4?

Jeffly
7/23/2015 02:33:57 am

Seems this game has a lot more physics working under the surface than I knew about!

I don't know how staying in Unity 4 affects other processes, but the alpha played fine, so unless a lot of cool stuff is added by 5, I would just keep 4 and work on other stuff. Just my 2 cents ;)

Missouri Toy Store link
2/13/2021 05:11:59 pm

I enjoyed reading your blog, thanks.


Comments are closed.

    Archives

    November 2024
    June 2024
    May 2024
    April 2024
    January 2024
    December 2023
    November 2023
    September 2023
    December 2022
    November 2022
    September 2022
    May 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    July 2021
    February 2021
    January 2021
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    April 2017
    September 2016
    August 2016
    June 2016
    May 2016
    April 2016
    January 2016
    December 2015
    November 2015
    October 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015

    From the

    strip

    Updates on our games, our process, and the joys of being Mobius Digital.

    Categories

    All
    Art
    Outer Wilds
    Step By Step

    RSS Feed

Follow us on
Picture
Picture
Picture
Picture
Picture
Privacy Policy     Fan Content Policy
  • Games
    • Outer Wilds - Echoes of the Eye
    • Outer Wilds
    • Beacon 38
    • Terra Chroma
  • News
  • Team
  • Jobs
  • Press
  • Support
  • Contact
  • More
    • Outer Wilds: A Thrilling Graphical Text Adventure
    • Privacy Policy
    • Fan Content Policy