Palette talk

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Gizmog
Metal King Slime
Posts: 2622
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

Weird! I was rooting through some of my random weird files earlier and found a copy of that DB32 palette. I don't remember ever using it or seeing it before.. and here it is again! Wild
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

0ion9 wrote:Ah, that would be my mistake, I thought we were using the premise that a palette was per spriteset.
Per-spriteset local or master palette? That could be another option.
The idea is that if importing an 8 bit image and the master palette is identical, then you already have the palette you want, and aren't going to want to change it.
Oh okay, I was thinking of a 24bit image that you want to import paletted, and all the colors exist in the master palette.
Oh, my memory failed me. Actually, you are always asked to pick the background colour when importing a 16 colour spriteset or a 24/32 bit bmp as a backdrop or tileset, and never when importing a <= 8 bit bmp as backdrop or tileset. In the later case I wrote:

Code: Select all

   ' Disallow anything other than colour 0 from being mapped to colour 0 to prevent accidental transparency,
   ' and force 0 to be mapped to 0.
Nonetheless, I remember that something in the process confused or surprised even me, not long after I made some changes to it. Possibly because it had simply changed from how it had been for the previous 10 years.
0ion9
Red Slime
Posts: 40
Joined: Sun Aug 02, 2009 7:45 am

Post by 0ion9 »

TMC wrote:
0ion9 wrote:Ah, that would be my mistake, I thought we were using the premise that a palette was per spriteset.
Per-spriteset local or master palette? That could be another option.
Unless the definition of spriteset changes a lot from what it currently is, or if I'm confusing it with frameset, I'd certainly like to register my personal opinion that NOT having it be per spriteset would mostly confuse me
(because in practice, 99% of sprites in a given set would use the exact same palette anyway, so the 1% that didn't would reliably trip me up.).
Per-frame palettes might eventually be nice(if wasteful) for simple things like 'power up' 'frozen' 'burnt' or 'charging' animations, admittedly; but it might be easier, albeit equally wasteful to just specify that canonically, the way to do this is to include colors for this in the palette for that set, and just swap them in (ie. change pixel indices instead).

Well.. maybe I'm straying OT into animation territory a little. I think per-frame palette swapping is more the domain of an animation sequence editor, not really something that is suitable to attach to the base frames being used.
Last edited by 0ion9 on Sun Oct 18, 2015 1:54 pm, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I don't know what you mean by "frameset", a subset of frames in a sprite set which make up a single animation? By spriteset I mean all the frames making up a walkabout set, etc, and all its animations.

Per-frame palettes would make palette swapping more complex (would have to either specify an array of palettes or have default-and-per-frame-overrides) for pretty tiny gain. For the same reason, allowing different spriteset to have different numbers of frames/framesets/animations is also going to be complex, but I think that flexibility would be very useful. (What happens when you change the spriteset of an animating NPC? I think the latest proposal ... which I wrote somewhere (basically, have a frameset-centred view) ... will work OK. How to handle animations is certainly not nailed down yet though.)
User avatar
Sparoku
Metal Slime
Posts: 309
Joined: Tue Jun 18, 2013 3:19 pm
Location: Dairy Queen
Contact:

Post by Sparoku »

Thank you so much for this! I'm gonna have to play around with it! :v:
"One can never improve enough nor should one stop trying to improve."
0ion9
Red Slime
Posts: 40
Joined: Sun Aug 02, 2009 7:45 am

Post by 0ion9 »

TMC wrote:I don't know what you mean by "frameset", a subset of frames in a sprite set which make up a single animation?
Yes, I'm aware this isn't the current state of things but I thought it was being seriously considered at some point.
By spriteset I mean all the frames making up a walkabout set, etc, and all its animations.

Per-frame palettes would make palette swapping more complex (would have to either specify an array of palettes or have default-and-per-frame-overrides) for pretty tiny gain. For the same reason, allowing different spriteset to have different numbers of frames/framesets/animations is also going to be complex, but I think that flexibility would be very useful. (What happens when you change the spriteset of an animating NPC? I think the latest proposal ... which I wrote somewhere (basically, have a frameset-centred view) ... will work OK.
That seems reasonable. My only comment on that is that I think framesets (and animations? not sure exactly what role they play in that picture) should have a symbolic, not directly numeric id. ( a "4-char" id that is actually a 32bit int, like PNG, IFF etc do.). Just to avoid silly 'I want to swap to that spriteset, but it turns out frameset #n means something totally different in that set' problems.
User avatar
Rogissidor
Slime
Posts: 22
Joined: Tue Apr 11, 2017 12:25 pm

Post by Rogissidor »

I had a weird idea. I want something that outputs a predefined layout loosely sorted by color category. The idea is to be sure I get colors for flesh tones, wood, water, metal, and dedicated interface colors somewhere at the bottom (or top). I wrote a prototype script that gives me more random output but I specified red, green, blue, and low saturation sections. Transparency and grayscale output on the top row like BMR's palette (I like that layout). Color ramps have random variation and are followed by a randomly brighter version of the same ramp. TLDR: I want less uniform colors and more uniform layout.

Eventually I'll make a list of all the "materials" in my game and alter the script to include them.
Attachments
PaletteTest.PNG
PaletteTest.PNG (7.4 KiB) Viewed 5392 times
User avatar
Rogissidor
Slime
Posts: 22
Joined: Tue Apr 11, 2017 12:25 pm

Post by Rogissidor »

Now I'm getting somewhere. Color groupings, structured columns, flexible layout. I don't think anyone would actually use these palettes but the script is definitely functional for what I'm trying to do.

Eventually I'll add color-to-color ramps, a user interface, and some contrast/hue post effects.
Attachments
Palette_2.png
Palette_2.png (1.97 KiB) Viewed 5370 times
Palette_1.png
Palette_1.png (1.9 KiB) Viewed 5370 times
Palette.png
Palette.png (1.95 KiB) Viewed 5370 times
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

That looks really cool Rogissidor! "Colour" me interested :p
User avatar
Soule X
Red Slime
Posts: 86
Joined: Wed Sep 19, 2012 4:18 pm
Location: Indianapolis

Post by Soule X »

I forgot about CHGPAL. It's very outdated now and doesn't seem to work correctly (even if you can figure out how to get it to run and convert your palettes to .mas files haha).

This would be a really helpful tool to have as I'm currently in the middle of adjusting my master palette on a nearly finished game and it's looking like a lot of work will be involved.

Mogri's Palette Pal is still an extremely useful tool, if a bit buggy. If you plot specific color points within a ramp and the generate the points in between it can save a ton of time with some really fantastic results.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I expect CHGPAL should still mostly work except it doesn't know about the modern master palette format so can't actually set the new master palette.
Portraits and box borders should work, because only the 16-colour palettes, backdrops and tilesets are changed.

The engine does still save a copy of the default master palette in MAS format in the .rpg, for old utilities.
(Actually I've just noticed a quirk: after you import a new master palette, it doesn't save it as a .mas until you quit and reopen. I'll fix that.)

So to use CHGPAL:
-make sure the existing palette is the default one
-convert the new one to .mas (hint: you could extract it from working.tmp/the rpgdir after setting ti as the default).
-apply chgpal
-import the new master palette in Custom and set it as the default

But it wouldn't be much work to build the functionality of chgpal into Custom itself. We already have the necessary code for doing remapping. (But our remapping code is bad; I would definitely switch to a proper colour-distance algorithm before attempting to remap existing graphics. That's not hard either.)

Edit: oh, I see a bug in CHGPAL. It assumes that all filenames are in all caps. It wouldn't work with .rpg files created since long ago. I can easily fix and recompile it.
Last edited by TMC on Sat May 27, 2017 3:45 pm, edited 3 times in total.
User avatar
Soule X
Red Slime
Posts: 86
Joined: Wed Sep 19, 2012 4:18 pm
Location: Indianapolis

Post by Soule X »

Yeah I tried to use it, had to download vdos and run it from there. Then I had to convert my palette bmp file to pcx and run it through 2mas, also in vdos, to get the mst file. Then I ran CHGPAL, but it didn't seem to do anything. Maybe I made some unnecessary steps; I'm not sure. My understanding from the readme that it was supposed to set the palette and color correction in the new rpg output file. It didn't update the new file and if I set a non-existent file as output that didn't work either.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

As I said, the original CHGPAL is broken.

It only required a small change, so I fixed it and recompiled it for Windows. I also updated the readme and changed the way that it computes colour distance. Still not great, but I believe it should be better than the old way, which applied constants intended for brightness comparison, not colour comparison. I didn't spend time comparing results, but I did test that the program works now (if you import the master palette manually).

You can get it here: http://tmc.castleparadox.com/ohr/chgpal_2017.zip

I still intend to implement this in the engine itself (CHGPAL is still obsolete, and it will stop completely working very soon), with slightly better colour remapping than CHGPAL uses.
Last edited by TMC on Sun May 28, 2017 3:57 pm, edited 2 times in total.
User avatar
TheLordThyGod
Slime Knight
Posts: 218
Joined: Thu May 14, 2015 9:18 pm
Location: Muscle Shoals, AL, USA, Earth, Solar System, Milky Way, Known Universe
Contact:

Post by TheLordThyGod »

I made my first ever original palette for LinearQuest VI, but I made the rookie error of using too many straightforward saturated ramps. I've been reading up on color theory and learning how to use GrafX2 a little better, and my second attempt at a palette is coming along much better. The colors are easier on the eyes and seem to go together pretty well, and I still got ramps of saturated primary and secondary colors in there.
Attachments
Work In Progress Palette
Work In Progress Palette
PALETTENEW1.bmp (713.05 KiB) Viewed 5168 times
...spake The Lord Thy God.
User avatar
Rogissidor
Slime
Posts: 22
Joined: Tue Apr 11, 2017 12:25 pm

Post by Rogissidor »

I'm still working on my script/algorithm thing and I'm actually starting a tighter palette with my game in mind. As I mentioned before, I'm making a list of "materials" and building the palette around that.

Top row is transparency and interface. There's room for a grayscale gradient and 8 more colors. If I do palette transitions for light effects, I just modify the colors below so the interface doesn't dim. Character and environment colors being separated allows me to light characters individually from maps. Once I'm happy with the layout, I can tweak the colors without totally disrupting the graphics already in the game.

So this gives me a great starting point, and I can tweak it as I go to determine the final look.
Attachments
Unorganized Palette
Unorganized Palette
UnorganizedPalette.png (1.66 KiB) Viewed 4923 times
Last edited by Rogissidor on Mon Sep 18, 2017 3:14 am, edited 1 time in total.
Post Reply