Page 1 of 1

NewGRF Palette Issues - maybe?

Posted: 10 Dec 2022 20:50
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?

Re: NewGRF Palette Issues - maybe?

Posted: 11 Dec 2022 06:00
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.

Re: NewGRF Palette Issues - maybe?

Posted: 11 Dec 2022 08:12
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.

Re: NewGRF Palette Issues - maybe?

Posted: 11 Dec 2022 09:55
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

Re: NewGRF Palette Issues - maybe?

Posted: 11 Dec 2022 11:56
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:

Re: NewGRF Palette Issues - maybe?

Posted: 11 Dec 2022 13:07
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.