Mario Kart Inspired Kart Physics

What I’m looking for is some tip’s or advice for a method of approaching making a Mario Kart inspired kart racing game. I’ve played around a bit already and I’m leaning towards an approach similar to the team who worked on Obliteracer who (very graciously) go over some of the key physics concepts for their kart physics.

I’m pretty much looking for any advice on an approach to the actual kart and perhaps any ongoing help applying this advice if I can’t manage to get my head around it or hit any brick walls. Really any help is appreciated and I thought I may as well chuck this up and see if anyone can point me in the right direction.

Some backstory for anyone that cares:
Over the next year, I’m setting out to complete a fun fast paced Kart racing game with basic AI and weapons. I’m fresh out of high school with lot’s of time on my hands and I have a game plan and schedule all written up and a very solid idea of what the game will be when it’s done, including all the characters and whatnot planned and with concept art mostly done and the rest on its way to being done. My knowledge at this point is rather limited but I am very familiar with UE4 and Blender and have finished small games like a 2-week 3d platformer and other little experiments and other projects. I’m working as a team of 2 with my brother who will be handling most of the art side including models, materials, animation etc and I will be handling all of the programming. I plan to program the entire game in blueprints if I can manage it (like Bears Can’t Drift), however, i’m not afraid of going into learning and implementing c++ at any point.

1 Like

You can check my Kart Physics Template , you will find all what you need to start :slight_smile:

  • Physics : Suspension, Upward & Loop movement , Dynamic gravity …
  • Basic item/bonus : Speed booster & Bomb
  • Basic AI system ( Path Following)

Cheers for that, looks like a great free resource, I’ll definitely be looking deeply into it and trying to get an understanding of it thanks.

Thanks heaps for those resources Mhousse1247, The KartPhysics template has already helped my understanding a lot already. I was just wondering If you had a spare moment to explain one or two of the math expressions in the “Apply Suspension Forces” function and how they work to provide the balanced upward force.

So you have the (Current Suspension Ratio - Spring Compression) **÷ **Delta Time = Spring Compression Delta
Taking this you input it into the expression (Suspension Stiffness * Current Suspension Ratio) + (Spring Damping * Spring Compression Delta)
Then this is multiplied by the mass of the kart and the gravity scalar and then multiplied by the actors up vector.

So what I’m unsure of is exactly what Last Frame Ratios Array is or how it is defined as well as the Current Point Index and how these makeup Spring Compression which is used in the first expression, and also why the expression is divided by delta time.

What I’m guessing is that the last frame ratios array is giving the frame rates of the last few ticks, while the current point index is giving the number of suspension raycasts that are returning a hit (how many wheels on the ground) and because the last frames are given every tick this is why it is the expression is divided by delta time after they have been subtracted from the Current Suspension Ratio?..

Basically, I’m just having a bit of trouble understanding how the math is working to provide the suspension forces as neatly as it is so any pointers you could give me would help a whole lot. Thanks for the help already and the free resources, I really appreciate it.

Ok, nevermind about my guess as to what the last frame ratios were…I had missed the clearly obvious Set Array Element node directly following, whoops…still a little unsure as to how all of the math works though

Hey,
i made my own kart Mesh & wheels, everything seems fine, it drives to, wheels spining,
but for some reason when i drive at mid to full speed my car start whobling from a lil to a lot.
Any ways to fix that?
Thx a lot for the template btw.

Ue4-18 engine forgot to mension.

Ok, so the problem i have when debuging :
i see there is to much force aplied to the front wheels, so when i drive fast,
more & more force is pushing forward , then my car flips forward.
How can i set it to have more force on the rear wheels instead?
Normaly speaking the force should be on the rear wheels/suspension when accelerating and when you brake on the front wheels …
But instead when i accelerate, my car’s nose is starting to dive in the ground slowly until it flips.
Please help me out on this or idk make some lil tuto to help us understand a bit how it works …
Anyway, Thx.
(ue4-18)

Hey dude, are you using this other mhousse1247 guys kart physics template. I found this helpful to get an understanding of using line trace for suspension compression ratio etc, if not check it out it helped me a lot, if you still need some help let me know and ill take a look. If you are really struggling I could probably find the time to look at your project or make a tutorial for you. Sorry about late reply, I’ve been real busy lately.

Hello there. THank you so much for the project!

I am very new to UE and has a few questions:

When i open the project and press play, it crashes because of some errors in the BP_KART and since i dont know what torque and so on is, is there any where i can chat you for some help. thank you so much!!!

In use pin no longer exists on node Add Angular Impulse . Please refresh node or break links to remove pin.

In use pin no longer exists on node Add Angular Impulse . Please refresh node or break links to remove pin.

In use pin Target no longer exists on node Add Angular Impulse . Please refresh node or break links to remove pin.

In use pin Impulse no longer exists on node Add Angular Impulse . Please refresh node or break links to remove pin.

Input pin Vel Change specifying non-default value no longer exists on node Add Angular Impulse .
Please refresh node or reset pin to default value to remove pin.

Could not find a function named “AddAngularImpulse” in ‘PrimitiveComponent’.
Make sure ‘PrimitiveComponent’ has been compiled for Add Angular Impulse
In use pin no longer exists on node Add Torque . Please refresh node or break links to remove pin.

In use pin Target no longer exists on node Add Torque . Please refresh node or break links to remove pin.

In use pin Torque no longer exists on node Add Torque . Please refresh node or break links to remove pin.

Input pin Accel Change specifying non-default value no longer exists on node Add Torque . Please refresh node or reset pin to default value to remove pin.
Could not find a function named “AddTorque” in ‘PrimitiveComponent’.
Make sure ‘PrimitiveComponent’ has been compiled for Add Torque