Millenium7 0 Posted February 22, 2011 I've dabbled a bit in programming and the one thing that continually evolves is theory, since there's no limit on how many ways a program can be written. This makes determining exactly how the ArmA2 engine works quite difficult and thus what is possible. Anyway... One of my biggest gripes with OFP/Arma/ArmA2 is the vehicle physics, but to be more precise the complete lack of torque. Every vehicle feels very weak, theres no torque whatsoever its just a case of "uh oh, an incline, i'm going to slow down dependant on how heavy I am". It seems to me vehicle physics are pretty much a determination of 'weight', 'onroad top speed' and 'offroad top speed' with everything else calculated in real time according to them. I may be wrong and if so forgive me, but thats how it feels when playing My question is how difficult would it be to redesign a few of the core components of vehicle movement. What i'd like to see is 'torque' and 'friction' added to the mix, and remove 'top speed' as a determining factor of how well it moves on various terrain and hills. Torque should be a predetermined value * throttle percentage, such as 3000ft-lb for an M1A1 at 100% throttle. 'Friction' is a dynamic changing value, determined primarily by surface type, weight and angle The way i'd see this implemented would be through a fairly simple formula, friction is a measure of vehicle weight, contact area (tracks/wheels larger/more contact areas = more friction), surface type (grass, mud, rock/tarmac etc) and difference between wheel/track speed and movement speed (I.E. vehicle moving 10kph, wheels spinning at 20kph = less traction) and finally, divided by the vehicles propulsion angle (facing uphill = less traction than a level surface) If torque > friction then (ok so we're on a slippery section with a big powerful engine) -> increase wheel speed according to torque amount (which in turn reduces traction, ie wheels start spinning more and more if excess throttle is applied) -> reduce applied vehicle speed by weight * vehicle movement angles (reduce much quicker going uphill, much slower or even increase when downhill) if torque < friction then (grippy section compared to engine power, i.e. cars fine on dirt, tanks may spin a bit if they have gobs more torque and thus break traction) -> apply more forward speed determined by torque / weight & angle So for example an M1A1 with an enormous amount of torque but equally enormous weight, if positioned on a 30 degree tarmac or solid rock incline will easily have enough grip to move forward, and at a reasonable pace. When positioned on grass (even better lets say wet grass, because its raining) at a 30 degree incline will apply far too much torque and just spin the wheels, which actually reduces its friction and may start sliding backwards. If wheel speed is kept independent from movement speed and torque is a constant factor. Then the only thing stopping a vehicle from moving quickly is the surface its laying its torque down onto, and the angle at which it is facing. A heavy vehicle with low torque will do very bad at climbing hills since its influenced by the vehicles weight and angle a lot. An equally heavy vehicle with lots of torque will climb hills far easier/faster, though it risks spinning its wheels and reducing traction if given too much throttle. Though won't necessarily go much faster on a level surface. Lightweight vehicles such as dirt bikes will climb hills effortlessly, sure they have less torque, but they also have less weight to carry around and grip better. I cringe at how slow they are in the game when uphill. So ultimately, how viable is it? I don't have access to the engine so I don't pretend to know how you've implemented it or how hard it may be. But just going off my experience it's not a whole lot more than changing a bit of math and modifying each vehicle to have a predetermined torque value. Since surface type and weight are already included in game. It's not perfect and probly wouldn't allow serious drifting or alter any other vehicles physics (hit tiny pebble and launch 100m high etc) but it would at least allow vehicle propulsion to work much better than it currently does Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 22, 2011 I've dabbled a bit in programming and the one thing that continually evolves is theory, since there's no limit on how many ways a program can be written. This makes determining exactly how the ArmA2 engine works quite difficult and thus what is possible. Anyway... I wouldn't say that. There are specific deisgn patterns that are commonly used especially in game engines. Although RV is quite different from many other engines, I'm sure it still uses some popular design patterns. Anyway, in the interest of increasing performance, you often have to simplify (or abstract) certain physics aspects to make them practical for a game. It would probably be more reasonable to assume that different surface types in the game simply have different speed modifiers than to assume things like torque and friction coefficient are used. Of course it probably would be possible to implement something like this, you have to wonder if it'd be worth it or even noticible by the typical user... Share this post Link to post Share on other sites
wolfbite 8 Posted February 22, 2011 BD I think any modification to driving in the game would make a huge difference. I personally feel that Driving is the weakest part of the game... At least with flying is... well manageable... Driving though is like... I dont know To me it just feels like skateboarding on ice but whilst really drunk... Well all I can say is I'd rather walk than drive unfortunately due to distances you invariably end up on the icy meth'd up world of ArmA driving Share this post Link to post Share on other sites
Millenium7 0 Posted February 22, 2011 Anyway, in the interest of increasing performance, you often have to simplify (or abstract) certain physics aspects to make them practical for a game. It would probably be more reasonable to assume that different surface types in the game simply have different speed modifiers than to assume things like torque and friction coefficient are used. Of course it probably would be possible to implement something like this, you have to wonder if it'd be worth it or even noticible by the typical user... the above example can be coded very fast, with no more of a performance hit than there currently is. It's basically just a fairly simple set of math calculations, everything else is already in place aside from perhaps wheel speed in multiplayer, which is a purely cosmetic thing anyway since the vehicle position is determined client side for whoever is the driver, and then sent to other players In regards to surface type, doesn't matter. The engine already knows what is grass, dirt, tarmac, rock etc. The friction values do not need to coded into the terrain surfaces directly. They can simply be a single config file added to the game data with a number attached to it I.E. tarmac = 100.00%, rock = 90.00%, grass = 60.00%, dirt = 40.00% that number is referenced in the movement calculations to determine the friction multiplier. I'd love for them to then go 1 step further and add a countdown timer and additional multiplier for rain. So the longer and harder it rains the less friction is given for each surface, with rock suffering the worse perhaps going from 90% down to 15% within a matter of minutes on a heavy downpour, and grass staying relatively high even after a big shower. And then for it to creep back up to normal levels after the sun has been out for several hours I really can't see any downside other than coding time. But I personally believe this is LONG overdue Share this post Link to post Share on other sites
Leon86 13 Posted February 22, 2011 A complete overhaul of the driving physics might be too much work because you'd have to adjust every vehicle. But a speed/torque table could be automatically generated with the current vehicle values I guess. This way you could get a tank like an m1a1 to drive up a hill faster (it has plenty power in real world, + a speed limiter). Just make torque values low (even negative) on high speed. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 22, 2011 (edited) the above example can be coded very fast, with no more of a performance hit than there currently is. It's basically just a fairly simple set of math calculations, everything else is already in place aside from perhaps wheel speed in multiplayer, which is a purely cosmetic thing anyway since the vehicle position is determined client side for whoever is the driver, and then sent to other playersIn regards to surface type, doesn't matter. The engine already knows what is grass, dirt, tarmac, rock etc. The friction values do not need to coded into the terrain surfaces directly. They can simply be a single config file added to the game data with a number attached to it I.E. tarmac = 100.00%, rock = 90.00%, grass = 60.00%, dirt = 40.00% that number is referenced in the movement calculations to determine the friction multiplier. I'd love for them to then go 1 step further and add a countdown timer and additional multiplier for rain. So the longer and harder it rains the less friction is given for each surface, with rock suffering the worse perhaps going from 90% down to 15% within a matter of minutes on a heavy downpour, and grass staying relatively high even after a big shower. And then for it to creep back up to normal levels after the sun has been out for several hours I really can't see any downside other than coding time. But I personally believe this is LONG overdue If you take a closer look at the config, you can see there is already some system in place that at least defines the friction and "roughness" of different surface types. We know that there is a system that determines vehicle speeds on different surfaces, so it's likely these two are related. The problem is figuring out torque. The system has to work universally; for vehicles with any number of driven wheels or tracks. In order to simulate how different vehicles perform differently you would need to model a system with high enough fidelity to capture this (no longer just a simple calculation). The alternative is to predetermine some of this data and put it in the configuration file or make them properties of the model itself. Considering the amount of vehicles currently in ArmA, this would be quite a laborious task. And in the end, I still doubt anyone would notice due to fact that most people don't really notice there are already subtle differences. I think just tweaking the values used with the current system would produce better results. Edited February 22, 2011 by Big Dawg KS Share this post Link to post Share on other sites