There are a number of ways to approach this problem, with and without using Roblox physics. In general, most games with realistic real-world tanks that have 90+ links per track, are using skinned meshes and bones to render the tracks. It’s simply too many links to do with Roblox parts and hinges. Even if you can get the simulation itself to be stable, it’s too many part changes to replicate per frame.
Steel Titans is definitely using bones, and client-side rendering. It’s a pretty big clue that your own tank is the only one you see with animated tracks; all the other tanks just have non-animating black bands around the wheels. War Thunder also has skinned mesh tracks on the tanks, and they do plenty of cheats to get good performance that you can spot if you look closely.
When I made a tank in Roblox, I also used skinned mesh parts and procedural (purely scripted) animation:
Here’s the thing though:this is not an easy coding problem. The solver I wrote to position the track links is fairly complex. It runs every frame, starting with considering the positions of all of the wheels the tracks go around and using a modified convex hull algorithm to find the path around them in terms of a closed-loop spline of line segments and circular arcs. Then, some raycasts to the ground are used to see if there are any points between the wheels where ground obstacles are pushing up on the tracks to make the path convex. Because of how tank wheel bogies can move, the tracks aren’t always in contact with all of the ground wheels, some get skipped.
The resulting spline is a taut path around the wheels, which is not a final solution for a few reasons:
- Real tank tracks are made from rigid links, so there is an overall path length constraint that needs to be satisfied, which is done in my renderer by letting the track sag over the return rollers.
- The tracks have a discrete number of links, but the spline path is a continuous curve. The spline needs to be converted to a polygon of only line segments, one per link.
- The path alone is not the whole problem, there is a sprocket driving the track which determines the phase. The links have to always line up with the sprocket teeth.
Overall, there isn’t a closed-form solution to this, the solver is iterative. In practice though, there are usually enough links in the tracks that the discrete polyspline is close enough in length to the continuous spline path that sagging can take up the slack, and the amount of sagging can be done with a non-iterative solution (although that’s not always what I’m doing). In the latest version, I replaced my original circular arc sagging with gravity-direction-accurate catenary sag, and this is another iterative solving step:
None of this is easy math. I don’t know about the Steel Titans devs, but I have engineering and math degrees and it’s still a challenge to get these sort of things working and performant in Lua. There are some custom algorithms and numeric root finding involved, along with a lot of line-line and line-circle intersections, even some calculus for the catenary parts. Despite being on Roblox, both Steel Titans, and my own tank are both a bit more accurate that what’s done in either War Thunder or World of Tanks. For example, I never cheat the length constraint solve by distributing error over the link gaps. You could do this, but not if you want the links to exactly track with the drive sprocket and never exhibit any noticeable spacing changes.
That said, there is another option. Instead of a raw Lua solver, you could also model the tracks with a smaller number of parts and hinges, physically simulated, but then make the physical parts invisible and just use their positions each frame as sample points, which you can then interpolate between to position rendered track links.
Some games also use beams or animated textures on non-deforming meshparts. Obviously this is not going to look as realistic as individually rendered PBR links, but it depends on what look you’re after. If you aren’t concerned with showing moving links at all, you could just basically use a skinned mesh part to make a sort of deformable rubber band around the wheels. In Roblox, Bones are actually just special Attachment instances, so you can put them on the edge of non-rotating, invisible, frictionless “wheels” so that you don’t even need scripts to drive the deformation. It all depends on if you want tracks that actually look like they have moving links.