Vehicle collisions

So a forever running “bug” with CDDA that’s been there since as long as I can remember is wonky vehicle collisions. It was ‘patched’ at one point but it’s still pretty bad. If you have no idea what I’m talking about take a Cube Van and plow it into a car at say 90 miles an hour. You’ve got even odds of the car shooting into the cube van. On top of that, take a road roller and roll it over a bicycle; it does a stunning amount of damage to the road roller. I don’t know about you, but I’ve seen a truck run over a bike and yeah the underside gets scratched up, but that bike doesn’t slow that truck down too noticeably, and that bike is pretty much scrap afterword.

At times the vehicle collisions almost seem like if the heavier and faster the “attacking” vehicle is, the more likely it is to ‘lose’ a collision with a bicycle. Or just have it go apeshit and launch back at the ‘attacking’ vehicle like it’s trying to strike back XD
[size=1pt]I bring this up after another game ending because I clipped a car on the way out of a town and it shot back into me and killed me.[/size]

I’ve thought about this more than once, but not being able to code I’m at a loss for how difficult it could be to fix. I can suggest something however:

What if during a collision the weight and speed of an object acted as modifiers?
*The speed of your vehicle and the speed of what its hitting act as modifiers for how much damage will be given/received by both. While for the moment you’ll be striking stationary objects pretty much all the time this could later mean head on highspeed collisions can be fatal to all but the biggest vehicles.
*Vehicle weight factors into how much of the resulting damage is ignored. To the point where a massive mobile fortress the weight of several modern day tanks would probably just be scratched or at worst dented as it bullies a traffic jam out of the way. As weight is winning factor you’d still do best to be keep an eye out for semi trucks, APC or sizable wreckage though.

Going by weight seems like the way to go to me, as things like shopping carts, bikes and scooters would take the full brunt of a collision but fail to do much to the offending vehicle.

Sounds good.

[quote=“Logrin, post:2, topic:7677”]What if during a collision the weight and speed of an object acted as modifiers?
*The speed of your vehicle and the speed of what its hitting act as modifiers for how much damage will be given/received by both. While for the moment you’ll be striking stationary objects pretty much all the time this could later mean head on highspeed collisions can be fatal to all but the biggest vehicles.
*Vehicle weight factors into how much of the resulting damage is ignored. To the point where a massive mobile fortress the weight of several modern day tanks would probably just be scratched or at worst dented as it bullies a traffic jam out of the way. As weight is winning factor you’d still do best to be keep an eye out for semi trucks, APC or sizable wreckage though.[/quote]
Both of these are already accounted for in the code calculations. The real problem with collisions basically boils down to this:

  1. The world of physics is deceptively complex. Bouncing a ball off of a wall, for example, seems a simple enough thing in real life. When you start looking at the equations that govern the motion of the ball things get pretty complex pretty quickly.

  1. To make this problem worse, there are often a variety of constants needed to be used in said equations that vary depending on the exact scenario and can really only be determined experimentally. While we might be able to find data on the CoR’s of small metal balls of varying materials, what would be the CoR of something like the front of a car? What if you change the angle of collision? After all the amount the car crumples will have a huge variance on the CoR. Alternatively what about the friction between the tires and the ground, something that depends on the placement of the tires, their surface area, their material and shape, how heavy the car is, etc.? That will also have a huge effect on the velocity outcomes of the collision, and correspondingly, the damage done to either car.

  2. And to top all of this off a surprising amount of variables depend on one another, meaning that you can get huge variances if even one thing is unaccounted for, a thing that happens often in a simple computer simulation. Things like ending velocity depend on everything else in all of the equations, while many of the constants used like CoR depend on things like initial angle of the collision, what particular parts of the car are colliding, what materials they are made out of, and the list goes on. It’s a big enough problem that there are whole professional computer programs out there aimed at nothing but simulating the way that a car would behave in an accident, and even with that car designer companies still often need to run a variety of tests to determine exactly how a design will perform in a collision.

TL;DR: Physics is deceptively complex and very difficult to program something that even begins to approach the actual way things would act, especially with a variety of important constants not even being listed or calculated in the game. It’s something that will always “need improvement”, and while we aren’t going to say no to anyone who wants to improve it, it’s one of those things where I personally am willing to wave my hands and say “good enough” for now. :stuck_out_tongue:

TL;DR:
^ I assure you that if you've taken the time to write it the least courtesy I can extend is reading it.

Now as for my reply I’m going to say that you of course make an eloquent point, and I don’t think anyone’s going to argue the fundamentals of physics (here), yet I do feel I need to clarify something.

The important issue of the thread–I think–is that something as small as a six-speed bicycle can do more damage to the military grade plating and reinforced frame of a vehicle weighing tens of tons than a shot from a weapon designed to damage tanks. To say nothing of the brief reign of anti-vehicle flowers and shrubberies.

Again though, not much we can do but respect your decision to not personally undertake what is assumedly a daunting and drearily dull task by seeing in what ways it can be improved. As always I’m more than grateful to anyone making contributions to what is in my opinion one of the better roguelikes around.

So, as the suggestion board is exactly the place for the likes of me ((meddlesome freeloaders)) I’ll just have to hope someone takes it upon themselves.