News Liste BALSA Model Flight Simulator

Dev Blog - Vehicle Wobble Physics
BALSA Model Flight Simulator
02.11.23 15:34 Community Announcements
Hi everyone, Felipe here. Today I want to talk about the physics of wobbling, and how we implemented (and got it under control) it in Kitbash Model Club.

https://store.steampowered.com/app/2107090/Kitbash_Model_Club/

Part 1 - Wobbly Aerospace Engineering



So here's the problem: in a game where you have breakable vehicles that are made of parts, you need to somehow simulate the strains and stresses between those parts.

Back in KSP, the way it worked was that each part was a separate rigid body. They were all connected together via PhysX joints, and with those, we could just let the physics engine do its thing and joints would snap on their own when you put enough force on them.

The problem was (still is) that when you simulate linked rigidbodies like that, the position of any one body affects the position of all the others, which in turn affects it back, so you need to run multiple iterations to solve all positions every frame.

The more iterations you do, the more solid the whole assembly appears to be, but you can probably imagine this is not going to be great for performance.

If you want an infinitely rigid construct, you have to run infinitely many iterations. There is no way to just set a 'wobble scale' value down to zero.

The end result is that even with a very large number of iterations, you can always build something complex or large enough to see instability in your joints, and that instability shows itself as overly flexible connections that should have been rigid.

So I spent a lot of time back then, thinking about how I would do this if I could start over. And over time I came up with a plan.

Part 2 - Welding it all together, so it doesn't move.



In Kitbash Model Club, I decided very early on that I was not going to treat parts as separate bodies. Instead, there is a single rigid body for the entire vehicle, and all parts are child objects of the vehicle.

This way, the vehicle is inherently solid. It has the shape of the aggregate of parts, but there is only one physical entity being simulated.

Ok, that certainly gets rid of the wobbling... but then that creates new problems. How do we figure out whether a part should break off? What point is there in using Struts? How would anyone ever be able to pull enough Gs in a display of excellent aerobatics to shear their own wings off?

Without the joints there to flex and bend, we needed to come up with another way to do those things.

Part 3 - Internal Wobble Physics



My plan for this had been brewing for nearly 10 years now (wow I feel old).

The idea is to use an independent, separate simulation for the wobble alone. We use a custom physics integrator, which treats each part as a body that is connected to its neighbours via constraints, or joints.

That sounds an awful lot like the original setup doesn't it? It actually is... but the key word here is separate.

In this 'internal' simulation, the vehicle lives in an inertial reference frame. We calculate and subtract all of the vehicle's root motion from the simulation, so what you're left with is only the motion between parts, aka the wobble.



We called this Internal Physics. It gives us a place where we can cause joints to flex and bend, but here we have full control over everything that goes in and out.

What we do then is take all of the forces that happen to the external rigid body (collisions, engine thrust, wing lift/drag, wheels, etc), and we also feed them into the internal physics. The external physics causes the vehicle to move as a whole, and the internal physics causes parts to move in relation to one another.

But most importantly, we can now have coupling constants to scale down these forces we are putting in. These are the 'wobble scale' parameters I had been wishing for since the early days.



You couldn't do this with a single physics model for the entire thing. If you scaled down the forces, your vehicles would just move less. But the wobble being separate from the external physics, this doesn't affect the behaviour of the vehicle as a whole.

This all means that the internal physics can actually be a very simple simulation. It doesn't need to run a lot of iterations, because we can scale down the input forces instead. There are no collisions either, because those happen on the outside.

It doesn't even need to run on the same thread, because the internal objects don't interact with the outside world directly. We actually offload the simulation to a background thread, which means we can let it run while the main game thread does other things for the current frame.

So in a nutshell, that is how the internal physics works in Kitbash Model Club. There is a lot more I could write about this thing, but I've gone on for long enough already. In fact, props to you for reading along this far!

As a little reward for making it this far, I’m happy to announce that our next Alpha Test is happening very soon! How soon? November 16th to be precise!

In Alpha Test 2, we’ll be testing multiplayer, Kitbash Model Club allows for up to 16 players to get together and battle it out, or you know, just show off your models.

Players from Alpha Test 1 will automatically be enrolled into Alpha Test 2, and an additional wave of new players will also be invited to play in Test 2, so keep an eye on your emails for more information and instructions!

We’ll also be organising play sessions with the community in the Alpha Test Channel on the Discord at specific times during the 2 week test to give us opportunities to really stress test the 16 player load! Hope to see you there!

Thanks for reading, and see you on the next one!

Felipe (aka HarvesteR)



For all things Kitbash Model Club, follow us on Twitter (X), and join us on Discord!
Logo for BALSA Model Flight Simulator
Release:14.09.2021 Genre: Simulation Entwickler: Floating Origin Interactive Vertrieb:keine Infos Engine:keine Infos Kopierschutz:keine Infos Franchise:keine Infos
Einzelspieler Mehrspieler Koop

Aktuelle Steam News
Neue Steam News in der ePrison Datenbank

KitHack Model Club is out now in Early Access!
BALSA Model Flight Simulator
15.04.24 15:01 Community Announcements
KitHack Model Club is coming to Steam in Early Access on 15th April!
BALSA Model Flight Simulator
04.04.24 14:10 Community Announcements
Dev Blog - Vehicle Wobble Physics
BALSA Model Flight Simulator
02.11.23 15:34 Community Announcements
Kitbash: Introducing Scenario Mode
BALSA Model Flight Simulator
03.10.23 17:18 Community Announcements
SimFest 2023 is here!
BALSA Model Flight Simulator
20.07.23 17:19 Community Announcements
Alpha Test Signups!
BALSA Model Flight Simulator
06.07.23 16:02 Community Announcements
Kitbash Model Club coming in 2023
BALSA Model Flight Simulator
28.03.23 13:03 Community Announcements
Developer Update
BALSA Model Flight Simulator
05.12.22 16:21 Community Announcements
Hotfix Update: v0.103.1
BALSA Model Flight Simulator
15.02.22 18:16 Community Announcements
New Update: v0.103.0
BALSA Model Flight Simulator
09.02.22 19:19 Community Announcements
Update: v0.102.0
BALSA Model Flight Simulator
23.11.21 22:14 Community Announcements
Hotfix: v0.101.2
BALSA Model Flight Simulator
28.10.21 19:40 Community Announcements
v0.101.1 Revision Update
BALSA Model Flight Simulator
27.10.21 16:58 Community Announcements
Early Access Update | Version 0.101 is out today!
BALSA Model Flight Simulator
25.10.21 18:24 Community Announcements
Playtest Ends September 24
BALSA Model Flight Simulator
20.09.21 19:53 Community Announcements
Early Access Update 1 (v0.100.1)
BALSA Model Flight Simulator
17.09.21 23:17 Community Announcements
Cleared For Takeoff!
BALSA Model Flight Simulator
14.09.21 13:05 Community Announcements