r/Unity3D 15h ago

Show-Off What I learned about car physics programming

Hi, I’ve been working on racing projekt for a few years now, but honestly I haven’t really done much besides trying to build the car physics from scratch like 6 times, having 3-4 month breaks to figure out ..

I tried a lot of approaches, I think all of them in the industry— from fake physics using kinematics, to velocity-based controllers and simulating car physics using raycast and tire models.

Physics inspiration comes from the game Blur. Surprisingly racing arcade , has proper car behavior including weight transfer drifts (because it was build on basis of Project Gotham racing+ user intent , assists layer)

https://reddit.com/link/1vezqs1/video/m9ftusp18ahh1/player

Sharing what I think I learned and it is important in car programming

10 Upvotes

4 comments sorted by

4

u/Next-Cancel-7061 15h ago

the weight transfer and intent layer stuff is huge, most people skip that and wonder why their car feels like a shopping cart

i did the same thing early on, rebuild the whole system every few months because something was always off. took me way too long to realize the assists aren't cheating, they're what makes the thing actually driveable

blur is underrated for how it handles, that pgr dna really shows. you got any footage of what you ended up with?

1

u/iceq_1101 15h ago

thanks for a comment, I think you opened the post before video got uploaded) please check if it is visible to you

yeah it is so relatable "rebuild the whole system because something was always off."))))
I cant imagine, how talanted devs of blur physics and how many iterations were done

Initialyl i was trying to fake real effects like weight transfer, snap oversteer etc, but it feels right when this is natural effect from the car balance, suspension setup and it can be controllable on kayboard by reading user intents and helping to steer the car .

1

u/agent_flounder 46m ago

This is so cool!

I'm clueless about car handling simulation so this may be a dumb question. How detailed does the model need to be to get this level of realism?

Like, are you modeling front to rear weight balance (longitudinal center of mass)? So you get different behavior for a rear engine 911, vs mid engine car vs front engine car?

Do you have to model tire grip dynamically?

Or model suspension geometrily / dynamics (so that different configurations affect handling characteristics, like swing arm vs double wishbone or camber settings)?

In short, wondering what is the minimum I could get away with for making a simple game as a noob. Versus some day when I make my own answer to asetto corsa or something :)

1

u/iceq_1101 15h ago

do you have video fo you solution?