Pikmin 2 map lighting files
The Lighting configuration files for overworld maps are found under root/user/Abe/map/<map name>
as .ini files. Each overworld has one, as well as all Piklopedia maps and the test map. They control the lighting of maps and how they change throughout the day.
Configuration Format
The example below represents settings for Valley of Repose's light.ini
taken directly from the file and broken up into segments. Note that parameter Ids that start with u are unsigned 8-bit integers that go from 0-255. Ids that start with f are floating point values.
###############################################
#
# Game Light Mgr Setting
#
###############################################
#===============================================
# 共通設定 <Common Settings>
#===============================================
{0001} # バージョン <Version>
0 # <Type>
Version appears to always be 0000 for both caves and overworlds, but Type is different. For overworlds it is 0, but in caves it is 1.
#===============================================
# 太陽タイプ設定 <Sun Type Settings>
#===============================================
# パラメタ <Parameters>
# MoveParms
{
{f000} 4 25000.000000 # 光源までの距離 <Distance to light source>
{f001} 4 135.000000 # 日の出角度 <Sunrise Angle>
{f002} 4 45.000000 # 日の入角度 <Sunset Angle>
{_eof}
}
These are the basic settings that control the sun spotlight's height and rotation values that affects the vertex lighting of the model. {f000}
changes hpw high up the light source is, and thus the size of the spotlight. Higher values make brighter maps.{f001}
represents the starting angle of the spotlight while {f002}
would be the end angle based off the start and end of day on the time.ini
All these values can be set to negative values as well and it's possible to have the spotlight rotate around the model multiple times before the day ends.
After the main parameters are five different versions of lighting settings, for different times of the day. The first is always night, or the color you see at the very end of the day during takeoff. Next is morning light, or the light you see at the start of a day. After that is Noon light, and then evening light. At the end is "for demo" light. It seems like this should be the light used during day 1, but this is not the case. The game actually uses the morning light values during day 1.
#===============================================
# ライトカラー設定 <Light Color Settings>
#===============================================
#-----------------------------------------------
# 夜 <Night>
#-----------------------------------------------
# メインライト <Main Light>
# ColorParms
{
{u800} 4 67 # 赤 <Red>
{u801} 4 47 # 緑 <Green>
{u802} 4 51 # 青 <Blue>
{u803} 4 255 # アルファ <Alpha>
{_eof}
}
# サブライト <Sublight>
# ColorParms
{
{u800} 4 10 # 赤 <Red>
{u801} 4 10 # 緑 <Green>
{u802} 4 15 # 青 <Blue>
{u803} 4 255 # アルファ <Alpha>
{_eof}
}
# スペキュラライト <Specular Light>
# ColorParms
{
{u800} 4 128 # 赤 <Red>
{u801} 4 128 # 緑 <Green>
{u802} 4 128 # 青 <Blue>
{u803} 4 0 # アルファ <Alpha>
{_eof}
}
# アンビエントライト <Ambient Light>
# ColorParms
{
{u800} 4 35 # 赤 <Red>
{u801} 4 28 # 緑 <Green>
{u802} 4 35 # 青 <Blue>
{u803} 4 0 # アルファ <Alpha>
{_eof}
}
# フォグ <Fog>
# ColorParms
{
{u800} 4 28 # 赤 <Red>
{u801} 4 18 # 緑 <Green>
{u802} 4 10 # 青 <Blue>
{u803} 4 48 # アルファ <Alpha>
{_eof}
}
# GameFogParms
{
{f000} 4 0.000000 # 開始z値 <Start Z Value>
{f001} 4 4500.000000 # 終了z値 <End Z Value>
{_eof}
}
# 影 <Shadow>
# ColorParms
{
{u800} 4 0 # 赤 <Red>
{u801} 4 0 # 緑 <Green>
{u802} 4 0 # 青 <Blue>
{u803} 4 50 # アルファ <Alpha>
{_eof}
}
The main light has the color of the sun spotlight. Sublight is used on some models to represent reflected highlight. Specular light determines the color of specular reflection. Ambient light refers to the flat lighting of anything not affected by other lightsources. In Pikmin 2, the game uses linear interpolation for its fog from where alpha intensity is 0 to 1 starting from the value of Start Z and End Z. Shadows refer to the color of circlar shadows underneath all objects.