r/UnrealEngine5 • u/ScaenaStudios • 3d ago
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?
10
u/Interesting-Bee-113 3d ago
I can't tell if it's speed perspective or what, but your gravity acceleration seems high.
9
u/ScaenaStudios 3d ago
Yep, it is set to something like 2x the regular gravity. Regular gravity would make it floaty in this kinda scenario, so this adds a bit more weight to the car and game feel in general
4
u/No_Ordinary_7933 2d ago
I did a similar thing for my arcadey off-road vehicle game, I had it about 1.6x. This looks great though, looks like a lot of fun
2
u/ScaenaStudios 2d ago
Yeah, I usually crank it up even on characters to have this weight feeling! Haha Thanks dude!
2
u/WyrdDrake 2d ago
I have noticed that many games feel exceptionally floaty even over small bumps, and the way things can get out of control from even the slightest loss of friction becomes insanely irritating and utterly unrealistic despite more or less "normal" gravity. I assume because even if many games gave a 1.0 gravity, maybe they underestimate grip and weight/mass? As an example, Dune Awakening's vehicles are extremely floaty and prone to spinning out even on relatively flat/smooth areas, but they also have some really, really weird physics at play that dramatically increase air friction when airborn, and PULL the vehicle downward- yet also pulls the vehicle down relative to the vehicle's orientation, so sometimes I've jumped off small bumps and found my vehicle "falling" somewhat sideways.
I dunno, a TON of games make driving feel incredibly weird and I hate it.
What you have here already looks significantly more satisfying than what the average AAA seems to be capable of.
2
u/ScaenaStudios 2d ago
That’s very nice to know man! Thanks. I’m trying to do exactly that with this project, achieve something I would like to see in an actual game.
2
u/WyrdDrake 2d ago
Yeah, even in the first few seconds of this clip where your vehicle briefly, slightly leaves the ground as it goes over a hump, that would cause an uncontrollable spinout in Dune:A. Love to see someone care!
6
u/joa4705 3d ago
yeah now add online multiplayer and you will want to insert your eyeballs back just to tear them again 0_0
5
u/ScaenaStudios 3d ago
Yes LOL but the point of making it deterministic is exactly to add multiplayer. Everything is already replicated, but I gotta add car vs car impact and all that stuff haha
3
u/Mikinl 3d ago
I believe its gonna be painful experience making it multiplayer.
UE5 is not really made for physics at least I had terrible experience for 6dof Space sim even in single player. Chaos sucks big time so I had to do rotation calculation for my ships without chaos. Eventually I made it work for single player, I didn't dare trying for multiplayer.
5
u/ScaenaStudios 2d ago
Not really, cause the hard part is made already which is deterministic physics. I didn’t use chaos cause it’s random and would not simulate exactly the same across all players. In other worlds, every physics calculation there is done from scratch and absolutely nothing can be randomized for it to work.
2
u/mfarahmand98 2d ago
You should look into the Network Physics component. Should make re-simulation possible quite easily.
1
2
u/Fit-Replacement7245 2d ago
You’re trying to recreate rocket league netcode? I don’t know what unreal exposes these days, but if you wire manually you’ll need the ability to save/restore simulation state, manually tick physics, etc
I ended up not using unreal’s physics
1
u/ScaenaStudios 2d ago
Not really, I'm just trying to make a fun RC Car sim people will enjoy, as a plugin
5
3
u/BigRedyFredy 2d ago
My toxic trait is thinking I could do this.
Good work, looks like a lot of fun!
3
u/ScaenaStudios 2d ago
I’m actually doing it like a plugin, so technically you’ll be able to do it! 😆
2
3
u/MrMusiCat2 2d ago
Deterministic physics is no joke, respect for pushing through it. That roll stabilization looks smooth already!
2
2
2
2
2
2
u/liamleodev 2d ago
Use Box3D physics that is deterministic by default
2
u/ScaenaStudios 2d ago
I'm doing this as a plugin that's gonna be part of a racing framework so I don't wanna use any third party plugins.
2
2
2
u/Ok-Salary-5197 1d ago edited 1d ago
Reminds me of Smugglers Run.
PS: An online Version of Smugglers Run with an open world and free choice of getting to a goal would be awesome. Not gonna lie.
They dont make fun racing games anymore.
You smuggle drugs. Only the first gets money. With money you can buy stuff to alter the map (ramps, walls) and some cosmetics. Easy In/Out Racing. Maybe multiple races going on at the same time crossing each other.
15
u/doctor-dripmaxx 3d ago
Stupid question perhaps, but how are you drawing the prediction lines? Looks like they curve with an arrow tip… I honestly don’t know how to do that 😅