• Advertisement


This topic is now archived and is closed to further replies.

simplified tank movement

This topic is 5193 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello all, I''ve been working on developing the movement characteristics for a 3d tank game. I had hoped to produce a "somewhat" realistic physics engine, but instead I think I will simplify things and just try and reproduce somewhat believable behavior. What I would like to do is have some statistical variables for each tank including: - mass (or weight maybe?) - engine horsepower - tread type (effect max traction, perhaps speed?) and then use these types of variables in my algorithms. Some of the calculations I need to work out are: 1) how to relate engineHP to mass and determine a maximum possible speed in a somewhat believable calculation? 2) how to deal with acceleration? It seems to me that tanks accelerate/decellerate rather quickly (at least when moving at slow to "normal" speeds). So if a person releases the throttle, the weight of the tank is large enough that it will very quickly reduce speed to 0. This had given me fits in my attempt at a physics engine. How quickly do I make the tank change speeds? 3) how to manage the slippage that I want to occur on slopes? It also seems to me that the effects of gravity are different for a tank-like vehicle than, say, a car. I think a tank going uphill will need to labor more (and its speed slow down somewhat), but ultimately, when the slope gets too great the treads will just loose traction and start spinning(?). Going downhill, the tank may speed up somewhat, but I would think the rotation of the gears effecting the treads would remain fairly constant and the additional force would be an internal one on the moving parts trying to keep the speed under control(?) And at some great slope, the treads would just slip again and the tank perhaps skid down the slope(?). I guess I''m looking for any thoughts or advice on how to create these artificial calculations? How to determine when the tank might slip going up or down? How quickly should I accelerate the tank? Can I structure the engineHP and mass in such a way as to provide a cap on the highest speed possible? I am not at all a physics person and can use all the help I can find! Thanks.

Share this post

Link to post
Share on other sites
dgroncki wrote
I am not at all a physics person and can use all the help I can find! Thanks.

If you''re not a physics person at all, then in my opinion you need to start out with something WAY more basic than a tank vehicle simulation. I fear you will become extremely frustrated extremely quickly if you jump into the deep end!

Do you know anything about projectile motion, and basic collision response such as momentum exchange of two colliding billiard balls? These can be done using particle system physics, and that is a good starting point. Search the archives, or buy a copy of "Physics for Game Programmers," or search the web. There''s a bunch of resources for particle system physics----which is where you''d want to start.

You certainly can develop a tank simulation that is "somewhat" realistic but also simple. Mass (not weight) will be important. Gravity is important (and gravity leads to the creation of weight---but it is gravity you will use not weight explicitly). Since tanks rotate with the terrain, if you want to have realistic rotations (e.g., a tank that flops over in a realitic-like way when it rolls over a rock) then you''ll need to deal with mass moments of inertia---these are properties related to mass that affect rotational effects. If you really want realistic friction effects (due to threads), then you will have to work your way up to this. You could represent a very simple tank using a particle that includes rotational effects to align with the terrain.

By the way, "traction" is really a generalized surface force. It is friction plus any other force or torque generated at a surface. It can include surface pressure, and so more obscure forces.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post

Link to post
Share on other sites
I appreciate your reply and agree with what you say IF I was really trying to make a marketable tank sim. I''m not. I''m using Blitz3D to write a game that I hope my friends and I can play and then perhaps others. But it isn''t with the intent to make money...
I think I have a good plan for the projectile physics and I already have the code in place to make the tank "hug" the terrain. I don''t know if I''ll go so far as to try and simulate going over rocks, etc... but who knows.
I guess what I am looking for is to come up with some basic formulae based on realistic data that perhaps is simpler to execute in realtime than a full-blown physics calc. I found data on an M1A2 Abrams tank that I hope is a start to some game logic. Here are some specs I found:

There are three "variations" of Abrams so I''ll list specs as [#1|#2|#3]:

Version 1
weight: [60|63|69.54 tons]
power rating: [1500 HorsePower all 3]
power/weight ratio: [25|23.8|21.6 hp/ton]
ground pressure: [13.1|13.8|15.4 PSI]
max road: [45|42|42 mph]
max crosscountry: [30|30|30 mph]
max 10% slope: [20|20|17 mph]
max 60% slope: [4.5|4.5|4.1 mph]
Accel (0 to 20mph): [7|7|7.2 seconds]

Unfortunately, this is the only data I have found on "modern" tanks that is this detailed (although I will keep looking).

I really want to create a 3D game similar to the old "tank wars" of DOS days. A player vs player vs machine match where winning rounds enables you to upgrade weapons/armor/engine/treads/etc...

I am thinking of a simple system of:
Armor Class: light/medium/heavy/super-heavy
Weight: effected by armor class and perhaps tank "model"
Engine: a few different HP''s like 750,1000,1250,1500 (max)
Tread: somehow put in upgrades that will effect max speed and/or traction. Perhaps speed and traction have an inverse relationship, too?

Based on the starting tank stats and future upgrades, then I would like to calc:

1) maximum speed (per tread) forward and reverse (I think I''ll make max-reverse-speed = 1/2 max-forward-speed)
2) acceleration amount.
3) greatest vertical slope possible before slippage.
4) greatest downward slope possible before falling down hill.

So this is where I am. What I am trying to figure out know from looking at the data is what kind of relationship explains the effect of slope on max speed. It looks like a quadratic equation of some sort(?) but I certainly don''t have enough points to accurately figure out an approximation for the true curve. And I still would like to know what happens as the slope increases beyond 60%?? Does slippage suddenly occur and the tank would go from like 3mph to 0 abruptly? Or is it a smooth decline down to 0mph and then the slippage occurs.

I really don''t want what you all on here might describe as a "simulation". Certainly the audience on here look to be math and physics wiz''s and would model this from a totally different perspective. I think what I am after is more just approximations of reality based on a known set of statistics and a somewhat decent attempt at creating the formulas to relate these stats to the missing behaviors.

I hope I made sense and this doesn''t seem to dumb an idea.


Share this post

Link to post
Share on other sites

Of course your idea isn''t dumb. I read too much into your original post, and thought you were looking for a more detailed physics simulation.

Actually, "simulation" is a broad word and the thing you want to do is a simulation. It can even be considered a physics simulation, although you''re wanting to use a set of simple rules instead of going back to first principles such as directly modeling gravity and friction.

I believe you can produce something workable using the approach you describe. I just don''t have time to address all of your questions in detail. But I can help with the max speed relationship.

Actually, you do have enough points to determine a quadratic relationship for max speed based on slope. All you need to find a parabola is 3 points, which you have (cross-country or road/10% slope/60% slope).

Let your points be defined where x is slope and y is the max speed. You''re going to fit a parabola defined as y = ax2 + bx + c. Using the 3 points, you''ll find the values of a, b, and c. You can then plug in any slope b and get the corresponding max speed y. Your 3 points for the first variation of Abrams are:

(0, 30), (10, 20), (60, 4.5)

I''ve taken cross-country to have slope = 0.

Then using the parabola formula you can plug in these points:

30 = a*(0 * 0) + b*(0) + c

That yields c = 30

Then with the other two points:

20 = a*(10*10) + b*10 + c = 100*a + 10*b + 30


4.5 = a*(60*60) + b*60 + c = 3600*a + 60*b + 30

Just solve those last two equations simultaneously for a and b. The first equation is easy. Rearrange it to give:

b = -(10*a + 1)

Plug that into the last equation and rearrange:

3600*a - 60*(10*a+1) + 25.5 = 0


3000*a = 34.5

or, a = 0.0115


b = -10*0.0115 - 1 = -1.115

So your relationship is:

max_speed = 0.0115*slope2 - 1.115*slope + 30

Plug in 0, 10, or 60 for slope and you''ll get 30, 20, and 4.5 for max_speed. Note that you can plug in slope > 60 degrees! Although the real-life relationship may not really be parabolic, for your simple game it could be a sufficient approximation.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post

Link to post
Share on other sites
Thank you very much for your help! It''s been (too long) since my days in HS or college so my memory on how to set up these equations is rather foggy.
I have found a bunch of data on other tanks besides the Abrams and what I have found on all of them is that the maximum vertical slope each can traverse is 60%. Without exception. At any rate, it seems like a nice constant to use in the code. I am guessing that at that slope, a tank will just "slip" and its treads just spin. If so, then the velocity just doesn''t gradually diminish to zero but the gravitational forces suddenly overpower the tractional forces and I''m sure the sight of a tank spinning its treads is pretty bizarre.
Thanks again and I will continue to work on "simulating" these physics :-)

Share this post

Link to post
Share on other sites

  • Advertisement