Skip to content

Lights, decorations and moods

GameBox (Nadeo)Lighting and skyApplies toTMNF

A block’s lights are part of its solid: a CPlugTreeLight names a CPlugLight, which holds a Gx light. The sun is not stored as a light: a map’s decoration leads to a mood file with a latitude and the day’s times, and only two of the four Stadium moods add a directional light. Observed · the install and the 65 campaign maps

The Gx light classes form two chains, and each class reads its bases’ chunks first. Observed[every Light and SceneLight file of the Game/Stadium packs (26 and 3), compared with GBX.NET]

Class Derives from Chunks of its own Confidence
GxLight (0x04001000) 0x04001009 Observed
GxLightNotAmbient (0x04006000) GxLight Observed
GxLightPoint (0x04003000) GxLight 0x04003004 Observed
GxLightBall (0x04002000) GxLightPoint 0x04002006 Observed
GxLightSpot (0x0400B000) GxLightBall 0x0400B001, 0x0400B002 Observed
GxLightFrustum (0x0400A000) GxLightBall 0x0400A006 Observed
GxLightDirectional (0x04007000) GxLightNotAmbient 0x04007002 to 0x04007005 Observed

A directional light reads no point or ball chunk. Observed The files store legacy angles, attenuations and flags, which GBX.NET upgrades on reading; the values on this page are as stored. Sourced · GBX.NET

CPlugLight has the chunk 0x0901D002, CHmsLight 0x0600C003, and CSceneLight the chunks 0x0A005001, 003, 0x0A009000 and 0x0A00B000, the last holding its CHmsLight in place. Observed · the install’s packs

Every light the blocks of three maps place (156 in A01-Race, 417 and 92 in two downloaded maps) is a GxLightSpot with ball chunk 0x04002006 and spot chunk 0x0400B002. Observed · three maps

A spot shines along its light tree’s local +Z. In A01-Race and one downloaded map all 82 StadiumWarpSpotsGlow sprite quads near a light face +Z, and the back faces StadiumWarpSpotsGlowBack −Z, as do 68 of 86 lamp-lens patches (the *Spots materials; the other 18 lie within 0.8 m of a neighbouring lamp). Observed · two maps

Stored value Over the lights of the three maps Confidence
Attenuation 1 0 on every light Observed
Attenuation 2 8.12 / radius² on every light, the radius being 24, 32, 40, 48 or 50 Observed
Intensity 0.12 to 1.0 Observed
Colour n / 255 as floats Observed
Spot inner, outer 60/75, 80/100, 90/120, 100/120 Observed
Falloff exponent 1 or 0.1 Observed
GxLight flags 121 or 105 Unknown

With a falloff of 1 / (1 + a₂d²) the light reaches about 0.11 at its radius. Inferred · from the stored attenuation The spot angles are full apex angles in degrees, since 120 cannot be a half-angle. Inferred

A map’s decoration ID (Day, Sunrise, Sunset or Night) is a collector ident of collection Stadium, the decoration Stadium\ConstructionDecoration\StadiumBase32x32<Mood>.TMDecoration.Gbx, whose mood is Stadium\ConstructionDecorationMood\<Mood>.TMDecorationMood.Gbx. Observed · the install and the 65 campaign maps

Mood Latitude Longitude ΔGMT Sunrise Sunset Day time (0x0303A001) Confidence
Day 48 0 0 6 h 18 h 0.65 Observed
Sunrise 65 0 0 10 h 14 h 0.53 Observed
Sunset 50 0 0 10 h 14 h 0.75 Observed
Night 48 0 0 6 h 18 h 0.15 Observed

Chunk 0x0303A000 holds the latitude, longitude, the offset from GMT and the sunrise and sunset in milliseconds; chunk 0x0303A001 the day time (GBX.NET’s RemappedStartDayTime), the skin Stadium\GameSkin\DayTime.GameSkin.gbx, which is in no pack and not among the game’s data files, and the folder Stadium\Media\Moods\<Mood>\. :observed[the four Stadium moods] Chunk 0x0303A006, the sun and moon intensity, is in none of the four. Observed · the four Stadium moods

The Sunrise and Sunset folders hold Directional.SceneLight.Gbx: a CSceneLight with a CHmsLight and a GxLightDirectional of colour (1, 1, 1), intensity 1, shadow intensity 0.4, reverse intensity 0.3, an emitting angular size of 10 and a flare of 18, and no direction. The Day and Night folders have none. Observed · the install

The light map is LightMap\HmsPackLightMap\TmNations.PackLightMap.Gbx; its CHmsLightMapMood has an ambient range of 0.5 to 1.1 and a directional scale of 1.2. The Sunrise folder also holds a LightMapSettings.PackLightMapMood.Gbx. Observed · the install The light-map classes read CHmsLightMap chunks 0x06021001 to 0x06021004 and CHmsLightMapMood 0x06023000. Observed · the install’s packs

What does the day time mean, and where is the sun?

GBX.NET treats a day time between 0.25 and 0.75 as night, which Nations Forever’s values contradict (Day 0.65, Night 0.15), so the convention is not established. No stored field found gives the sun’s direction; the game computes it at run time from something not yet identified.

What do the light flags 121 and 105 mean?

They are the only two values on the block lights measured; their bits are not read.

Sources

  • GBX.NET — version 2.5.0; the Gx light classes, CGameCtnDecorationMood and its day-time property