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
No edit summary
Crimsonum (talk | contribs)
Fixed index/ID terminology
 
(5 intermediate revisions by 2 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 />
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 />


In both ''[[Tiberian Sun]]'' (including ''[[Firestorm]]'') and ''[[Red Alert 2]]'', the game identifies the colors available in the multiplayer color selection menu by their name on the left side of the table. The colors that will appear in the color selection menu are the ones with the names <tt>Gold</tt>, <tt>DarkRed</tt>, <tt>DarkBlue</tt>, <tt>DarkGreen</tt>, <tt>Orange</tt>, <tt>DarkSky</tt>, <tt>Purple</tt> and <tt>Magenta</tt>. They will appear in the dropdown menu in precisely this order, from top to bottom, irrespective of how they are sorted in the color list in the rules(md). Their acctual number in the list does not matter at all, since they are identified by their name, not by the list number. While the appearance of the golden MP color (edited to yellow in ''RA2'') - corresponding to no side in ''Red Alert 2'' - and the appearance of the Soviet color before the Allied one may seem odd in that game, one has to keep in mind that the color array dates back to ''Tiberian Sun'', where GDI - by default associated with a golden remap - was the first side, and Nod - by default associated with a red remap - was the second side. Blue - which represents the Allies in ''Red Alert 2'' - had no corresponding side in ''Tiberian Sun''.  
This section contains a list of colors used for various purposes in the game, most notably to differentiate various players ([[Houses]]) from each other.


You can change the values of these entries 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!
== Color format ==
<br>
While in-game colors as appearing in-game are freely editable, there are issues with the acctual color selection menu in both ''Tiberian Sun'' and ''Red Alert 2''. In ''Tiberian Sun'', editing the values associated with a color will not change the name of the color as it appears in the color selection menu, although it ''will'' alter the color the text is displayed in. For example, editing <tt>DarkGreen</tt> 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 - this game does not acctually have text in the dropdown color selection menu. Instead, it uses little colored squares representing each available color. If the color values are unedited, the color of the squares corresponds to the in-game color which is selected by clicking on them. However, if the color value of a multiplayer color is edited, 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.
<br>
The game also uses the colors with the name <tt>AlliedLoad</tt> and <tt>SovietLoad</tt> to print the loadscreen texts for allied and soviet, respectively, allowing you to edit these aswell.


Contrary to previous information in the community, there seems to be no issue with having more than 50 colors in this list, at least for YR, although the same seems to be supported by research in TS.<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.


<br />
== Structure ==
LightGold=25,255,255 ; 0 Orange<br />
 
  Gold=41,240,230         ; 1  MP#0 Yellow<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}}:
LightGrey=0,0,240 ; 2 White<br />
  ;gs note to coders, these entries are all doubled, so ColorSchemes[5] is White, not 2.
Grey=0,0,131 ; 3 Grey<br />
 
Red=20,255,184 ; 4 Brown<br />
More colors can be freely added to this section, as long as they have unique names.
DarkRed=0,230,255 ; 5  MP#1 Red<br />
 
Orange=25,230,255 ; 6  MP#4 Orange<br />
=== Multiplayer colors ===
Magenta=221,102,255 ; 7  MP#7 Pink<br />
 
Purple=201,201,189 ; 8  MP#6 Purple<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.
LightBlue=119,143,255 ; 9 Aqua<br />
 
DarkBlue=153,214,212 ; 10  MP#2 Blue<br />
{|class="wikitable sortable"
NeonBlue=185,156,238 ; 11 Violet<br />
!ID (TS/FS)
DarkSky=131,200,230 ; 12  MP#5 Periwinkle (i.e. aquaish)<br />
!ID (RA2/YR)
Green=104,241,195 ; 13 Bathroom green<br />
!Multiplayer ID
DarkGreen=81,200,210 ; 14  MP#3 Light green<br />
!Name
NeonGreen=0,0,0              ; 15 Black<br />
|-
Yellow=38,159,255 ; 16 Pastel yellow<br />
|3
AlliedLoad=164,255,255 ; 17 Allied Load<br />
|3
SovietLoad=0,235,255 ; 18 Soviet Load<br />
|0
(YR) Purple2=211,201,189 ; 19 Yuris Purple #1<br />
|Gold
(YR) Purple3=191,201,189 ; 20 Yuris Purple #2<br />
|-
<br />
|21
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 />
|11
<br />
|1
LightGold=34,128,255<br />
|DarkRed
Gold=34,160,255<br />
|-
DarkGold=34,235,255<br />
|27
LightGrey=0,0,220<br />
|13
Grey=0,0,190<br />
|4
DarkGrey=0,0,120<br />
|Orange
Black=0,100,0<br />
|-
White=0,0,255<br />
|33
LightRed=0,70,255<br />
|15
Red=0,160,255<br />
|7
DarkRed=0,235,255<br />
|Magenta
Burgandy=0,255,150<br />
|-
LightOrange=24,165,255<br />
|39
Orange=24,255,255<br />
|17
DarkOrange=11,235,255<br />
|6
LightMagenta=228,120,255<br />
|Purple
Magenta=228,160,255<br />
|-
DarkMagenta=228,235,255<br />
|47
LightPurple=200,160,255<br />
|21
Purple=200,235,255<br />
|2
HyundaiPurple=200,235,170<br />
|DarkBlue
LightBlue=164,140,255<br />
|-
Blue=164,200,255<br />
|55
DarkBlue=164,200,179<br />
|25
NeonBlue=164,255,255<br />
|5
LightSky=142,70,255<br />
|DarkSky
Sky=142,160,255<br />
|-
DarkSky=142,235,255<br />
|73
LightCyan=132,70,255<br />
|29
Cyan=132,160,255<br />
|3
DarkCyan=132,235,255<br />
|DarkGreen
LightTeal=110,70,255<br />
|}
Teal=110,160,255<br />
 
DarkTeal=110,235,255<br />
== Uses ==
LightGreen=85,70,255<br />
 
Green=85,160,200<br />
=== Remap ===
DarkGreen=85,235,150<br />
 
NeonGreen=85,255,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.
LightYellow=43,70,255<br />
 
Yellow=43,160,255<br />
=== UI & text ===
DarkYellow=43,235,255<br />
 
NeonYellow=43,255,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:
LightPeach=21,120,255<br />
 
Peach=21,150,255<br />
{|class="wikitable"
DarkPeach=21,180,255<br />
!Type
DarkerPeach=21,255,255<br />
!Value
LightLime=53,70,255<br />
!Hardcoded for...
Lime=53,160,255<br />
|-
Darklime=53,235,200<br />
|ID
NeonLime=53,235,255<br />
|0
<br />
|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 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