NewGRF Palette Issues - maybe?

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

Moderator: Graphics Moderators

Post Reply
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

NewGRF Palette Issues - maybe?

Post by wallyweb »

Some time ago I was able to successfully craft some 8bpp water tiles.
Now I have a new project where I need some water tiles, but the water is now in shades of pink. Global warming? I think not.

Some time ago I was using the Windows palette.
More recently I switched to DOS to get more greys.
Thinking this might be the problem I revisited the NewGRF Palettes page.
There the Windows water cycle co-ordinates were moved for the DOS palette.
So I used my eye dropper tool to get the number for one of the water cycle colours.
It returned the number of one of the pink tiles.
Upon further checking, it would seem that the DOS water colours have been moved to match the Windows co-ordinates.
Has there been a change to the palettes that I am not aware of?
If yes, is there a .pal file available?
Or, is this a bug that has been introduced into OpenTTD?
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewGRF Palette Issues - maybe?

Post by wallyweb »

The image below illustrates the problem.
The block on the left is a print screen of the DOS palette that I use. It is generated by my image editor: i.mage.
The middle image is a sprite I created to illustrate and test the problem.
The block on the right is from a full zoom screenshot of the in-game image generated by my sprite.
Attachments
8bpp DOS Palette Issue.png
8bpp DOS Palette Issue.png (2.81 KiB) Viewed 1395 times
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: NewGRF Palette Issues - maybe?

Post by PikkaBird »

Is your newgrf using the wrong palette in-game? Does toggling the palette in the newgrf window fix it?

I'm reasonably sure the answer to your questions are no, there hasn't been a change, and no, there isn't a bug.
User avatar
Quast65
Tycoon
Tycoon
Posts: 2661
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: NewGRF Palette Issues - maybe?

Post by Quast65 »

If toggling the palette ingame fixes it, then here is info about the code to add, so that a player doesnt have to change the palette each time him/herself.
https://newgrf-specs.tt-wiki.net/wiki/A ... PALS.22.29
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewGRF Palette Issues - maybe?

Post by wallyweb »

PikkaBird wrote: 11 Dec 2022 08:12 Does toggling the palette in the newgrf window fix it?
That's it. Worked like a charm. Thank you. :D :bow:

Quast65 wrote: 11 Dec 2022 09:55 ... then here is info about the code to add, so that a player doesnt have to change the palette each time him/herself.
https://newgrf-specs.tt-wiki.net/wiki/A ... PALS.22.29
Action14! I should have known! Now I do! Thank you. :D :bow:
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewGRF Palette Issues - maybe?

Post by wallyweb »

And the culprit is ...
ME!

Look what I found ...

Code: Select all

"B" "PALS" \w1 "W"
and the fix is ...

Code: Select all

"B" "PALS" \w1 "D"
A change in career from Windows to DOS without reviewing my code for the obvious.
Cut-And-Paste has it's advantages but there are dangers too.
Lesson (re)learned.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 14 guests