CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.59k stars 4.16k forks source link

Offroad driving speed penalty #12549

Closed Coolthulhu closed 8 years ago

Coolthulhu commented 9 years ago

Optimal wheel area is ~1.58 * sqrt( mass ), with mass being in kilograms.

A typical car or sports car has twice that much. A typical military cargo truck can have 7 times as much.

A military cargo truck loaded fully with the heaviest substance known to man - whatever is Inline-4 engine made of - doesn't slow down noticeably. Inline-4 engine is more than twice as dense as gold.

A regular car loaded with enginium can move at a speed comparable to an unloaded bike.

The simplest solution would be simply doubling the effect mass has on safe speed and acceleration.

A better solution would be some sort of an offroad penalty that depends on wheel area vs mass ratio. That way having wheel area optimal for onroad driving could result in speed being cut by 75% (or more) when driving on the dirt. Below a certain speed penalty, the vehicle could be rendered totally immobile, so that you can't drag 16 tons of engines on a half ton car. Or, to avoid a hard cap, a different formula could be used there (a formula that actually reaches 0 and not just asymptotically).

Any better ideas?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Rivet-the-Zombie commented 9 years ago

I like it!

I'd like to add that some types of wheels would need to be flagged as being suited to offroad driving.

kevingranade commented 9 years ago

If you have a grasp on vehicle acceleration model improvements, go for it, doubling the effect of mass doesn't sound unreasonable from what I know about the system.

I've wanted to add an offroad penalty for quite a while now, or more specifically a traction adjustment based on terrain type, what I was thinking is different types of terrain have a different traction coefficient, (asphalt is super-high, sand is super-low). At each tick of the vehicle simulation, you multiply each wheel's area by the traction coefficient of the square it's on (modified by puddles or other terrain features? weather?) and then you sum the traction of all the wheels. If it's too low compared to vehicle weight, the wheels will slip (or have a chance of), if it's too high, it will increase drag. Or more likely increased traction simply increases drag, and it's a necessary evil for heavier vehicles. More advanced features include separating drive and steering wheels and applying torque when some of the wheels slip. It would be quite reasonable for driving skill to play into traction management as well, expert drivers can ease stuck cars out of holes and get the most acceleration out of a car without slipping on wet pavement. If someone knows how actual traction models work, I'd be happy to get out of their way ;)

Zireael07 commented 9 years ago

"enginium" lol

An offroad penalty would be a good thing for now.

SilearFlare commented 9 years ago

From what I remember driving off the road can tear your car to shreds, since bushes can destroy your car and tear off military-grade armor if you just think of going over them. I'd be in favor of a huge speed penalty for realism and to make it so that new players don't lose that armored carrier they just found to a bunch of shrubs.

Coolthulhu commented 9 years ago

Megashrubs was a bug, they should no longer do that.

Griffinhart commented 9 years ago

Megashrubs was a bug, they should no longer do that.

Pretty sure they still do. I know that after driving through some shrubs at moderate speed (60-90 kph) military composite armor on my mobile fortress will pop up as repairable. Security cameras will actually drop a damage level (from dark green to light) when colliding with shrubs, despite also being covered by MCA.

Coolthulhu commented 9 years ago

Megashrubs was a different thing: it caused shrub collisions to tear off heavy frames and stop deathrollers dead in their tracks.

Shrubs are still quite strong, but not THAT strong.

Griffinhart commented 9 years ago

Ahh, okay.