News for hackers. Stuff that matters.
Re:Rigs of Rods: free and open source vehicle simulator that... by Animats on Monday December 26, 2022 @07:39PM (#34143540)
Nice.

It's about typical for modern physics engines.

Totally rigid body physics is reasonably well solved by now. It suffers from the "boink" problem; in impulse-constraint systems, there are instantaneous changes in velocity on collisions. This looks OK for small objects and terrible for large ones. This is the main reason game simulations usually look wrong.

If you make everything soft, that works OK. But everything looks like Jell-O, as some early Pixar devs wrote. That's a soft-body system.

What's hard is doing things which have just a little elasticity. Which is most real-world materials. That's because you have to simulate what's happening on very short time scales, much shorter than a visual frame time. This is possible, but the compute load suddenly jumps by orders of magnitude during some collisions. That's hard for real-time systems. Also, you start to need double precision. If you don't need real time, as for film work, it's not too bad. Integration of stiff systems of differential equations is Not Fun. I used to do that stuff.

Note, in the video, how soft the suspensions are.

Re:Rigs of Rods: free and open source vehicle simulator that... by Jensson on Monday December 26, 2022 @08:57PM (#34144114)
Problem is that artists makes rigid models in other programs they aren't made to have proper structural integrity. Rigid body physics lets you work with those models anyway, with proper physics you'd need to hire real engineers to design the different vehicles and structures and weapons in your games so they don't collapse on themselves.
Re:Rigs of Rods: free and open source vehicle simulator that... by whatshisface on Monday December 26, 2022 @09:27PM (#34144332)
That isn't really a problem, games often have separate physical and graphical meshes already.
Re:Rigs of Rods: free and open source vehicle simulator that... by Waterluvian on Monday December 26, 2022 @08:58PM (#34144116)
Is there an in-between? A “plastic body system” where something behaves as a rigid body until a certain threshold or conditions and then behaves as a soft body during that condition, later returning to RB simulation using the new shape and altered parameters?
Re:Rigs of Rods: free and open source vehicle simulator that... by colechristensen on Monday December 26, 2022 @09:57PM (#34144494)
Engineers have been doing this kind of thing for a very long time. Animators just take lots of shortcuts because they can, but we’re probably at the point (if it doesn’t exist already) where you can animate with the actual properties of real materials with different models appropriate for the specific material.

An engineer designing a product can certainly run it through a simulation that accurately predicts elastic and plastic deformation as well as fracture and other failure modes.

Re:Rigs of Rods: free and open source vehicle simulator that... by meheleventyone on Tuesday December 27, 2022 @04:27AM (#34147017)
That’s what soft-body tries to encompass. You can’t just freeze and unfreeze a soft-body system to a rigid-body though as you’d end up with odd behaviour and a non-trivial decomposition. How many rigid bodies is this soft body now? How are they constrained relative to one another? And how to decompose the new shape into suitable collision primitives?

Simple mass-spring systems (like this) have issues with really stiff springs and high masses causing unrealistic responses even with a low time step but you can use approaches like XPBD which are stable. Changing the configuration of constraints is what causes the shape change.

Most vehicle sims get really far with just using a rigid-body system and modelling the damage another way. It’s much computationally cheaper, much cheaper in terms of time to setup a vehicle and lets you maintain high fidelity in the driving model which is the bit most players care about.

Re:Rigs of Rods: free and open source vehicle simulator that... by erwincoumans on Monday December 26, 2022 @09:43PM (#34144425)
Actually, rigid body simulators using impulse based constraint solvers can simulate soft constraints (including soft contact), and you can control the stiffness from very stiff to very soft without becoming totally unstable. See this slide deck by Erin Catto: https://box2d.org/files/ErinCatto_SoftConstraints_GDC2011.pd...
Re:Rigs of Rods: free and open source vehicle simulator that... by MrScruff on Tuesday December 27, 2022 @05:51AM (#34147523)
The only issue with iterative constraint solvers is the 'long chain' problem, where it's not possible to solve for longer stiff chains of constraints. Direct solvers can do it, but not with reasonable performance/memory usage.
Re:Rigs of Rods: free and open source vehicle simulator that... by erwincoumans on Tuesday December 27, 2022 @09:54AM (#34149166)
Indeed, you can add a Featherstone articulated body algorithm implementation for such cases, or direct solver with good performance (see Maciej Mizerkski talk on Roblox solver here: https://youtube.com/watch?v=P-WP1yMOkc4)
Re:Rigs of Rods: free and open source vehicle simulator that... by MrScruff on Tuesday December 27, 2022 @01:00PM (#34151493)
Very interesting, thanks for the link!
Re:Rigs of Rods: free and open source vehicle simulator that... by bgkim on Tuesday December 27, 2022 @01:27AM (#34145798)
How about the modern physics engine for the real world? How much energy would it need to calculate all the effects of collisions of the "little" elastic bodies with infinite precision? And how fast would it need to be to calculate them in such a short period of time?

It's amazing to think about all the objects in the universe which collide, always according to the laws of physics, not requiring any cost/resource/energy to such computing loads, and reliably without any uncaught exceptions.

Re:Rigs of Rods: free and open source vehicle simulator that... by bjornsing on Tuesday December 27, 2022 @02:08AM (#34146067)
I think it should be safe to assume that you always need a computer that is bigger than the mass you are trying to simulate (in every possible aspect).
Re:Rigs of Rods: free and open source vehicle simulator that... by bgkim on Tuesday December 27, 2022 @02:45AM (#34146282)
Sorry I meant the theoretical physics engine operating the real world. For example if 1N of force is exerted on an atom having 1kg of mass, who is to calculate the resulting acceleration of the atom and update the value of the acceleration state variable of the atom? Atom itself or some kind of the universe OS? And wouldn’t it be necessary some kind of energy to calculate it?
Re:Rigs of Rods: free and open source vehicle simulator that... by meindnoch on Tuesday December 27, 2022 @04:52AM (#34147178)
Jt’s just a guy with a bunch of rocks: https://xkcd.com/505/
Re:Rigs of Rods: free and open source vehicle simulator that... by radarsat1 on Tuesday December 27, 2022 @04:57AM (#34147211)
> not requiring any cost/resource/energy to such computing loads, and reliably without any uncaught exceptions.

It is highly distributed, in that every atom in the universe is performing this "calculation", all the time. That is literally an ungodly amount of energy. As for uncaught exceptions, they are also performing "only" this calculation, not much room for exceptions there. But let's not talk about quantum tunneling and other weird things that go on in the even lower level VM ;)

Re:Rigs of Rods: free and open source vehicle simulator that... by robin_reala on Tuesday December 27, 2022 @05:40AM (#34147472)
If we’re being literal, a lot of people would claim that that’s precisely a godly amount of energy.
Re:Rigs of Rods: free and open source vehicle simulator that... by l33tman on Tuesday December 27, 2022 @06:11AM (#34147634)
Yeah it is incredibly much more computationally expensive when you consider it's a quantum mechanics universe and not a Newtonian, as all possible updates and combination of updates needs to be calculated and all considered together to generate the output probabilities..
Re:Rigs of Rods: free and open source vehicle simulator that... by adalacelove on Tuesday December 27, 2022 @01:30PM (#34151905)
There is plenty of work to do in my opinion regarding rigid body simulation. You just need to consider harder problems!

An example: https://youtu.be/z12UdMbELdc

The whole Siggraph channel is quite cool. It's just demo videos.