Realistic Train Reverse

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Pelsikim
Engineer
Engineer
Posts: 1
Joined: 17 Aug 2015 21:13

Realistic Train Reverse

Post by Pelsikim »

Hello,

This suggestion has been put forward here and here with no progress. I'm looking at a seamless experience from the user perspective (as long as he designs the stations/surroundings accordingly, with warnings popping if train is forced to go backwards).

From a development perspective these should be the milestones:
1. "Disallow train reverse" option should be taken to the letter (or add a third option), with some speed constraints when reversing (maybe simulating it with a 3-4x load factor?)
2. The bulk: when the train needs to reverse at station the locomotive splits, heads to the other end through a different lane. Pathfinder should be modified to allow "zig zagging" around the station.

This will open up new possibilities to implement in any order, like:
[*]Having idle locomotives in depots ready to pick up the train in the other direction. Should also improve servicing.
[*]Using the same loco for multiple wagon sets. For example, while a wagon set waits to be loaded, another one is picked up, alternating. This will require user commands.
[*]Ability to pick up multiple wagon sets, using the train as a stack with push/pop like user commands (pick up that/drop at that station, generalisation of previous point).
[*]Leaving idle helper locos at the base of a steep hill. Instructing them to pick up any train arriving at a given station up the slope then returning back alone.

Something about me: I've done quite a bit of Java programming and have a lot of free time. On the other side, I never worked on open source and probably need some help.

I will start by reading the code and experiment. I'd like to know what you think about this, help and suggestions are more than welcome.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: Realistic Train Reverse

Post by Eddi »

if you're new to programming on this project, you probably want to tackle a bunch of smaller problems first, and not a huge task like this with many barriers and possibilities of dead ends.

also, you should try to break down this project into smaller parts.

of the things you listed, the smallest would probably be the time penalty for reversing in stations.

then you could try to check out how to rearrange the vehicles during reversing. (without moving the engine separately around the map) keep in mind that this may cause some incompatibilities with NewGRFs

in another step you can try to figure out how to actually move the engine from one end to the other (you need special cases here for when there are multiple engines on the same sides, or engines on opposite ends)

and if you're done with that you can check how to give orders to invdividual engines so you can rotate them between depot and trains.

you might actually never get done with all of these tasks, but even halfway through might be a success.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 43 guests