VOGONS


First post, by Gagster

User metadata
Rank Newbie
Rank
Newbie

I have been using a program called Aseprite that's on Steam lately to add colors to the Commander Keen 4-6 games running in the source port Commander Genius, by editing extracted tilemaps from those games. While adding more colors to the 16 color tilemaps, I've chosen the VGA 13h palette in Aseprite (the default VGA color palette).

However, as I read in http://www.shikadi.net/moddingwiki/VGA_Palette, VGA games usually had their own custom VGA palettes edited from a total selection of 262,144 colors. The default VGA palette doesn't have all the colors I want, but how can I create a custom 256 color VGA palette that only uses colors from the full range of 262,144 colors, and not by accident use colors not present in the VGA color bank? There's color wheels and such in painting software with RGB values and such, but I have no idea which one of the RGB values are to be found in the VGA color range of 262,144 colors.

Is there a way to ensure that if I find a red color I like, that the exact color is to be found in the VGA range of 262,144 colors, maybe with some kind of online tool or maybe an easy to use software application?

CPU: i7-4790K
RAM: 16 GB
GPU: GeForce GTX 1080
OS: Windows 10 64 bit

Reply 1 of 9, by Oetker

User metadata
Rank Oldbie
Rank
Oldbie

Wouldn't you have to use the exact palette the game uses? Or can you select which palette the game will use? Or does the source port use 24 bit color and you just want to create a custom 256 color palette for authenticity's sake?

Reply 2 of 9, by Gagster

User metadata
Rank Newbie
Rank
Newbie

I can chose whichever palette I would like to chose, but I have to include the 16 EGA colors in my custom VGA palette as the first 16 colors. I would like to create a 256 color palette for authenticity sake (in case of someone would like to use my edited tilemaps in a source port of Commander Keen 4-6 compiled to a proper 256 color MS-DOS VGA version that can run on real hardware).

Link to forum thread on the Commander Genius forum

CPU: i7-4790K
RAM: 16 GB
GPU: GeForce GTX 1080
OS: Windows 10 64 bit

Reply 3 of 9, by root42

User metadata
Rank l33t
Rank
l33t

VGA uses 18 bit color space, i.e. 6 bits for red, green, and blue. This is opposed to the 24 bit color space of your modern graphics cards. The only thing you lose is a bit of fidelity in the graphics. So you might pick any 24 bit color and convert that down to 18 bits later by the use of some tool. Just make sure not to use 256 colors in total.

YouTube and Bonus
80486DX@33 MHz, 16 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & GUSar Lite, PC MIDI Card+X2+SC55+MT32, OSSC

Reply 4 of 9, by Gagster

User metadata
Rank Newbie
Rank
Newbie

So what I gathered of info are; convert a customized color palette from a 24 bit image to an 18 bit image (somehow), and I get values in my palette that are compatible with the color bank of the VGA palette?

Where's my upper limit of colors in the 256 color palette then; 250 colors or something like that? In other words some of the colors have to be black, like in the default VGA 13h color palette?

CPU: i7-4790K
RAM: 16 GB
GPU: GeForce GTX 1080
OS: Windows 10 64 bit

Reply 5 of 9, by root42

User metadata
Rank l33t
Rank
l33t

From what you described above you need to keep colors 0-15 the same as in the default CGA/EGA palette. Colors 16-255 can be arbitrary from your description. But remember: that palette will have to be shared between all sprites, assuming that no clever reallocation of palettes will be happening.

I don't know your sprite editor, but if it can export to PNG you can run the sprites through ImageMagick's convert command and convert them to GIF, which will force them into a format that is pretty much VGA compatible. Or you can use any other tool that converts to GIF, for example. However it might be that your Commander Keen port also uses some different graphics format -- that is something you need to figure out. My main point is: the difference between 18 bit and 24 bit color space is minute to the average observer. It is more important that you stick to the overall 256 (or 240) colors.

YouTube and Bonus
80486DX@33 MHz, 16 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & GUSar Lite, PC MIDI Card+X2+SC55+MT32, OSSC

Reply 6 of 9, by Gagster

User metadata
Rank Newbie
Rank
Newbie

Thanks for the detailed explanation.

Aseprite is able to use any png file as a color palette file, so then I can make a color palette file as a png file, convert it to a gif file to make sure it got the right values for the color bank of VGA and maybe reconvert it back to png again.

I understand that every sprite I make from now on then have to use that exact color palette, and color 0-15 have to the the same as the default EGA palette. I just want to "future proof" my tiles so they can be used even in potential source ports of Commander Keen 4-6 which has the VGA color limit (it would be cool to see a port running on a 486XD2 or something like that in the future, with these tilemaps).

CPU: i7-4790K
RAM: 16 GB
GPU: GeForce GTX 1080
OS: Windows 10 64 bit

Reply 7 of 9, by keenmaster486

User metadata
Rank l33t
Rank
l33t

Interesting, I am working with aesprite right now actually in my attempts to find an editor that gives me the original VGA palette.

Gagster, I like your VGA upgrade of the Keen tiles.

World's foremost 486 enjoyer.

Reply 8 of 9, by Gagster

User metadata
Rank Newbie
Rank
Newbie

Thanks, I'm not entirely satisfied myself with my VGA tilemaps, that's why I plan to add more colors from the VGA color bank to get the red- and turquoise colors I'm missing (some of the levels in Keen 6 needs more color to get rid of the dithering on my tilemaps, and I'm not happy with some of the colors I had to chose from).

A bit off-topic, but keep an eye for future updates for CGenius if you enjoy the Commander Keen games; I've posted over 40 topics in the Gitlab Issue tracker there (bugs and suggestions) in the last month or so of my findings while testing my VGA tilemaps.

CPU: i7-4790K
RAM: 16 GB
GPU: GeForce GTX 1080
OS: Windows 10 64 bit

Reply 9 of 9, by VileR

User metadata
Rank l33t
Rank
l33t

Two very simple options:

1. If editing the palette in a modern tool, ensure that the each of the R, G, and B values is always a multiple of 4. If the palette is later mapped from 8 bits/channel down to 6 bits/channel (VGA), this ensures that the two bits you're giving up are always zero bits - no loss of precision.

2. Just edit the palette in a real DOS/VGA tool like DeluxePaint or Autodesk Animator.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]