The usual behaviour since TTD has been that trains just reverse in place. For a few years NewGRFs could evaluate a flag whether a train has reversed and then switch sprites to make the train appear as if it did not reverse, but would actually drive backwards.
However, this silly hack had countless limitations, is hyper complex for NewGRFs and effectively resulted in NewGRF authors wasting countless hours into a minor visual feature. During the last year tons of feature requests showed up, to add increasingly more hilarious variables to make sprites depend on weird criterions, just to make this "draw sprites in reverse" hack work in a few more cases.
Anyway, so much for the past. I think it is about time to stop this madness.
I have a working patch now, which allows trains to drive backwards, while the consists keep their arrangement. But well, obviously not all vehicles should drive backwards So this topic should be about figuring out the best options to control that aspect and the implications about it.
I had some discussion with michi_cc the other day. The sum of things to consider boils down to about this:
- Some of the default vehicles should support driving backwards. Most likely the dual-headed ones.
- Reversing vs. backward driving should have a gameplay effect. E.g. by making "reversing" take some penalty time, while driving backwards starts immediately.
- There should be no difference between reversing in stations and at the end of the line. Reversing at end of lines is equally penalised.
- The former difficulty setting "allow reversing in stations" does not make a lot of sense. This has always been more of a pathfinder setting than a gameplay setting.
So, maybe this setting should be moved to the order GUI, so players can select per order whether reversing/driving backwards is allowed, or RO-RO should be enforced.
(effectively turning the advanced setting into a make-new-orders-default-to-this setting) - This is about driving backwards, not about push-service. The first vehicle of a consist still must be an engine, because an engine in the front is what distinguishes assembled trains from free wagons in OpenTTD.
However, NewGRF can (and already have in the past) provide cab cars which are technically engines, but provide no power (e.g. by setting power to 0 via CB 36). - NewGRFs should be able to specify which vehicles can drive backwards, whether they provide power in some driving directions, and whether they can lead a consist (i.e. they can act as cab car).
- There should be an indication in the depot GUI and vehicle details whether a consist supports driving backwards.
- The reverse penalty time is fixed, and does not depend on the length of the consist.
- The depot view gains an icon between the train number and the first engine, showing either "<-" or "<->" to indicate the possible driving directions (including tooltip).
The vehicle details display this icon per engine (in the information tab?). - Default vehicles either provide the same power in both driving directions, or cannot drive backwards at all.
- Wagons can always drive backwards.
- Dual-headed engines default to "can drive backwards", while all other engines default to "cannot drive backwards".
- NewGRF gain an Action 0 property to control two aspects "this vehicle can drive backwards" and "this vehicle provides power when driving backwards".
This will make consists drive backwards if there is at least one engine providing power backwards. Consists will reverse if at least one vehicle does not allow driving backwards, or none of the engines provide power backwards. - NewGRF gain a flag in some VarAction2 variable, which indicates that a vehicle is driving backwards.
This can be used to switch front/back lights or - if the NewGRF insists on - to change the power or speed when driving backwards (though I would consider that as rather bad for gameplay). - The old "reverse" flag (var FF bit 0) stays in place. It is toggled when the vehicle reverses. It is not toggled when the vehicle switches between forward/backward driving.
This should keep stuff compatible, while the flag is otherwise pretty useless. - By default only engines (or articulated parts of engines) can lead a consist. Wagons gain a callback which is called for (the last articulated part of) the last wagon of a consist, and decides whether the wagon can act as cab car.
Using dual headed engines might also solve the problem in some cases, but since dual-headedness is somewhat incompatible with being articulated, this cannot be the general solution.