Tile based measurements

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Tile based measurements

Post by supermop »

Hello,

Would it be possible to add an additional unit set as an option for in game display? As the metric and imperial speeds are intuitive, but fairly abstract when it comes to the distance a vehicle covers relative to the in-game time, I have often wanted to be able to switch to an approximate 'tiles per tick' or 'tiles per day' measurement when timetabling traains, so as to get a rough idea, for example, how much faster a new locomotive will traverse a section of track before I start trying to fit it into the existing traffic.

I'm not sure what would be involved here, but I guess it would need a coefficient to multiply the existing internal units by (I think these are miles/mph?). There is probably a more accurate way to do this, but would be possible to get a good idea by running a 100mph locomotive at speed between two waypoints, 100 or so tiles apart, on flat, straight track, and taking the average time in ticks to complete over several runs.

Thoughts?

Best,
Nommy
Engineer
Engineer
Posts: 30
Joined: 19 Sep 2010 11:31

Re: Tile based measurements

Post by Nommy »

If there was a unit added, it might be useful to make it 1/3 of a tile since this has meaning for going both straight and diagonally. E.g if 1/3 tiles were called km, a straight tile would be 3km and a diagonal half tile 2km exactly. Actually, the pathfinder costs should probably be 66 and 99 instead of 100 and whatever the one for diagonal is, as this is proportional to the time it takes to cover those distances.

If you can be bothered, you can work out how many ticks it takes to travel 1 straight tile by: ticks = 2048 / speed
when speed is in km/h. So a 128km/h train would take 16 ticks to travel 1 tile, and crossing tiles diagonally would take 4/3 as long. I guess if you wanted to know how many ticks for 100 tiles, just divide 204800 by the speed (km/h). I dunno for mph though.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Tile based measurements

Post by Eddi »

Nommy wrote:E.g if 1/3 tiles were called km, a straight tile would be 3km and a diagonal half tile 2km exactly.
that's neither true "realistically" nor within the game logic.

in "real" [aka euclidean] geometry, diagonal half tiles would be around 3*0.7=2.1km

and the game treats diagnoal half tiles as 0.5, 0.7 or 1.0, depending on which part of the game you are looking at. vehicle movement seems to go for the 0.5 variant, the pathfinder treats it like the 0.7 variant, and vehicle payment takes the 1.0 variant.
Nommy
Engineer
Engineer
Posts: 30
Joined: 19 Sep 2010 11:31

Re: Tile based measurements

Post by Nommy »

Eddi wrote:
Nommy wrote:E.g if 1/3 tiles were called km, a straight tile would be 3km and a diagonal half tile 2km exactly.
that's neither true "realistically" nor within the game logic.
...
It's easy to see for yourself that what I said is correct. Just build a straight track 40 tiles long and a diagonal one next to it 30 tiles long (measurement tool-tip), start 2 trains at the same time and you'll see they reach the other end simultaneously. Using those example units both tracks are 120km.

Whatever numbers you see in the code, the result is that a diagonal half-tile is exactly the same as 2/3 of a straight tile for train movement, and perhaps the other vehicle types also.
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: Tile based measurements

Post by supermop »

well regardless of the exact ratio of diagonal to straight, I think that the implementation of a direct conversion of the existing units should be possible. The tile per tick measurement would just be a ratio of mph or kph, corresponding to number of tiles covered in one tick by a train on straight track. Other vehicles do not move diagonally in the same way as trains, so it might be sufficient to just approximate diagonal measurements of tracks. If we have a firm tile/tick speed unit that is shown to be correct on straight track, and a train moving at a stated speed of 1 tile/tick on a section of diagonal track takes 80 ticks to traverse the section, we can say that the diagonal track is equivalent to 80 tiles long. This would be most relevant if/when using a measurement tool.

Best,
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: Tile based measurements

Post by Wolf01 »

I made a patch... not enough luck... patch abandoned.
Feel free to fix and improve it: http://www.tt-forums.net/viewtopic.php? ... re#p889040
aplaneisfinetoo
Engineer
Engineer
Posts: 16
Joined: 17 Sep 2010 18:59

Re: Tile based measurements

Post by aplaneisfinetoo »

A easier approach which would be helpful to the community and get the job done roughly well would be to update the wiki pages with this information on all the vehicles.

it wouldn't be as nice as a in game solution but I'm on the wiki so much anyway it feels like part of the game

Also while we are at it why don't we calculate the engines approximate ideal max loads?


*waits for some one to come in with a vague argument why we shouldn't bother.*
There has to be some kinda of useful trade off between acceleration and load carried I don't care if you can put two mag lev engines on a TL2 train and make it zip around its a waste. If you guys want to see vehicles going fast take the restraints off of jets.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Tile based measurements

Post by Alberth »

aplaneisfinetoo wrote:Also while we are at it why don't we calculate the engines approximate ideal max loads
I'd be in favor of making a wiki page about that.
It makes a huge difference whether you have flat tracks, or with some hills, or even mountains. It also makes a difference which type of acceleration you use.

I can imagine a table with speeds for a number of situations (precisely described, so other users can verify the information, and/or add new entries for their favorite engine set).
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 5 guests