Station tile height proposal

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Station tile height proposal

Post by peter1138 »

To permit bridges over station tiles, we need to know the height of the station tile to avoid graphic collisions. We can include this for the default station graphics but for custom stations this needs to be provided by the author. Therefore I propose this:

Code: Select all

Define station heights (1B)

Size | Name | Meaning
B*   | num  | Number of different tiles supported
V    | data | Height in tile levels for this station tile

A height of 0 is a special-case meaning that no bridge can be above this station tile. If this property is not defined then no bridge can be above any of this station's tiles.
Because the station doesn't exist when testing the area for bridges, callback 14 is not tested, so only tiles 0-7 are valid. For consistency, callback 14 is not tested when building bridges over stations either.

In addition it may be useful for a station tile to test if it has a bridge above in a VarAction2. This will be a byte value specifying the height of the bridge above the tile, or 0 if there is no bridge. Could be a standalone variable or incorporated into an existing one with free bits.

Anything else?
He's like, some kind of OpenTTD developer.

maquinista
Tycoon
Tycoon
Posts: 1812
Joined: 10 Jul 2006 00:43
Location: Spain

Re: Station tile height proposal

Post by maquinista »

Thanks, nice idea.

I was planning to create a small GRF file with some buffers as tiles, because I like to add buffers at the end of my stations, but sometimes I'm limited between two bridges.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]

michael blunck
Tycoon
Tycoon
Posts: 5877
Joined: 27 Apr 2005 07:09
Contact:

Re: Station tile height proposal

Post by michael blunck »

petern wrote: [...]

Code: Select all

Define station heights (1B)

Size | Name | Meaning
B*   | num  | Number of different tiles supported
V    | data | Height in tile levels for this station tile

A height of 0 is a special-case meaning that no bridge can be above this station tile. 
If this property is not defined then no bridge can be above any of this station's tiles.
Because the station doesn't exist when testing the area for bridges, callback 14 is not tested, so only tiles 0-7 are valid. For consistency, callback 14 is not tested when building bridges over stations either.
What exactly means "Number of different tiles supported"? And in "so only tiles 0-7 are valid", are you refering to TTD "tile *types*"? In what system of units is "height " being measured?

regards
Michael
Image

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: Station tile height proposal

Post by peter1138 »

michael blunck wrote:What exactly means "Number of different tiles supported"? And in "so only tiles 0-7 are valid", are you refering to TTD "tile *types*"? In what system of units is "height " being measured?
Yes, tile types, which is limited to 0-7. Therefore the passing the number tiles isn't strictly necessary but I added it as it would mean the spec doesn't need to change if that number ever changes, or if part of the station spec ever gets used for non-rail stations.

Units are basic height levels, not pixels or any imaginary scale. Building a normal bridge (with its own ramps) on flat land above a station would be 1 height level.
He's like, some kind of OpenTTD developer.

michael blunck
Tycoon
Tycoon
Posts: 5877
Joined: 27 Apr 2005 07:09
Contact:

Re: Station tile height proposal

Post by michael blunck »

petern wrote: Yes, tile types, which is limited to 0-7. [...]
OK. So, in "V | data | Height in tile levels for this station tile" the height levels for those tile types are being specified, ordered from type = 0 to type = 7 (assuming this range for the time being)?

regards
Michael
Image

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: Station tile height proposal

Post by peter1138 »

michael blunck wrote:OK. So, in "V | data | Height in tile levels for this station tile" the height levels for those tile types are being specified, ordered from type = 0 to type = 7 (assuming this range for the time being)?
Yup, exactly that. I wrote it badly :-)
He's like, some kind of OpenTTD developer.

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: Station tile height proposal

Post by peter1138 »

And a good example of why this feature would default to deny:
Plartburg Transport, 11th Oct 5028.png
Plartburg Transport, 11th Oct 5028.png (46.44 KiB) Viewed 1728 times
He's like, some kind of OpenTTD developer.

michael blunck
Tycoon
Tycoon
Posts: 5877
Joined: 27 Apr 2005 07:09
Contact:

Re: Station tile height proposal

Post by michael blunck »

Interesting work on "bridges over stations". BTW, what´s the current status with work on trigger re-randomisation for stations?

regards
Michael
Image

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: Station tile height proposal

Post by peter1138 »

Hmm, custom tile layouts (callback 24) throw a spanner in the works, as it can't be tested until the station is partially built, which is obviously too late.
He's like, some kind of OpenTTD developer.

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: Station tile height proposal

Post by peter1138 »

Hmm, possible solution is to disallow CB24 if the heights specified are not all the same. If they're all the same then the custom layout doesn't make a difference.
He's like, some kind of OpenTTD developer.

michael blunck
Tycoon
Tycoon
Posts: 5877
Joined: 27 Apr 2005 07:09
Contact:

Re: Station tile height proposal

Post by michael blunck »

petern wrote:Hmm, possible solution is to disallow CB24 if the heights specified are not all the same. If they're all the same then the custom layout doesn't make a difference.
I´d be interested in how much CB24 is in use at all. I don´t think it´s of much use for larger sets.

regards
Michael
Image

User avatar
Zephyris
Tycoon
Tycoon
Posts: 2831
Joined: 16 May 2007 16:59

Re: Station tile height proposal

Post by Zephyris »

Just wanted to say this looks like a great feature in progress... I look forward to anything that might come out of it :)

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: Station tile height proposal

Post by peter1138 »

michael blunck wrote:I´d be interested in how much CB24 is in use at all. I don´t think it´s of much use for larger sets.
Indeed, most sets use CB14 instead. Notably it is used by some of the stations in ISR, and some amusingly also use RandomAction2s, which is why it can't be tested in the pre-build stage.
He's like, some kind of OpenTTD developer.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 8 guests