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

Difference between revisions of "Colors"

From ModEnc
Jump to: navigation, search
 
(Fixed index/ID terminology)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DeeZireInclusion}}<br />
+
{{WrongTitle|[{{PAGENAME}}]}}
This section contains the various colors available to be used when applying the 'remap' logic and usually refer to the colors that objects in the game can be remapped to. Most objects in the game contain an area or areas of color which are drawn in specific palette entries from the UNITSNO, UNITEM and UNITURB palettes. In Red Alert 2, like Tiberian Sun, these palette entries are represented by various shades of red. The colors listed here form an internal table of colors from which the game can remap those shades of red. Each house (country) must be assigned a default Color= from this list. In multiplayer map files, the color of each house already present on the map can be specified which will over-ride the default setting for that house. The three values from each entry here represent the hue, saturation and value of each color. The value component specifies the maximum brightness allowed for the color as the color spread is generated. The hue component remains constant. The saturation curves through color space as the value component changes such that darker colors become more saturated.<br />
+
 
<br />
+
This section contains a list of colors used for various purposes in the game, most notably to differentiate various players ([[Houses]]) from each other.
Note that this list forms an internal table to which the game refers when any color is required for the games houses (including display of text). The table is numbered in the order in which these colors appear and starts at '0'. When the game needs a particular color, it refers to a number from this table by matching the name, so to edit or change any colors you should change the values held here under that color's name, not the name itself.<br />
+
 
<br />
+
== Color format ==
It is also worth remembering that entries 1,5,6,7,8,10,12 and 14 are used for the default colors of the multiplayer houses so you can change these values to allow players to use different colors, although it is not recommended that you use Black for a multiplayer house - doing so means the player will not see a lot of in game text which is printed on a Black background! It is unwise to edit numbers 17 and 18 (Allied Load and Soviet Load) as these colors are always used for the text on loading screens. The game can handle a maximum of 50 colors in this table.<br />
+
 
<br />
+
Each color entry has a unique name 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.
LightGold=25,255,255 ; 0 Orange<br />
+
 
Gold=41,240,230 ; 1  MP#0 Yellow<br />
+
== Structure ==
LightGrey=0,0,240 ; 2 White<br />
+
 
Grey=0,0,131 ; 3 Grey<br />
+
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 {{ini|rules}}:
Red=20,255,184 ; 4 Brown<br />
+
;gs note to coders, these entries are all doubled, so ColorSchemes[5] is White, not 2.
DarkRed=0,230,255 ; 5  MP#1 Red<br />
+
 
Orange=25,230,255 ; 6  MP#4 Orange<br />
+
More colors can be freely added to this section, as long as they have unique names.
Magenta=221,102,255 ; 7  MP#7 Pink<br />
+
 
Purple=201,201,189 ; 8  MP#6 Purple<br />
+
=== Multiplayer colors ===
LightBlue=119,143,255 ; 9 Aqua<br />
+
 
DarkBlue=153,214,212 ; 10  MP#2 Blue<br />
+
Player colors available in multiplayer are hardcoded to certain IDs (indexes) in the internal table. Below is a list of these IDs and their respective colors. The ''multiplayer color ID'' determines the order in which the colors appear in the multiplayer dialog.
NeonBlue=185,156,238 ; 11 Violet<br />
+
 
DarkSky=131,200,230 ; 12  MP#5 Periwinkle (i.e. aquaish)<br />
+
{|class="wikitable sortable"
Green=104,241,195 ; 13 Bathroom green<br />
+
!ID (TS/FS)
DarkGreen=81,200,210 ; 14  MP#3 Light green<br />
+
!ID (RA2/YR)
NeonGreen=0,0,0 ; 15 Black<br />
+
!Multiplayer ID
Yellow=38,159,255 ; 16 Pastel yellow<br />
+
!Name
AlliedLoad=164,255,255 ; 17 Allied Load<br />
+
|-
SovietLoad=0,235,255 ; 18 Soviet Load<br />
+
|3
(YR) Purple2=211,201,189 ; 19 Yuris Purple #1<br />
+
|3
(YR) Purple3=191,201,189 ; 20 Yuris Purple #2<br />
+
|0
<br />
+
|Gold
Purely for information, the UNITSNO and UNITTEM palettes in Red Alert 2 are almost identical to the Tiberian Sun ones, so here are some more colors from Tiberian Sun should you wish to modify the default colors, as they work equally well in Red Alert 2.<br />
+
|-
<br />
+
|21
LightGold=34,128,255<br />
+
|11
Gold=34,160,255<br />
+
|1
DarkGold=34,235,255<br />
+
|DarkRed
LightGrey=0,0,220<br />
+
|-
Grey=0,0,190<br />
+
|27
DarkGrey=0,0,120<br />
+
|13
Black=0,100,0<br />
+
|4
White=0,0,255<br />
+
|Orange
LightRed=0,70,255<br />
+
|-
Red=0,160,255<br />
+
|33
DarkRed=0,235,255<br />
+
|15
Burgandy=0,255,150<br />
+
|7
LightOrange=24,165,255<br />
+
|Magenta
Orange=24,255,255<br />
+
|-
DarkOrange=11,235,255<br />
+
|39
LightMagenta=228,120,255<br />
+
|17
Magenta=228,160,255<br />
+
|6
DarkMagenta=228,235,255<br />
+
|Purple
LightPurple=200,160,255<br />
+
|-
Purple=200,235,255<br />
+
|47
HyundaiPurple=200,235,170<br />
+
|21
LightBlue=164,140,255<br />
+
|2
Blue=164,200,255<br />
+
|DarkBlue
DarkBlue=164,200,179<br />
+
|-
NeonBlue=164,255,255<br />
+
|55
LightSky=142,70,255<br />
+
|25
Sky=142,160,255<br />
+
|5
DarkSky=142,235,255<br />
+
|DarkSky
LightCyan=132,70,255<br />
+
|-
Cyan=132,160,255<br />
+
|73
DarkCyan=132,235,255<br />
+
|29
LightTeal=110,70,255<br />
+
|3
Teal=110,160,255<br />
+
|DarkGreen
DarkTeal=110,235,255<br />
+
|}
LightGreen=85,70,255<br />
+
 
Green=85,160,200<br />
+
== Uses ==
DarkGreen=85,235,150<br />
+
 
NeonGreen=85,255,255<br />
+
=== Remap ===
LightYellow=43,70,255<br />
+
 
Yellow=43,160,255<br />
+
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.
DarkYellow=43,235,255<br />
+
 
NeonYellow=43,255,255<br />
+
=== UI & text ===
LightPeach=21,120,255<br />
+
 
Peach=21,150,255<br />
+
Several color names and/or IDs in this section are hardcoded for various UI and text elements. Below is a few examples from TS:
DarkPeach=21,180,255<br />
+
 
DarkerPeach=21,255,255<br />
+
{|class="wikitable"
LightLime=53,70,255<br />
+
!Type
Lime=53,160,255<br />
+
!Value
Darklime=53,235,200<br />
+
!Hardcoded for...
NeonLime=53,235,255<br />
+
|-
<br />
+
|ID
[title]ColorAdd[/title]<br />
+
|0
[content]This section holds and defines the colors used to tint buildings, such as when they are designated for an Airstrike. In order to prevent slowdown in the low level blitting routines, this functionality was implemented by doing a composite bitwise logical OR. This means that the color value is not being shifted, instead the value of color specified below is being added. If part of the object being tinted already has as much value of the color specified, then no change will be seen. At the level that the blitters operate, colors are 16 bit numbers using the 5,6,5 RGB scheme. This means that values of red range from 0 to 31, values of green from 0 to 63, and values of blue from 0 to 31. Those values are then converted from binary to decimal and listed here.<br />
+
|UI top bar text, pip text
<br />
+
|-
None=0,0,0 00000,000000,00000 0<br />
+
|Name
StrongRed=31,0,0 11111,000000,00000 1<br />
+
|LightGold
StrongGreen=0,63,0 00000,111111,00000 2<br />
+
|Closing credits text
StrongBlue=0,0,31 00000,000000,11111 3<br />
+
|-
HighRed=24,0,0 11000,000000,00000 4<br />
+
|Name
HighGreen=0,56,0 00000,111000,00000 5<br />
+
|LightGrey
HighBlue=0,0,24 00000,000000,11000 6<br />
+
|Neutral & Special 0House color, cameo "on hold" status and queue count
BrightWhite=31,63,31 11111,111111,11111 7<br />
+
|-
LowWhite=7,7,7 00111,000111,00111 8<br />
+
|Name
HighWhite=24,56,24 11000,111000,11000 9<br />
+
|Grey
MidWhite=14,28,14 01110,011100,01110 10<br />
+
|Default text print & gadget color and MP debug text print
Purple=15,0,15 01111,000000,01111 11<br />
+
|-
HighYellow=24,56,0 11000,111000,00000 12<br />
+
|ID
TopYellow=16,32,0 10000,100000,00000 13<br />
+
|14
<br />
+
|Waypoint number
The games' difficulty is controlled by these factors. Some of these factors will only affect a computer player. The computer and human players can be handicapped by these individual settings, thus the computer may be playing at 'hard' level while the player may be playing at 'easy' level. Each level of difficulty must be defined with its own section here and should be [Easy] , [Normal] and [Difficult]- you cannot add new difficulty levels as these sections are the only ones Red Alert 2 will recognize.
+
|-
 +
|Name
 +
|Red
 +
|Map lighting
 +
|-
 +
|Name
 +
|Green
 +
|Map lighting, loading screen progress text, tooltips, Dropship loadout and ingame menu version text
 +
|-
 +
|Name
 +
|LightBlue
 +
|Sidebar icon "ready" status
 +
|-
 +
|Name
 +
|Blue
 +
|Map lighting
 +
|}
 +
 
 +
 
 +
{{bugs}}
 +
=== 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 {{tt|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 ===
 +
[https://www.moddb.com/mods/tiberian-sun-client 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 [https://media.moddb.com/images/mods/1/11/10865/1.jpg 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 [[Colors#Structure|the Structure section]] for more information.
 +
 
 +
== See Also ==
 +
* [https://ppmforums.com/topic-44057/westwood-color-conversion-utility/ Westwood Color Conversion Utility] for converting color values between standard RGB range and Westwood's HSV range.
 +
* [http://bobingabout.gamemod.net/Files/rgb2hsb.exe RGB-to-HSB color converter], an alternative, older tool.
 +
 
 +
[[Category:Rules(md).ini Sections]]
 +
[[Category:General Editing Information]]

Latest revision as of 07:12, 31 March 2023

This page should correctly be named "[Colors]"; it is wrong due to technical restrictions.


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 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 IDs (indexes) in the internal table. Below is a list of these IDs and their respective colors. The multiplayer color ID determines the order in which the colors appear in the multiplayer dialog.

ID (TS/FS) ID (RA2/YR) Multiplayer ID Name
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 names and/or IDs in this section are hardcoded for various UI and text elements. Below is a few examples from TS:

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


Cc alert.png 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 the Structure section for more information.

See Also