Hacker News new | ask | show | jobs
by dljsjr 1367 days ago
A few years ago, as someone who has worked on physics engines for robotics simulations, I would have agreed with you. But now a lot of people are doing greenfield physics engines for games and having it work out pretty well. There's a ton of established academic and conference literature in the area now and it's not nearly as scary as it used to be.

For example, Horizon: Forbidden West uses a custom physics engine that started out as one of the core dev's fun side projects: https://github.com/jrouwe/JoltPhysics

Physics engines (at least game quality physics engines) are starting to drift in to "solved problem" territory and there's enough literature now that you can get something reasonable going yourself after doing some weekend reading.

Edit to add: Godot has had its own engine available for a long time, so it's not a totally new effort. It's a heavy refactor and a large improvement but the bones for this were laid years ago so some of that technical debt you're describing has already been paid down.

2 comments

I've briefly looked into physics engines and they seem to require a lot of trade-offs. If a rock meets a hard place, what should happen? Gamers have seen the hilarity that can ensue. Designing your own engine allows you to make those trade-offs with the end goal in mind. You can do things like set global force or speed limits, because you know your game's design and the appropriate limits.
How complicated were the physics engines you worked on? How exactly did they differ from turnkey solutions like Bullet, Havok, etc.?
Lots of simulators for robotics use ODE or Bullet, actually, and they're quite good for lots of things that you might want to simulate. But there are some people who would argue that they aren't the best for it, especially for simulating legged locomotion, because of the way physical constraints such as joint limits are enforced (via Lagrange multipliers). A popular alternative formulation is Featherstone's Method[1], which is becoming more widely available and goes by other names sometimes; for example, Rust's `rapier` physics engine refers to this type of dynamics model as "reduced coordinates" (they don't yet support it, but it's on their roadmap). Featherstone's method is becoming more popular but it's still not widely used in a lot of physics engines because most physics engines are targeting games and Featherstone's doesn't always have the best performance characteristics, instead favoring physical fidelity. Bullet can run using Featherstone's Method, by the way. One of the few FOSS engines I know of that supports it out of the box.

Additionally, there are people in robotics who like to say that simulators are like lightsabers, you haven't become a true Jedi until you've built your own, so there's a lot of home grown physics simulators in robotics.

[1]: https://en.wikipedia.org/wiki/Featherstone%27s_algorithm