Notes on Setting Habitat Patterns and Colors - frandallfarmer/neohabitat GitHub Wiki
Habitat graphics 2-bits per pixel: Blue, Black, [Skin], and [Wild]
[Skin] is usually Light Red, and can only be changed locally on the client under user control. ALL [Skin] pixels are the same color.
[Wild] uses the color of the underlying 8x8 character-color ram - so anything using [Wild] pixels must be aligned on a cel boundary position, and sized in a multiple of 8, or be positioned against Blue, Black, or [Skin] in order not to bleed-color when rendered.
Habitat Patterns
Habitat Objects can have a texture (made of Blue/Black/[Skin] pixels) OR a Color. NOTE: Only non-portable objects should have colors. Portable objects should only have Patterns (shown below.)
The pattern/color information uses 5 bits of the orientation property byte, as follows:
PATTERN_BITS = 0b01111000;
COLOR_BITS = 0b01111000;
COLOR_FLAG = 0b10000000;
- For a pattern:
patternNumber * 8 - For a color:
colorNumber * 8 + 128NOTE: Rendering with C64 color can BLEED. Do not use on portable objects, heads, or avatars.
Avatar Patterns
Avatar cels may only be patterned. NO COLORS. There are three pattern zones: arms, legs, and body.
The "customize": [0,1]" field contains the pattern nibbles for these zones.
customize[0] = bodyPatternNumber * 16 + legPatternNumber
customize[1] = armPatternNumber
[Wild] Colors
See: C64 standard colors.