Hi, hope you all have been having a nice Christmas.
I've been using some aspects of OTTD, such as the cargo payment rate statistic.
But I've been having issues with it, the fact that road vehicles display speed in MPH or Km/h rather than tiles per day (T/D) which makes it hard to calculate how far a vehicle will go in a day and then extrapolate that to any distance covered at any speed.
Are there any conversion formulas between MPH and T/D?
Conversion between MPH / Km/h and Tiles per Day
Moderator: OpenTTD Developers
Re: Conversion between MPH / Km/h and Tiles per Day
i'm sure that is mentioned somewhere exactly, but what i seem to remember how it works:
- the internal unit is "km/h-ish", which is mph*1.6 (the true conversion factor between mph and km/h is not exactly 1.6, but internally, 1.6 is used)
- for each speed unit, a vehicle makes 2 substeps per tick
- each step has 256 substeps, and each tile has 16 steps (works slightly different on diagonals, i think there you have 192 substeps and 8 steps)
- so a vehicle with 128km/h-ish makes 1 step per tick
- each day has 74 ticks
Re: Conversion between MPH / Km/h and Tiles per Day
I used formula 1 tile = 192 * 16 * 4 / 3 / 2 kmhish*ticks for diagonal line.
So it should be 1 tile/day = 192 * 16 * 4 / 3 / 2 / 74 / 1.6 ~= 17.3 mph
Don't remember what all that 4 / 3 / 2 means but I was following the OpenTTD code when I made it.
So it should be 1 tile/day = 192 * 16 * 4 / 3 / 2 / 74 / 1.6 ~= 17.3 mph
Don't remember what all that 4 / 3 / 2 means but I was following the OpenTTD code when I made it.
Re: Conversion between MPH / Km/h and Tiles per Day
That... Comes really really close to my tests.
The tests were to see how long it would take a train travelling at 343MPH to travel 3430 tiles at max speed (excluding acceleration & deceleration, no breakdowns on completely flat ground), it took 174 days.
Using your formulae, with an addition of converting distance & time into speed (tiles per day) and then converting it into MPH, it comes to 339 MPH, which is really close, within margin.
Thank you everyone who contributed.
The tests were to see how long it would take a train travelling at 343MPH to travel 3430 tiles at max speed (excluding acceleration & deceleration, no breakdowns on completely flat ground), it took 174 days.
Using your formulae, with an addition of converting distance & time into speed (tiles per day) and then converting it into MPH, it comes to 339 MPH, which is really close, within margin.
Thank you everyone who contributed.
Re: Conversion between MPH / Km/h and Tiles per Day
Forgot to actually mention what I used that formula for. You may be interested as well since you're looking into payment rates: https://citymania.org/tools/profit
Who is online
Users browsing this forum: No registered users and 41 guests