Rail Type related queries

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

Moderator: Graphics Moderators

Post Reply
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Rail Type related queries

Post by OzTrans »

Rail type property 0x10 : Rail type flags have a bit setting (3) :

Enable use of precombined overlay sprites

What does that setting actually do ? How does that work ?
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Rail Type related queries

Post by Wahazar »

Good question. Generally, if there are any joints/crossings etc in openttd, just two or more overlay are drawn on each other. It doesn't looks nice, especially if more detailed sprites are in use.
Above options allow to prepare separate sprites for all possible track combinations.
Now my question: anybody is using this? Any example?
User avatar
jfs
Tycoon
Tycoon
Posts: 1743
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Rail Type related queries

Post by jfs »

sprite_combining.png
sprite_combining.png (10.29 KiB) Viewed 3336 times
This is what usually happens with "complex" combinations: The game takes a ground sprite (track bed) and places track sprites over it.

With that flag, you can instead have specially drawn sprites for every possible track combination, which will avoid some slightly weird overlapping that happens.

There are 63 regular track combinations possible, including those which are just a single piece of track on the tile. Of those, the regular baseset has just 9 drawn, the rest are made by combining pieces in the above way.
There are also special sprites for track on sloped ground, I haven't included those in that count.
See the sprite sheet here in OpenGFX: https://github.com/OpenTTD/OpenGFX/blob ... nfra06.png
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1674
Joined: 04 Mar 2005 01:07

Re: Rail Type related queries

Post by OzTrans »

Nice ...
McZapkie wrote: 24 Sep 2021 22:45... Now my question: anybody is using this? Any example?
I don't think so, but I will. It should be perfect for my Pipeline Network ...

One more thing, apart from using Action-3 'Cargo'-Type 0x0C, are the Underlays [0x02] (and PBS Overlays [0x01]) still being drawn as normal or do they have to be included with the track bits in 0x0C.

A sample ...
CanBase - NG Rail Tracks.png
CanBase - NG Rail Tracks.png (50.92 KiB) Viewed 3218 times
CanBase - Narrow Gauge Rail System in temperate snowy landscape.
[workers still need to lay rails on junctions]
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 4 guests