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)
mNo edit summary
Crimsonum (talk | contribs)
Fixed index/ID terminology
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{WrongTitle|[{{PAGENAME}}]}}
This section contains a list of colors used for various purposes in the game, most notably to differentiate various players ([[Houses]]) from each other.
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 ==
== 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.
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 ==
== Structure ==
Line 14: Line 16:
=== Multiplayer colors ===
=== 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.
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"
{|class="wikitable sortable"
!Index (TS/FS)
!ID (TS/FS)
!Index (RA2/YR)
!ID (RA2/YR)
!Multiplayer Index
!Multiplayer ID
!ID
!Name
|-
|-
|3
|3
Line 71: Line 73:
=== UI & text ===
=== 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:
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"
{|class="wikitable"
Line 78: Line 80:
!Hardcoded for...
!Hardcoded for...
|-
|-
|Index
|ID
|0
|0
|UI top bar text, pip text
|UI top bar text, pip text
|-
|-
|ID
|Name
|LightGold
|LightGold
|Closing credits text
|Closing credits text
|-
|-
|ID
|Name
|LightGrey
|LightGrey
|Neutral & Special 0House color, cameo "on hold" status and queue count
|Neutral & Special 0House color, cameo "on hold" status and queue count
|-
|-
|ID
|Name
|Grey
|Grey
|Default text print & gadget color and MP debug text print
|Default text print & gadget color and MP debug text print
|-
|-
|Index
|ID
|14
|14
|Waypoint number
|Waypoint number
|-
|-
|ID
|Name
|Red
|Red
|Map lighting
|Map lighting
|-
|-
|ID
|Name
|Green
|Green
|Map lighting, loading screen progress text, tooltips, Dropship loadout and ingame menu version text
|Map lighting, loading screen progress text, tooltips, Dropship loadout and ingame menu version text
|-
|-
|ID
|Name
|LightBlue
|LightBlue
|Sidebar icon "ready" status
|Sidebar icon "ready" status
|-
|-
|ID
|Name
|Blue
|Blue
|Map lighting
|Map lighting
Line 123: Line 125:


=== Objects displaying through shroud ===
=== 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 [#Structure] for more information.
[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 ==
== 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.
* [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.
* [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 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


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