Colors: Difference between revisions
No edit summary |
Fixed index/ID terminology |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{WrongTitle|[{{PAGENAME}}]}} | ||
This section contains | |||
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 {{ini|rules}}: | |||
;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. | |||
{|class="wikitable sortable" | |||
!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 | |||
|} | |||
Green | == 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 {{tt|UNITSNO}}, {{tt|UNITEM}} and (in RA2) {{tt|UNITURB}} [[PAL|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: | |||
{|class="wikitable" | |||
!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 | |||
|} | |||
{{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 05:12, 31 March 2023
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 |
Bugs/Side-Effects/Unexpected Limitations
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
- Westwood Color Conversion Utility for converting color values between standard RGB range and Westwood's HSV range.
- RGB-to-HSB color converter, an alternative, older tool.