Ok, so how did they do it in treadmarks?

Started by
17 comments, last by DirectXFreak 19 years, 8 months ago
I would guess if you wanted to create a basic tank/terrain game, it would be like moving a bar of soap
on a smooth surface. :)

That's only if you decide to use basic box physics. You have mass, gravity, velocity, acceleration, and
friction. Physics is only one part. You have terrain, so you need collision detecting. A box only
has 6 points, so these 6 points are constantly being checked for terrain/collision.

If you were doing a space sim (no terrain), then collisions would probably be easier to do.
IMHO, a zero gravity game is one step easier than your basic tank/terrain game.
Advertisement
The 8 points method doesn't seem perfect to me. Take this scenario for example...

You have the tank (box) sitting on the terrain. However right in the middle of the tank the terrain rises sharply through the middle of the tank. Just imagine a peak with the tank sitting on it. Now if you use the point method then the tank will sink down through that peak, as the points being tested are all around the peak and none are on it.

The point method in that case, means that you must have fairly smooth terrain.
Well I was thinking that for the rigid body part of the tank you check the whole box, so a point in the middle of the terrain would cause the tank to balance on that point, but the treads wouldn't do anything.

As for the bar of soap thing, how the heck would it look like that?! I've looked at treadmarks and it looks like they just put some pretty rough friction on the tank. And it LOOKS like they apply a constant friction without considering which way the tank is pointing.

Hmmm, Well in your opinion, what would be a good way to apply friction and to apply accellerating force on the tank.
--m_nPostCount++
Looking at this picture...

http://www.fas.org/man/dod-101/sys/land/m1-003.jpg

I would represent the main bulk of the tank as a low polygon rigid body that represents the rough shape of it.

For the tracks, I'm wondering if it would be good to simulate all those wheels within the tracks as separate mass point wheels? The tank would certainly be able to climb over the terrain more realistically I think. As for applying acceleration/driving force on the tank, you can see if there are enough wheels from each track in contact with the ground and apply a forward force based on that. I would have two main driving forces one for each track. and drive it like a normal tank - e.g. to turn left on the spot, move the right track forward and the left track in reverse.

There are 9 wheels per track on in that picture, and I'm not sure the best way to apply the driving force though... I've thought of the following options...

1. If any of the 9 wheels per track is contact with the ground then apply a constant driving force for that track. This method is the simple one and will result in the tank driving in a straight line more consistently.

2. Modulate the driving force based on the number of wheels per track in contact with the ground. However, as wheels go in and out of contact with the ground, the driving force for that track will keep getting modulated differently and could result in the tank turning/shaking left to right over bumpy terrain in particular.

3. Similar to 2, but instead of one driving force per track, why not have smaller driving forces per wheel and apply them all? If the wheel is not touching the ground it doesn't apply a force. If a wheel is in contact apply the driving force or perhaps even modulate it based on the pressure (grip) the wheel is applying on the ground?

What do people think of the above suggestions?
Yeah, basically, the more contact/collision points you have, the more smoother and more realistic your simulation
is going to be.

If you think about it, I would say a real surface has an infinite amount of contact points.

Question is, how much can you get away with before your game slows down to a crawling pace?
I haven't attempted to do terrain collision in a long time, but I do remember there's no such thing
as a perfect collision. An example is a fast moving object colliding with terrain. You have two
times, one before the collision and one after, and you have to extrapolate back along the time curve
using the quadratic formula to the place where the collision actually happened. That's at least what
I can recall. You might be attempted to just move your object straight up until it rests on the terrain,
but that's a poorman's hack.
Hmmm, Great suggestions hybrid.
I was thinking, like your last suggestion if you modeled the wheels as mass points, you could put springs on them so that if the tank went over bumpy terrain terrain, you would see each wheel on the tread rise slightly then spring back. You could model the tread to the wheels so that it changed shape to match the terrrain...

i would think that for the wheels, you would make the angular position be the same for all of them, then just edit it based on the movement of the treads.

So basically what you would have are fake wheels, they just have mass and apply force to the tank. You could use hybrid's last suggestion and use driving forces per wheel. But then find the average of all of them and apply that to each wheels masspoint. This would move the rigid body model because of the springs. (they would have to be locked to the vertical position) What do you think of this idea?

Also, this would sorta fix raydogs problem too, because each masspoint would have a radius, so each point would be touching the one next to it. (like the wheels in the pic provided by hybrid)

What do you think?
Would this work?
--m_nPostCount++
Would you need to average the forces being applied to the wheel mass-points? If you just applied the forces calculated at each wheel to each individual wheel, won't it be more realistic? Perhaps averaging will produce smoother movement though?

Yep, having the wheels on springs would be expected. It's gotta be pretty satisfying having your tank with tracks and wheels that perfectly align to the terrain. :)

Oh yeah, and I was thinking about when the tanks fire and they roll back slightly due to the firing. Palidine said this was animation layered over the physics, but I was thinking about it more and having doubts as to whether the rollback effect of the tank when it fires was animation. I was wondering that if you have springs on each wheel then you could make the tank roll backwards slightly and rotate onto its back wheels by applying a force above the Centre of Mass, so that the force invokes rotation only, not movement. So when the tank fires, you apply a 'firing force' horizontally acting on a point above the COM. The tank will then rotate onto its back wheels (but naturally the suspension will dampen the rotation) and the tank will 'wobble' slightly. I have a feeling this will look amazing and also look realistic as well as being simulated, not animated.
Yeah, all they do is let the springs do it.

If you applied a force to the body of the tank, the wheels with the springs would reset it to it's original position, but it would rock back and forth. That would be awesome!

--m_nPostCount++

This topic is closed to new replies.

Advertisement