4 ms·
Writing a general engine to do all these things is likely not a reasonable thing to do. Complicated dynamical systems usually involve solving PDEs and for that
by fwilliams 9y ago
Writing a general engine to do all these things is likely not a reasonable thing to do.
Complicated dynamical systems usually involve solving PDEs and for that you need to discretize your domain. How you choose to do so will drastically affect the numerical properties of your simulation. Most "real-physics" simulators tend to be specialized to a given task or even a given domain (for example simulating heat diffusion in an engine part). There's a whole literature on finite element methods to simulate various physical phenomena though it can be quite dense.
The generic game physics engines use very simple models of mechanics and allow for numerical issues (e.g. by using finite differences) in exchange for being real-time. If you're looking to simulate more advanced physical phenomena for a game, you're going to have to make similar trade-offs and will have to choose which ones make for the best gameplay.
- philipov 9y agoThank you, that all sounds right. I've been looking for, perhaps not a single engine, but rather specialized libraries I could glue together that handle different aspects of the problem. Sounds like I'll have to roll my own from scratch. Can you recommend any general-purpose libraries (preferably with python bindings) for tensor calculus?
- musgravepeter 9y agoTake a look at SageManifolds: https://hyperspace.uni-frankfurt.de/2017/01/20/sagemanifolds/ https://hyperspace.uni-frankfurt.de/2017/01/20/sagemanifolds... My understanding is the numerical GR community is moving in this direction. The theory people tend to roll their own inside of Mathematica or Maple. Some Maple users use GRTensorIII (https://github.com/grtensor/grtensor https://github.com/grtensor/grtensor) Disclaimer: I am a co-creator of GRTensorIII
- philipov 9y agoThank you! This is exactly what I was looking for.
- electricslpnsld 9y ago> The generic game physics engines use very simple models of mechanics and allow for numerical issues (e.g. by using finite differences) Most modern game physics engines aren't actually discretizing an ODE or a PDE, at this point. The current standard techniques (see Nvidia's PhysX, for example) are instead solving something that look like a constraint satisfaction problem but gives force-like effects. You don't even get consistency under refinement with these methods, but they are cheap, and importantly, stable when terminated early (to remain under strict time budgets required of game based physics).
- fwilliams 9y agoInteresting. So are these minimizing some constrained energy based on the physical properties and current state of whatever you're trying to simulate? If so, I don't quite understand how you avoid solving (or approximating) a PDE/ODE. My research is mostly in meshing and I'm not familiar with real-time simulation stuff. Do you have a link to a good paper on the topic?
- electricslpnsld 9y agoCheck out 'Position Based Dynamics' by Matthias Mueller, it was the first paper on the topic.
- maccard 9y agoMost games aren’t using anything remotely near as sophisticated as that. Most games use rigid body simulations, and while the details of each implementation is different, most of them work in a similar way. The common method in open source engines is a projected gauss Seidel [0] which is used in bullet physics. Most other engines (PhysX and Havok) are to the best of my knowledge using something very similar. [0] http://www.bulletphysics.com/ftp/pub/test/physics/papers/IterativeDynamics.pdf http://www.bulletphysics.com/ftp/pub/test/physics/papers/Ite...
- electricslpnsld 9y ago