May 03, 2024, 02:12:30 AM

Username
Password

  Show Posts
Pages: [1]
1  Modifications / 2D Sprites / Re: Question about 4 bit 8 bit etc on: April 08, 2014, 09:55:23 PM
The result of the adding of all colours is the number if colours that the game screen allows?

this is MESSY but the right example is in dark omen, the game has images with 256 colours, however in the game, when you play you have, the colours of each unit, the colour of terrain textures etc etc and that is a lot more of 256 colours? it doesnt matter how many objects are being displayed as long as each of them has less than 256 colours.

Maybe I'm a bit late here, but I will answer.

There is one palette of 256 (or 16) colors for entire screen. All sprites, textures, menus and other stuff just choose needed colors from it. And hence, sprites must be compatible with this global game palette. If you insert a sprite which was drawn for another palette then all colors for this particular sprite will be screwed up. If you put a new sprite, colors are not added to the screen palette. The sprite is forced to use colors which are already there. Each color can be shared by different sprites unlimited number of times.

The game can also change palettes if programmed to do so. But it can set only 1 palette at a time. So, different sprites can possibly use different palettes, but they can not be displayed at the same time. X-Com series games were made like this: they had strategic mode and tactical mode. Sprites had different palettes, but they were sorted out: there were sprites for strategic mode only and others - for tactical mode only.

The game also can replace colors in the sprite if programmed to do so. Strategic games such as CnC, Warcraft and others colorize units automatically depending on player choice. One color (usually, orange) is marked as replacable by developers. The game replaces it by color chosen by player.

But there is also so-called "truecolor" system with no palette where all sprites and textures store RGB color components for for each pixel. All images beginning from 15 bits per pixel and higher are truecolor. In this particular case a pixel takes 2 bytes (16 bits), 5 bits for red, 5 bits for green, 5 bits for blue, 1 bit is unused. Each component can be from 0 to 31. Number of combinations is 32767. This is number of colors which is possible to display at the same time. 16 bits per pixel is the same, but unused bit is moved to green. So, green component has 6 bits and can be from 0 to 63. But it does not mean that green is brighter. 63 for green means the same brightness as 31 for others, but green halftones are smoother. 24 bits per pixel is 8 bits for each color component. It is the most widely used system for now.

but things look like 8.. the main menu maybe is 16 colour? and ... the main pallete, how many colours may have? :0
Your screenshot has 16 colors: they are black, white, 3 shades of blue as well as some shades of green, brown and violet. Must be 16 colors total. This is the answer. Palette has 16 colors only, not more. Each pixel is coded by 4 bits and can hold numbers from 0 to 15 which represents number of color in palette.
Pages: [1]