ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Colors: Difference between revisions

From ModEnc
Jump to navigation Jump to search
Crimsonum (talk | contribs)
Un-Deezire'd, rewritten and updated with latest info.
Crimsonum (talk | contribs)
mNo edit summary
Line 67: Line 67:
=== Remap ===
=== Remap ===


Most buildings and units in the game have color areas in their art that are remapped according to the owner house's [[color]]. These areas consist of colors #16–31 in the {{tt|UNITSNO}}, {{tt|UNITEM}} and (in RA2) {{tt|UNITURB}} [[palettes]], represented by a gradient of red.
Most buildings and units in the game have color areas in their art that are remapped according to the owner house's [[color]]. These areas consist of colors #16–31 in the {{tt|UNITSNO}}, {{tt|UNITEM}} and (in RA2) {{tt|UNITURB}} [[PAL|palettes]], represented by a gradient of red.


=== UI & text ===
=== UI & text ===
Line 73: Line 73:
Several color IDs and/or indexes in this section are hardcoded for various UI and text elements. Below is a few examples from TS:
Several color IDs and/or indexes in this section are hardcoded for various UI and text elements. Below is a few examples from TS:


{|class="wikitable sortable"
{|class="wikitable"
!Type
!Type
!Value
!Value

Revision as of 21:51, 26 November 2021

This section contains a list of colors used for various purposes in the game, most notably to differentiate various players (Houses) from each other.

Color format

Each color entry has a unique name identifier followed by three values representing the hue, saturation and value of the color expressed in bytes (0–255). The value component specifies the maximum brightness allowed for the color as the color spread is generated. Hue remains constant. Saturation curves through color space as the value component changes so that darker colors become more saturated.

Structure

The game forms an internal table of colors from the color entries in this section according to the order in which they are listed. When populating the color table, the game creates two instances of every color: one for remap, and another for UI and text elements. The former constitute odd-numbered indexes in the color table, while the latter take up even-numbered slots. This is supported by the following developer comment in rules(md).ini:

;gs note to coders, these entries are all doubled, so ColorSchemes[5] is White, not 2.

More colors can be freely added to this section, as long as they have unique names.

Multiplayer colors

Player colors available in multiplayer are hardcoded to certain indexes (not IDs) in the internal table. Below is a list of these indexes and their respective colors. The multiplayer color index determines the order in which the colors appear in the multiplayer dialog.

Index (TS/FS) Index (RA2/YR) Multiplayer Index ID
3 3 0 Gold
21 11 1 DarkRed
27 13 4 Orange
33 15 7 Magenta
39 17 6 Purple
47 21 2 DarkBlue
55 25 5 DarkSky
73 29 3 DarkGreen

Uses

Remap

Most buildings and units in the game have color areas in their art that are remapped according to the owner house's color. These areas consist of colors #16–31 in the UNITSNO, UNITEM and (in RA2) UNITURB palettes, represented by a gradient of red.

UI & text

Several color IDs and/or indexes in this section are hardcoded for various UI and text elements. Below is a few examples from TS:

Type Value Hardcoded for...
Index 0 UI top bar text, pip text
ID LightGold Closing credits text
ID LightGrey Neutral & Special 0House color, cameo "on hold" status and queue count
ID Grey Default text print & gadget color and MP debug text print
Index 14 Waypoint number
ID Red Map lighting
ID Green Map lighting, loading screen progress text, tooltips, Dropship loadout and ingame menu version text
ID LightBlue Sidebar icon "ready" status
ID Blue Map lighting


Bugs/Side-Effects/Unexpected Limitations

Hardcoded color selection menu

While the color values are freely editable, there are issues with the color displayed in the color selection menu in both Tiberian Sun and Red Alert 2. In TS, the color names in the color selection menu are hardcoded; editing the values associated with a color will not change the name of the color as it appears in the menu, although it will alter the color the text is displayed in. For example, editing DarkGreen into a brown color tone will result in the color selection menu containing a brown-colored text reading "Green", which can be selected in order to have the respective house play with a brown color in the acctual game.

Red Alert 2 has a distinct, but similar issue in the color selection menu. Instead of colored names, RA2 uses little colored squares representing each available color. However, the color of these squares is independent from the actual in-game color values. In other words, if the color values are changed, the colored square in the menu will not change its color to reflect the new values - it will instead keep displaying its default color, which may not correspond to the new color that the option it represents has been changed into.

Objects displaying through shroud

The Tiberian Sun Client and its derivatives allow modders to use any of the colors listed in this section as player colors by referring to the game's internal color table. However, care should be taken, as using even-numbered color indexes results in the player objects clipping through shroud (as demonstrated in this screenshot). This is because even-numbered colors are reserved for UI and text elements, so they must, by design, ignore any alpha layers like the shroud. See [#Structure] for more information.

See Also