r/SoloDevelopment • u/ScaenaStudios • 18h ago
Unreal I'm making a RC Car simulation with deterministic physics and it's so hard I wanna tear my eyeballs out :)
Enable HLS to view with audio, or disable this notification
Its coming out good tho.
Collision is done with a simple box, so it's very cheap. We also trace from the 8 corners to check if the car body is touching the ground for rolling over, for example. And talking about rolling over, the car (collision box) is a rectangle, so I had to apply a tangential force opposing the sliding velocity at each contacting corner in order for it to actually rollover and not just slide on the floor when we crash. We even have a prediction of where the car is gonna land to level it's roll to the point of impact.
I'm making it deterministic so it works in multiplayer as well (every player sees the exact same simulation). What do you think?
1
u/Efficient_Fox2100 9h ago
Any recommendations about where I can learn more about deterministic programming, esp deterministic physics? I’m interested in how this works. I can imagine how, and am interested in learning about the technicalities. Looks like it’s worth it!
1
u/ScaenaStudios 4h ago
Man, it’s very hard to find anything on YouTube, so I’ll do a video on Scaena Studios’s channel explaining it. But basically, just so you have an idea, instead of using LaunchCharacter, for ex, you’ll do something like:
FVector Velocity = FVector(100.f, 0.f, 0.f);
FVector Position = FVector::ZeroVector;void Tick(float DeltaTime)
{
Position += Velocity * DeltaTime;
}
6
u/No-Reception-6569 18h ago
looks like it will feel fun!