
Hopefully, the devs will like enough to put it in the trunk.

Moderator: OpenTTD Developers
No, it wouldn't; all sprites are remappable. You just have to write the right color-map table(s).jez wrote:One thing that bothers me is that this would require a new, extra file with extra face sprites in it (the ones that are remappable).
Yes. Both ends (.grf files and video output) are 256-color.jez wrote:Does the game use a 256 colour palette?
OK, so why would you want to use those colours to remap facial features? They have nothing to do with a company's colour scheme.DaleStan wrote:"remap2" is the set of colors labeled "Patch Company 2"; "remap1" is the set labeled "Company".
So called because they are the two ranges of colors for which company-color colormaps are readily available, and because Company came before Patch Company 2.
"eyebrows are on the same sprites as eyes using remap1"And bobing meant "as", not "at".
And they don't have to. The CC-blues (remap1) and CC-greens (remap2) are distinct from any company company's selection of what color those should turn into. There are nearly three hundred different standard remapping sprites. Any sprite can be drawn using any of these color-maps, regardless of the company's current color selection(s).jez wrote:So why would you want to use those colours to remap facial features? They have nothing to do with a company's colour scheme.
Eyes use the CC-blues (remap1), and then are drawn with the appropriate color-map. In order to make the eyes and eyebrows be different colors, they have to be different colors in the sprite too, and the easiest other set of colors to use is the CC-greens (remap2), since there are standard color-maps that allow both colors to be modified independently, simply by selecting the correct one."eyebrows are on the same sprites as eyes using remap1"
Ah. So, sounds like you were telling an untruth with:DaleStan wrote:Ah. There's the misunderstanding. Color-mapping is done in the sprite-drawing routines, not in the video hardware. In this way, the same four or eight sprites (one per direction) can be used for all instances of a given vehicle, even though there are sixteen different company colors, and it has to be possible to display a vehicle in any of the colors. Similarly, the same sprite is used for all instances of a town building, even though there are seven possible accent colors.
Is it not as I suggested, and that the ACTUAL output is in high colour, (surely you have to display more than 256 colours at once with colour mapping) even if it is based on an original 256 colour palette that may be modified for some sprites?Yes. Both ends (.grf files and video output) are 256-color.
Is this in video hardware or just coded?The "palette animations" (water sparkles, crossing and runway lights, &c.) are done using the "change the RGB value assigned to a given palette index" system
Ok... I assume you mean something like 'custom colour' by 'CC'. In that case, it's rather unfortunate that that linked page refers to them as 'company (2)'... I can't really think of a more inappropriate name. Should be something like 'Remappable' and 'Remappable 2'. Honestly, why can't people just explain stuff clearly?And they don't have to. The CC-blues (remap1) and CC-greens (remap2) are distinct from any company company's selection of what color those should turn into. There are nearly three hundred different standard remapping sprites. Any sprite can be drawn using any of these color-maps, regardless of the company's current color selection(s).jez wrote:So why would you want to use those colours to remap facial features? They have nothing to do with a company's colour scheme.
... like 0x314? 0x30F? 0x30D? Left-shifted by PALETTE_SPRITE_START? Is there any way I can get a list of these colour-maps, and their identifier values? Which particular map was being suggested for use with the hair? From one of bobingabout's above posts, it looks like you can set 8 custom palette values (presumably in the CC-green slots) then somehow tell the sprite system to remap certain colours to these. Obviously I don't know exactly how this works.In order to make the eyes and eyebrows be different colors, they have to be different colors in the sprite too, and the easiest other set of colors to use is the CC-greens (remap2), since there are standard color-maps that allow both colors to be modified independently, simply by selecting the correct one.
No, on all counts. The colormaps are just 256 byte translation tables. The mapped output has the same palette that input had.jez wrote:Ah. So, sounds like you were telling an untruth with:Is it not as I suggested, and that the ACTUAL output is in high colour, (surely you have to display more than 256 colours at once with colour mapping) even if it is based on an original 256 colour palette that may be modified for some sprites?Yes. Both ends (.grf files and video output) are 256-color.
Code: Select all
if(remap){
for (i=0; i<spritesize; i++)
sprite[i] = trans_table[sprite[i]];
}
draw(sprite);
jez wrote:"palette animations"
Is this in video hardware or just coded?
jez wrote:Ok... I assume you mean something like 'custom colour' by 'CC'.
jez wrote:like 0x314? 0x30F? 0x30D? Left-shifted by PALETTE_SPRITE_START? Is there any way I can get a list of these colour-maps, and their identifier values?
jez wrote:Which particular map was being suggested for use with the hair? From one of bobingabout's above posts, it looks like you can set 8 custom palette values (presumably in the CC-green slots) then somehow tell the sprite system to remap certain colours to these.
jez wrote:Any decent documentation?
I've been vexing about this remapping system for hours, and reading as much about it as I can, and I'm still a little confused (although understanding it better nowDaleStan wrote:And they don't have to. The CC-blues (remap1) and CC-greens (remap2) are distinct from any company company's selection of what color those should turn into. There are nearly three hundred different standard remapping sprites. Any sprite can be drawn using any of these color-maps, regardless of the company's current color selection(s).jez wrote:So why would you want to use those colours to remap facial features? They have nothing to do with a company's colour scheme.
Eyes use the CC-blues (remap1), and then are drawn with the appropriate color-map. In order to make the eyes and eyebrows be different colors, they have to be different colors in the sprite too, and the easiest other set of colors to use is the CC-greens (remap2), since there are standard color-maps that allow both colors to be modified independently, simply by selecting the correct one."eyebrows are on the same sprites as eyes using remap1"
There are also the recolorable browns, but there are no maps that simultaneously change the browns and any other color range, so using the browns would require modifications to the sprite drawing-system to allow multiple color-maps to be specified when drawing a single sprite.
Correct.jez wrote:The gfx engine starts with a sprite that has a 256 colour palette. Assuming we're performing a remap drawing operation, it takes that sprite, and draws it with a pseudosprite's palette, where the pseudosprite's palette values are all numbers between 0 and 255 that 'point' to a palette entry in the 'real palette' (the actual palette that OpenTTD uses for output). That much makes sense.
Because that's the way CS designed it? There's not really any better reason, except that in order to have 16 company colors, each with eight shades, there must be at least 128 colors in the "holy grail" palette for that alone.jez wrote:However, if this is the case, what I'm not understanding is why 16 colours are being reserved in the final palette for remapping. Surely this is unnecessary. I could create a sprite in shades of red, say, and then create a pseudosprite that would map each of those red palette entries to a valid 'real palette' number. Those colours that are used for the company vehicles and get remapped based on your company's colour scheme; they could have been drawn in greyscale and a pseudosprite could remap them to whatever colour. Why only ever remap using 8 shades of blue or green that happen to exist in the 'real palette'??
Yes. This palette is supplied by the game.jez wrote:The only reason the system is the way it is, that I can think of, is a limitation in the graphics system that means all input sprites have to share the same palette. Am I correct with this?
Again correct; if no remap table is supplied, the sprite is drawn exactly as it appears in the file.jez wrote:Also, I'm guessing that those CC and CC2 colours aren't actually reserved, just handy in remap operations. I guess you could draw a sprite that used colours in the CC and/or 2CC range without specifying a remap operation, and it would just output those blue/green colours.
Again correct, but unless there was a chance of using more than one remap table, it's less obfuscating and easier to apply the remap to the input sprite, rather than telling the sprite-drawing system to remap the sprite.jez wrote:Also, I guess you could draw a sprite in shades of red, greyscale, or whatever (that existed in the 'real palette'), and create a pseudosprite that remapped it to valid 'real palette' entries, and the only reason that isn't done is ... tradition?
Again correct. And you are correct in that it's limiting; you're perfectly welcome to draw up a write up a new set of remap tables that perform the remaps you want.jez wrote:Traditionally, those 16 colours are used for remaps, and... because of that tradition, the existing remap pseudosprites mostly remap only those colours?
Users browsing this forum: No registered users and 2 guests