Sprite Pallette Issues

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
SquireJames
Tycoon
Tycoon
Posts: 1863
Joined: 07 Aug 2004 11:56
Skype: squirejames5
Location: Stoke-on-Trent
Contact:

Sprite Pallette Issues

Post by SquireJames »

Hello

Well, I was trundling along through the early 30's in my latest game, and I wanted to replace the early UKRS carriage with a teak one i'd drawn. However, I knew the teak one was out of pallette, but the maroon Mk.1 i'd done for the BR Set was done according to the pallette given in their colour standards thread.

After lengthening the sprite for the longer UKRS carriage, I packed up the grf, and well disaster. It came out purple.

After messing about with colour tables (and managing to load swatches in Photoshop, good for future sprites but not these ones) I somehow got my carriage in the same weird pallette as UKRS appears in. Now, the _ view works. Success I thought, so I went to try and do the same to my teak carriages. However, nothing I did actually changed it.

So, heres the issue. If I made my carriage to the pallette given to me by the BR Set (which is identical to the pallette I extracted from UKRS, so its correct) then why does it have to appear so strange to work right? Am I encoding/decoding it badly?

Image
Image
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Sprite Pallette Issues

Post by FooBar »

Apart from using the colours from the palette, you also have to have these colours in the right order in that palette.

The easiest way to do it is to decode a grf, copy the pcx file from it and paste your new sprites in it. Any self-respecting graphics program should respect that palette and leave it the way it is.

Now when it comes to decoding and encoding a grf, you should consider the -p switch option. If you want to encode a Windows grf, it's mandatory to use that switch because else grfcodec will assume the dos palette. You can use this switch option like so: grfcodec.exe -d -p 2 nameofgrf.grf or for encoding: grfcodec.exe -e -p 2 nameofgrf.grf

The following is equally important:
Decode in Dos mode, draw in dos mode and encode in dos mode, OR Decode in Windows mode, draw in windows mode and encode in windows mode. Don't mix it up! The palette isn't saved with the grf, so the game (and grfcodec for that matter) assumes you have used the right one!
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Sprite Pallette Issues

Post by michael blunck »

Whatever your real problem is, you´re another one with a buggy palette (wonder where they all come from ...).

See http://www.tt-forums.net/viewtopic.php?p=708678#p708678

regards
Michael
Image
User avatar
Ameecher
Tycoon
Tycoon
Posts: 11919
Joined: 12 Aug 2006 15:39
Contact:

Re: Sprite Pallette Issues

Post by Ameecher »

The trouble that we have is that there is a thread with a post in that needs to be corrected, I should really tell csuke/Dave and get them to remove it really.
Image
User avatar
SquireJames
Tycoon
Tycoon
Posts: 1863
Joined: 07 Aug 2004 11:56
Skype: squirejames5
Location: Stoke-on-Trent
Contact:

Re: Sprite Pallette Issues

Post by SquireJames »

Foobar, your a genius! I guess it was decoding in DOS, hence the weird colouring.

With the -p switch, everything looks so much better, and I dare say i won't even need to change the pallette now (well, might need to, but not to the same extreme)
Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot] and 11 guests