Difference between revisions of "Pikmin 2 map lighting files"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
Line 1: Line 1:
{{todo| Research map lighting.ini under Abe. Finish writing observations below.}}
+
The Lighting configuration files for overworld maps are found under <code>root/user/Abe/map/<map name></code> 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.
Lighting configuration files for overworld maps are found under "root/user/Abe/map/<map name>" as .txt files. There are 10 in total that can be found for the main maps, piklopedia maps, and test map.
 
  
 
=Configuration Format=
 
=Configuration Format=
The example below represents settings for Valley of Repose's <code>light.ini</code> taken directly from the file and broken up into segments.
+
The example below represents settings for Valley of Repose's <code>light.ini</code> 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.
{{note|Notice that the first two characters in the braced 4 character parameter ID signify the data type. "fp" means floating point number and "u8" being unsigned 8-bit integer (0-255).}}
 
 
<source lang="powershell">
 
<source lang="powershell">
 
###############################################  
 
###############################################  
Line 17: Line 15:
 
0 # <Type>  
 
0 # <Type>  
 
</source>
 
</source>
First line represents what version the lighting file is. Differently from cave lighting files, the type is set to 0.
+
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.
  
 
<source lang="powershell">
 
<source lang="powershell">
Line 32: Line 30:
 
}
 
}
 
</source>
 
</source>
These are the basic settings that control the sun spotlight's height and rotation values that affects the vertex lighting of the model. <code>{f000}</code> changes how far away the light source is from it's angle's vertex. <code>{f001}</code> represents the starting angle of the spotlight while <code>{f002}</code> would be the end angle based off the start and end of day on the <code>time.ini</code> 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.
+
These are the basic settings that control the sun spotlight's height and rotation values that affects the vertex lighting of the model. <code>{f000}</code> changes hpw high up the light source is, and thus the size of the spotlight. Higher values make brighter maps.<code>{f001}</code> represents the starting angle of the spotlight while <code>{f002}</code> would be the end angle based off the start and end of day on the <code>time.ini</code> 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.
  
  
{{note|The there are a total of 5 groups of light parameters starting from night, morning, noon, evening, and demo. The game's time.ini defaults the game to start by using the morning set of parameters so change those first if you plan on using a unmodified time.ini.}}
+
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.
<source lang="powershell">
+
<source>
 
#===============================================  
 
#===============================================  
 
# ライトカラー設定 <Light Color Settings>
 
# ライトカラー設定 <Light Color Settings>

Revision as of 22:32, 3 January 2020

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.