Install an electric motor on a heavy vehicle and find out it is not powerful enough to move backwards at all.
It should be the same, since electric motors don't care about the direction of the rotation.
It took a few tries, but I was able to reproduce the problem with an electric car, after replacing the regular electric motor with a "small electric motor", and adding a bunch of heavy frames and armor until the vehicle weighed over 5300 lbs. (Thanks to the Debug Hammer-space mutation!)
Now, I can accelerate forward (very slowly), but cannot move at all in reverse.

Glancing at the code, I see these lines in src/vehicle_move.cpp that appear to calculate the maximum reverse velocity as 1/4 of the forward velocity when cruise control is on. And, because it's doing integer division, I guess if forward velocity is any less than 3, reverse will bottom out to 0.
Whether a vehicle uses a gearbox or not, I should think if forward movement is possible, then reverse movement should also be possible, even if it's slower. I will try a fix and submit a PR.
The corresponding math when you have cruise control turned off is a little different:
Here it's at least using floating-point math, but in my testing I found that weight was even more of a problem with cruise control off. For example:
Edit Now I'm not sure I can trust these numbers, because I just loaded up the same car past 4500 lbs, and it can still drive with the small electric motor. Until I parked it on pavement and tried to drive it again - then I got "The Electric Car is too heavy for its engine(s)!" - I wonder if there's a similar vehicle weight calculation bug to what I observed in #38177 , where a STR 5 character was able to pull 200 kg of bricks in an unwheeled shopping cart.
Whether a vehicle uses a gearbox or not, I should think if forward movement is possible, then reverse movement should also be possible, even if it's slower.
That is not correct, if reverse has less torque than 1st gear, it can absolutely stall the vehicle.
I agree it should not be applied for electric motors.
if reverse has less torque than 1st gear, it can absolutely stall the vehicle.
In almost all real gearboxes 1st gear and reverse are made almost equal, as far as i know.
In almost all real gearboxes 1st gear and reverse are made almost equal, as far as i know.
This is kind of what I was assuming too, at least from a gameplay perspective. It looks like gearboxes are not modeled at all in the current vehicle system; electric-power, pedal-power, animal-power, and diesel-power all have their reverse acceleration nerfed by the same amount. This crudely simulates the fact that real-world gearboxes only have a single reverse gear, while typically having multiple forward gears.
I guess it would be harder to pedal a bicycle in reverse without a lot of practice, but I don't see any mechanical reason pedals should be slower or have less torque in reverse. I've never ridden a unicycle, but they would seem ideally symmetrical, the seat being directly over the pedals.
Horses, I would have to do some more research but it's probably safe to assume they won't win any races running backwards.
My thinking for now is to simply check whether the vehicle has any battery-powered engines active, and avoid the power-reduction if so. Full gearbox implementation I think will have to wait.
As a side note, i wonder if modern car gasoline engines could actually rotate in reverse if the firmware understood such a mode of operation, or the valves are still operated mechanically by the engine shaft?
Most helpful comment
That is not correct, if reverse has less torque than 1st gear, it can absolutely stall the vehicle.
I agree it should not be applied for electric motors.