- Home /
Realistic Tank and Performance Question
I want to make very realistic tank tracks/treads with track plates. As in the wheels drive the tracks plates which then push the tank on the ground. Instead of the usual
I need to know how much of a performance hit it will make? You think its unwise? My game is not heavy at all in the texture department but the poly count is a bit high, like Battlefield 2.
So are realistic tanks like how I mentioned a good idea or will it cause problems later on?
I code in C#.
Thanks.
performance is irrelevant, so go ahead. it is extremely unlikely you will be able to make a "really good" simulation of that in Unity, but performance is irrelevant, go for it.
note that it's no different, whatsoever, than wheels moving on the ground. it's just the wheel "pulling" on the inside of the track .. no difference from a wheel "pulling" on the ground !!
Answer by DeadKenny · May 10, 2013 at 08:15 PM
Well thanks for the feedback guys
Good thing is I got it to work pretty well, feels great to drive. However it completely destroys the cpu. Can only have about 5 tanks max at a time so won't work for me.
Anyways I already got the other normal texture way of doing it working, though still rough.
You know that example you can download with realistic tracks? Yeah try duplicate the tank and see what happens.
Anyways, I'll keep a backup just in case. Such a shame though would have been great.
Answer by CHPedersen · Apr 15, 2013 at 01:16 PM
Yeah, I agree with Fattie. I think it's a great idea, but I don't think you should bother too much about getting correct physics, e.g. trying to accelerate the tank by applying friction from the tracks, or trying to move the tracks themselves around by applying force to it from multiple wheels inside of it, etc. That's overkill and unnecessary compared to what it accomplishes, visually.
The tricky part about this task is not to make physically correct tracks, but to make them rotate at exactly the same speed the tank moves, so that they never seem to unnaturally "skid" across the surface underneath the tank. That's what will break the illusion.
If I were you, I'd design the tracks and wheels carefully in a modeler (Blender/3D Max) instead, and then add an animation to it that moves the tracks exactly one revolution. You can detail it nicely and make the links curve across the wheels a little at the top, and make them bounce slightly, perhaps. But make sure you nail two things: That the animation does one whole revolution, and that you know precisely how long the tracks are.
In Unity, all you have to do, then, is to start the animation when the tank moves, and then make sure you move the tank a distance that corresponds exactly to the length of the tracks every time the animation has played once. Then the tracks will appear stationary underneath the wheels.
"and then add an animation to it that moves the tracks exactly one revolution."
exactly correct, great explanation
You know an AWESO$$anonymous$$E trick for tanks -- this is relevant for some types of tanks, depending on how you see them etc.
To make the treads "move" -- all you do is ---
OFFSET THE TEXTURE ON THE TREADS. How damn clever is that! totally awesome.
Yeah, probably. I just had a look at what people have done for AAA-games then and now. 10 years ago in Battlefield 1942 they definitely animated textures:
http://www.youtube.com/watch?v=9qsxzRyrZ6E
Even in Battlefield 3, it looks like animated textures:
http://www.youtube.com/watch?v=gWeNBj7Vw3I
In both videos it's kind of hard to see and you have to really pay attention to the tracks. And maybe that's exactly why you need to just offset the textures; most of the time they're hidden underneath the tank's upper hull or obscured by some particle system's dust effects, so animating the actual geometry of individual links seems wasteful.
Go with texture offsets, but make sure you link it totally tightly with the vehicle's velocity. Later, you can bump map it or parallax map it to make the links stand out a little more if you feel like it.