Simple question: Height of tile

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
Wotan
Traffic Manager
Traffic Manager
Posts: 143
Joined: 27 May 2008 22:35

Simple question: Height of tile

Post by Wotan »

I wanted to make a try at modelling some bridges and tunnels. However to do that I need how much the difference in height is on a sloped tile if the tile is 12,5m x 12,5m wide. Anyone who knows?
Coders wanted: Image DSB Litra E in 2cc - Image DSB Litra A in 2cc

ImageUnless stated otherwise all works published by me on these forums is covered by a Creative Commons Attribution Non-commercial share-alike License. Please PM me if you are interested in obtaining a different license.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Simple question: Height of tile

Post by Eddi »

the length and height scales in TTD are not easily comparable. E.g passenger wagons are much too high for their length, or much too short for their height.

I believe the height scale even differs between houses.
User avatar
Wotan
Traffic Manager
Traffic Manager
Posts: 143
Joined: 27 May 2008 22:35

Re: Simple question: Height of tile

Post by Wotan »

I know that. The reason I ask is that I need to know the slope of a sloped tile to make a tunnel or a bridgehead.
Coders wanted: Image DSB Litra E in 2cc - Image DSB Litra A in 2cc

ImageUnless stated otherwise all works published by me on these forums is covered by a Creative Commons Attribution Non-commercial share-alike License. Please PM me if you are interested in obtaining a different license.
maquinista
Tycoon
Tycoon
Posts: 1829
Joined: 10 Jul 2006 00:43
Location: Spain

Re: Simple question: Height of tile

Post by maquinista »

I had the same question when I tried to code a bridge. :roll:
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Simple question: Height of tile

Post by DaleStan »

I'd say to keep the pixel-ratio the same -- if a flat tile is twice as many pixels across, make the height difference on a sloped tile also twice as many pixels.

Obviously, I am not an authority on this matter.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Simple question: Height of tile

Post by Rubidium »

A tile height is 8 pixels high, which means something between 5 meter (height of truck) and 250 (aircraft flight level) meters in real life.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Simple question: Height of tile

Post by Eddi »

problem with tunnel entrances is that tiles are 8 pixels high, while vehicles are 12 pixels high. the game hides this fact with some magic perspective trickery.
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Simple question: Height of tile

Post by michael blunck »

Eddi wrote:problem with tunnel entrances is that tiles are 8 pixels high, while vehicles are 12 pixels high. the game hides this fact with some magic perspective trickery.
According to my experience, a (train) vehicle is 6 (/,|,\) or 7 (_) px high, and there´s no "magic trickery" involved (or needed) with the perspective. They just move under the tunnel portal et voilà.

regards
Michael
Image
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Simple question: Height of tile

Post by GeekToo »

In my Blender models (for grass slope ao) I always use an angle of 16 degrees (steep slope), and that works out rather good after rendering.

If you want a little more background information, here's my reasoning:
In sprite 3982 you can see that the height difference is 8 px for a slope (compare middle left with middle right)

The width of half the sprite is 32 px.
The angle between level tiles and the camera (viewpoint) is 30 degrees -> sin (30) = 0.5 -> y value is half the x value.

That means that a height of 8 px (vertical) corresponds to 8/cos(30) = 9.23 px 'real' height.

So the angle = atan ( 9.23/32) = 16.1 degrees

Applied on the 12.5 m scale ( but be careful, different objects are scaled different in OTTD: a sky scraper is one tile, but a house too)
x = 12.5 * 0.5 sqrt (2) = 8.84

Then y (the height in the real world ) : y/x = 9.23/32. So y = 8.84 * 9.23 / 32 = 2.55 m.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot] and 5 guests