Colour Depth & Zoom Level: Know the Facts

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
Gwyd
Chief Executive
Chief Executive
Posts: 696
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Colour Depth & Zoom Level: Know the Facts

Post by Gwyd » 11 May 2018 16:36

So in the last couple of weeks especially I've seen a lot of people not know the difference between extra zoom and 32bpp. This has frustrated me, so through the next couple of posts I shall explain.

Colour Depth
OpenTTD has 2 colour palettes built in, which were designed to have a variety of colours, for all applications: DOS and WIN. There are 256 colours, hence 8bpp (8 binary bits can make 256 numbers). It has animated colours for fire, flashing lights and company colours built in.
There is another option for GRF developers, which is 32bpp: this allows use of all colours, as well as allowing for use of alpha transparency. However, animated or company colours have to be coded especially. Most GRFs use the game's DOS palette, but there are lots that use 32bpp. This can be independent of zoom level.

Zoom Level
OpenTTD supports 7 zoom levels: 3 outward zoom levels (8x, 4x, 2x), one normal and 2 inward zoom levels (2x, 4x). This is literally the size of the sprites: on normal zoom the length of an 8 length rail vehicle is 32 pixels, going up to 64 on 2x zoom and 128 on 4x zoom. Unless you're pikkabird :wink:. OpenGFX and most GRFs are made in normal zoom, and I'm almost certain there's no GRFs with outward zoom levels however there are quite a few GRFs with inward zoom levels. This can be independent of colour depth.

Image

Top left: normal zoom, using 8bpp DOS palette
Top right: normal zoom, using 32bpp
Bottom left: 4x zoom, using 8bpp DOS palette
Bottom right: 4x zoom, using 32bpp
If I worked on these properly, these could all be coded into the game and work as listed above.
Basic message: 32bpp ≠ extra zoom
Edit: thanks Pyro, I forgot to mention that
Last edited by Gwyd on 11 May 2018 16:55, edited 1 time in total.

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 696
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Colour Depth & Zoom Level: Know the Facts

Post by Gwyd » 11 May 2018 16:46

What does this mean for GRF devs? Whats the benefit of each?
Well, I briefly looked at this in my previous post, but this is how it applies in GRF development.
Disclaimer: this is how it works for NML, m4NFO and NFO may well be different
8bpp normal zoom sprites are the only sprites that are defined as sprites. 32bpp sprites and extra zoom sprites are defined as alternative sprites. The game with default settings will always prioritise sprites with the correct zoom for the viewpoint and 32bpp over 8bpp, unless the blitter is changed.
The practicalities of using extra zoom sprites are:
Much bigger file sizes (this usually doesn't matter)
Different alignments. There's a good guide to working this out https://newgrf-specs.tt-wiki.net/wiki/N ... zoom_level
The practicalities of using 32bpp sprites are:
The file does not need to be palettised
The "transparent" blue is not used: acutal alpha is
Each company colour has it's own sprite or mask, so is coded differently to 8bpp cc

User avatar
Pyoro
Tycoon
Tycoon
Posts: 2470
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Colour Depth & Zoom Level: Know the Facts

Post by Pyoro » 11 May 2018 16:48

Well, don't know how crucial this really is, but if we're talking about it -
https://newgrf-specs.tt-wiki.net/wiki/P ... oordinates
There's a DOS and a Windows palette. While I never counted, most GRFs probably use the DOS palette, which seems perhaps counter-intuitive.

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 696
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Colour Depth & Zoom Level: Know the Facts

Post by Gwyd » 11 May 2018 16:53

The final post: my opinion. You can ignore this one.
Colour depth
Personally, I prefer to use 8bpp: it's easier for styles to fit with each other, since they are using the same shades and I don't have to think up colours and get it wrong. Additionally company colours is much easier. Also having to mess about with alpha, for me, can just become tiresome. I still use 32bpp occasionally for when I need transparency, or better colour definition, but that's quite rare.
Extra Zoom
I just don't like this. I don't know why really. To me it contrasts harshly with the original style of the game. Also since it's hardly easy to draw that many pixels (at 4x zoom, anyway) people tend to render these with 3D models. I feel that a lot of the time, this leaves the sprites lacking character, and having large swathes of the same colour. This is however improving, so we'll see. I very much doubt I'll ever use extra zoom.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5523
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Colour Depth & Zoom Level: Know the Facts

Post by wallyweb » 17 Jun 2018 20:52

Gwyd wrote:It has animated colours for fire, flashing lights and company colours built in.
and water, and some brown shades used, I think, by one of the default industries . :D

Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ragin1_ and 12 guests