Tank Tracks Physics! (Procedurally Generated & Animated Tank Tracks)

Hello there!

Xl_Beam (My Friend),
Me (Korpsii)

Has made Tank Physics with Procedurally Generated Tank Tracks!

Quick (some) Explanations on how it works,

The Tank Tracks Animation (Doesn’t rely on Physics) and Generation utilizes a combination of bezier curve and other math formulas, which if I’m honest is really unpleasant to stare at and edit. It is also, done on the client!

The Tank Tracks alone is around, ~300 lines of code! Which, in my opinion is… Insane!

Video of the Tank Physics in Action!

There’s still ofcourse, some flaws! Like, the tank LOVES to lean forward towards the ground whenever it gets the chance too…

Performace Report (StreamingEnabled Off)

(Android Mobile)

4GB Ram,
8 Cores,
Qualcomm SM6225 Snapdragon,

Redmi Note 11

1 Tank Test Report, ~60 FPS
10 Tanks Report, ~40 FPS

That’s all I’m gonna say for now, any feedbacks and suggestions is what we’re aiming for! Cheers!^^

9 Likes

how exactly do these work? just by looking at the tracks moving it looks like A LOT of work

1 Like

probally through the use of raycast or something I don’t really know.

1 Like

You are very right! It is really… and i mean… REALLY alot of work… ~350 lines of code of PURE calculations, and it’s not fully finished yet… i can’t really explain in Details how it works, BUT… like i mentioned, it’s Bezier Curve, mixed with some other Math Formulas that i definitely forgot what it was

It’s like a 2D grid, it’ll get the Length of ALL the wheels, from the Start to End, after that, it uses simple calculations to determine how much Individual Tank Tracks needs to be Stacked to Cover the Whole Length… and ofcourse, sometimes it overshoots due to the smaller digits in length (0.2873748, etc) which causes it to create more Tank Tracks than what’s needed, and those Tank Tracks usually just wraps around the Wheels in a Circle which looks… odd.

I can probably give an more detailed Explanation when i have the free time. Cheers!^^

And nope, it doesn’t contain any raycast at all.

1 Like

all i understood from that was a lot of sluggish calculations and a 2d grid. it seems very fun to modify…

Trust me… it is… NOT… fun… to modify or edit the Scripts AT ALL… due to how my friend wrote the variables (x,y11,y12,etc)

1 Like

oh, the joys of horrid spaghetti scripts

1 Like

NO RAYCASTS? I’m impressed. Nice!

1 Like

I feel like the tank wheels move too much and are too soft.

1 Like

It’s only the wheeels on top (the gear shaped thingy, and the other one on front) that’s spinning FAST FAST… it’s because there’s no friction since it’s not touching the ground… the rest of the wheels Is fine though!

This is really cool! I am trying to make something similar for ages now but can’t make the tracks’s movement along the curve align smoothly with the wheel’s vertical movement (the suspension), since the length of the curve changes when that happens. How did you pull that off? It looks amazing

1 Like

I do not know the full math behind this sadly, since my friend did most of it…! BUT, when i have the free time, I’ll probably reach back to you to explain in Details on how it works! (after i reverse engineer it)

A little Progress here… (Interface, Tank Model, Gear Shifting, etc!)

2 Likes

recreating war thunder (only tanks) with this would be incredible