Difference between revisions of "Cave unit definition file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
 
(24 intermediate revisions by 10 users not shown)
Line 1: Line 1:
In ''Pikmin 2'', each sublevel points to a cave unit list file. These files can be found in <code>/user/Mukki/mapunits/units</code>, and contain a list of units that the game is allowed to use to create the cave with.
+
In ''Pikmin 2'', each sublevel points to a cave unit definition file. These files can be found in <code>/user/Mukki/mapunits/units</code>, and contain a list of units that the game is allowed to use to create the cave with. This file just tells the generator how each cave unit attaches with one another. In other words, this file specifies all the rooms to spawn in a sublevel, depending on that sublevel's room count (<code>{f005}</code>).
 +
 
 +
__TOC__
  
 
==Header==
 
==Header==
Line 6: Line 8:
 
==Unit==
 
==Unit==
  
'''Line 1:''' The version of the block's data format, this is always 1. For example, <code>1 # version</code>
+
{| class="wikitable sortable"
 
+
|-
'''Line 2:''' The internal name of the unit. For example, <code>room_block1_3_tsuchi # foldername</code>.
+
! Line || Example || Description || Comment
 
+
|-
'''Line 3:''' Consisting of two numbers, this defines how many cave grid cells this unit takes up. The first number is for the length in X, the second for the length in Z (y-up). Basically, this means "this unit is X by Z units big". For example, <code>4 4 # dX/dZ ; cell size</code>.
+
| 1 || <code>1</code> || Version || <code>version</code>
 
+
|-
'''Line 4:''' The type of unit this is. <code>0</code> is a dead end, <code>1</code> is a room, and <code>2</code> is a corridor.
+
| 2 || <code>room_ike1_2_tsuchi</code> || Folder name of the unit to spawn || <code>foldername</code>
 
+
|-
'''Line 5:''' The unit's flags. For example, <code>0 1 # room Flags</code>.
+
| 3 || <code>7 6</code> || Width (7) and length (6) of the unit that's spawning (line 3); defines how many cave grid cells this unit || <code>dX/dZ ; cell size</code>
{{todo|Document the unit's flags.}}
+
|-
 +
| 4 || <code>1</code> || Room type: 0=dead end, 1=room, 2=hallway || <code>room type</code>
 +
|-
 +
| 5 || <code>0 1</code> || The unit's "room" flags. Judging by the name, and how most of the "room" type units have it set to 1, it's presumed to help count the room units as... well, rooms and not hallways or dead ends. Changing it to anything other than 1, or 0 for the non-room units, doesn't seem to do anything though. || <code>room Flags</code>
 +
|-
 +
| 6 || <code>2</code> || The number of doors (exits) the unit has || <code>num doors</code>
 +
|}
  
'''Line 6:''' This indicates how many exits this unit has. For example, <code>4 # num doors</code>.
+
From this point onwards, before ending the unit entry, there are four lines for each door sub-entry.
'The lines after this one contain data about each exit.'
+
{| class="wikitable sortable"
 +
|-
 +
! Line || Example || Description || Comment
 +
|-
 +
| 1 || <code>0</code> || Door index || <code>index</code>
 +
|-
 +
| 2 || <code>0 0 0</code> || Direction, offset (starting from the left, determines how many cells to the right the door is), and wpindex (The index of the route waypoint for that door) || <code>dir/offs/wpindex</code>
 +
|-
 +
| 3 || <code>1</code> || The number of doors this can link to || <code>door links</code>
 +
|}
  
====dirs/offs/wpindex====
+
From this point onwards, before ending the door sub-entry, there is one line for each door link.
This line contains three words, all numbers.
+
{| class="wikitable sortable"
The first number, <code>dirs</code>, is the direction of the room and player. For example, in the Emergence Cave the direction is <code>2</code>, for all other rooms to connect they must also be <code>2</code>. This value is ''currently'' useless because all rooms must be the same value for them to connect to each other. The player will always face the direction (the camera will oppose), which in a single-door room (any room name with "_1" before the room type) is always towards the next room.
+
|-
[[File:Dir3.png|200px|thumb|left|An example of <code>dirs</code> set on <code>3</code> while all other room <code>dirs</code> are set on <code>2</code>.]]
+
! Line || Example || Description || Comment
 +
|-
 +
| 1 || <code>1258.716064 0 1</code> || Distance (used within score calculation), Door-id (Maps to another door index), and tekiflag {{unknown}} || <code>dist/door-id/tekiflag</code>
 +
|}
  
===Exits===
+
==File list==
The first line in an exit's data is its index. This starts at 0.
+
This is a list of unit definition files, their theme and what units they contain.
  
{{todo|Document the remaining lines.}}
+
{| class="wikitable sortable"
 +
|-
 +
! File || Theme || Units (text) || Units (images)
 +
|-
 +
|| <div style='text-align: center;'><code>1_ABE_ari_metal.txt</code></div> || <div style='text-align: center;'>Metal</div> || <code>cap_metal</code>, <code>item_cap_metal</code>,<br> <code>way3_metal</code>, <code>way4_metal</code>,<br> <code>wayl_metal</code>, <code>way2_metal</code>,<br> <code>way2x2_metal</code>, <code>room_ari1_3_metal</code> || [[File:P2CU cap metal.jpg|64px]]  [[File:P2CU item cap metal.jpg|64px]] [[File:P2CU way3 metal.jpg|64px]] [[File:P2CU way4 metal.jpg|64px]] [[File:P2CU wayl metal.jpg|64px]] [[File:P2CU way2 metal.jpg|64px]] [[File:P2CU way2x2 metal.jpg|64px]] [[File:P2CU room ari1 3 metal.jpg|64px]]
 +
|-
 +
|| <div style='text-align: center;'><code>1_ABE_king_tsuchi.txt</code></div> || <div style='text-align: center;'>Soil</div> || <code>item_cap_tsuchi</code>, <code>way3_tsuchi</code>,<br> <code>way4_tsuchi</code>, <code>wayl_tsuchi</code>,<br> <code>way2_tsuchi</code>, <code>way2x2_tsuchi</code>, <br><code>room_kingchp_tsuchi</code> || [[File:P2CU item cap tsuchi.jpg|64px]] [[File:P2CU way3 tsuchi.jpg|64px]] [[File:P2CU way4 tsuchi.jpg|64px]] [[File:P2CU wayl tsuchi.jpg|64px]] [[File:P2CU way2 tsuchi.jpg|64px]] [[File:P2CU way2x2 tsuchi.jpg|64px]] [[File:P2CU room kingchp tsuchi.jpg|64px]]
 +
|-
 +
|| <div style='text-align: center;'><code>1_ABE_manp_boss_conc.txt</code></div> || <div style='text-align: center;'>Concrete</div> || <code>item_cap_conc</code>, <code>way3_conc</code>,<br> <code>way4_conc</code>, <code>wayl_conc</code>,<br> <code>way2_conc</code>, <code>way2x2_conc</code>,<br> <code>room_manh7x7p_boss_conc</code> || [[File:P2CU item cap conc.jpg|64px]] [[File:P2CU way3 conc.jpg|64px]] [[File:P2CU way4 conc.jpg|64px]] [[File:P2CU wayl conc.jpg|64px]] [[File:P2CU way2 conc.jpg|64px]] [[File:P2CU way2x2 conc.jpg|64px]] [[File:P2CU room manh7x7p 9 conc.jpg|64px]]
 +
|-
 +
|| <div style='text-align: center;'><code>1_ABE_mid1_boss_tsuchi.txt</code></div> || <div style='text-align: center;'>Soil</div> || <code>item_cap_tsuchi</code>, <code>way3_tsuchi</code>, <br><code>way4_tsuchi</code>, <code>wayl_tsuchi</code>, <br><code>way2_tsuchi</code>, <code>way2x2_tsuchi</code>, <code>room_mid1_6_boss_tsuchi</code> || [[File:P2CU item cap tsuchi.jpg|64px]] [[File:P2CU way3 tsuchi.jpg|64px]] [[File:P2CU way4 tsuchi.jpg|64px]] [[File:P2CU wayl tsuchi.jpg|64px]] [[File:P2CU way2 tsuchi.jpg|64px]] [[File:P2CU way2x2 tsuchi.jpg|64px]] [[File:P2CU_room_mid1_6_tsuchi.jpg|64px]]
 +
|-
 +
|| <div style='text-align: center;'><code>1_ABE_mid1_metal.txt</code></div> || <div style='text-align: center;'>Metal</div> || <code>cap_metal</code>, <code>item_cap_metal</code>, <br><code>way3_metal</code>, <code>way4_metal</code>, <br><code>wayl_metal</code>, <code>way2_metal</code>, <br><code>way2x2_metal</code>, <code>room_mid2_3_metal</code> || [[File:P2CU cap metal.jpg|64px]] [[File:P2CU item cap metal.jpg|64px]] [[File:P2CU way3 metal.jpg|64px]] [[File:P2CU way4 metal.jpg|64px]] [[File:P2CU wayl metal.jpg|64px]] [[File:P2CU way2 metal.jpg|64px]] [[File:P2CU way2x2 metal.jpg|64px]] [[File:P2CU room mid2 3 metal.jpg|64px]]
 +
|-
 +
|| <div style='text-align: center;'><code>1_ABE_mid1_tsuchi.txt</code></div> || <div style='text-align: center;'>Soil</div> || <code>item_cap_tsuchi</code>, <code>way3_tsuchi</code>, <br><code>way4_tsuchi</code>, <code>wayl_tsuchi</code>, <br><code>way2_tsuchi</code>, <code>way2x2_tsuchi</code>, <br><code>room_mid1_6_tsuchi</code> || [[File:P2CU item cap tsuchi.jpg|64px]] [[File:P2CU way3 tsuchi.jpg|64px]] [[File:P2CU way4 tsuchi.jpg|64px]] [[File:P2CU wayl tsuchi.jpg|64px]] [[File:P2CU way2 tsuchi.jpg|64px]] [[File:P2CU way2x2 tsuchi.jpg|64px]] [[File:P2CU room mid1 6 tsuchi.jpg|64px]]
 +
|-
 +
|| <div style='text-align: center;'><code>1_ABE_vshit67_toy.txt</code></div> || <div style='text-align: center;'>Toybox</div> || <code>item_cap_toy</code>, <code>way3_toy</code>, <br><code>way4_toy</code>, <code>wayl_toy</code>, <br><code>way2_toy</code>, <code>way2x2_toy</code>, <br><code>room_vs_hitode6x7_4_toy</code> || [[File:P2CU item cap toy.jpg|64px]] [[File:P2CU way3 toy.jpg|64px]] [[File:P2CU way4 toy.jpg|64px]] [[File:P2CU wayl toy.jpg|64px]] [[File:P2CU way2 toy.jpg|64px]] [[File:P2CU way2x2 toy.jpg|64px]] [[File:P2CU room hitode6x7 4 toy.jpg|64px]]
 +
|-
 +
|| <div style='text-align: center;'>TBA</div> || <div style='text-align: center;'>TBA</div> || <div style='text-align: center;'>TBA</div> || <div style='text-align: center;'>TBA</div>
 +
|}
  
{{Credits|Jimble, Kai-Kai}}
+
{{Credits|Jimble, Kai}}
 
[[Category:Pikmin 2]]
 
[[Category:Pikmin 2]]
 
[[Category:File formats]]
 
[[Category:File formats]]

Latest revision as of 12:04, 16 August 2024

In Pikmin 2, each sublevel points to a cave unit definition file. These files can be found in /user/Mukki/mapunits/units, and contain a list of units that the game is allowed to use to create the cave with. This file just tells the generator how each cave unit attaches with one another. In other words, this file specifies all the rooms to spawn in a sublevel, depending on that sublevel's room count ({f005}).

Header[edit]

After a decorated set of comments that say units definition file comes a line containing the number of units defined in this file. This line is commented with number of units. Each unit's data is defined inside its own block, and conveniently has a comment before it that mentions its name.

Unit[edit]

Line Example Description Comment
1 1 Version version
2 room_ike1_2_tsuchi Folder name of the unit to spawn foldername
3 7 6 Width (7) and length (6) of the unit that's spawning (line 3); defines how many cave grid cells this unit dX/dZ ; cell size
4 1 Room type: 0=dead end, 1=room, 2=hallway room type
5 0 1 The unit's "room" flags. Judging by the name, and how most of the "room" type units have it set to 1, it's presumed to help count the room units as... well, rooms and not hallways or dead ends. Changing it to anything other than 1, or 0 for the non-room units, doesn't seem to do anything though. room Flags
6 2 The number of doors (exits) the unit has num doors

From this point onwards, before ending the unit entry, there are four lines for each door sub-entry.

Line Example Description Comment
1 0 Door index index
2 0 0 0 Direction, offset (starting from the left, determines how many cells to the right the door is), and wpindex (The index of the route waypoint for that door) dir/offs/wpindex
3 1 The number of doors this can link to door links

From this point onwards, before ending the door sub-entry, there is one line for each door link.

Line Example Description Comment
1 1258.716064 0 1 Distance (used within score calculation), Door-id (Maps to another door index), and tekiflag Unknown[unsure] dist/door-id/tekiflag

File list[edit]

This is a list of unit definition files, their theme and what units they contain.

File Theme Units (text) Units (images)
1_ABE_ari_metal.txt
Metal
cap_metal, item_cap_metal,
way3_metal, way4_metal,
wayl_metal, way2_metal,
way2x2_metal, room_ari1_3_metal
P2CU cap metal.jpg P2CU item cap metal.jpg P2CU way3 metal.jpg P2CU way4 metal.jpg P2CU wayl metal.jpg P2CU way2 metal.jpg P2CU way2x2 metal.jpg P2CU room ari1 3 metal.jpg
1_ABE_king_tsuchi.txt
Soil
item_cap_tsuchi, way3_tsuchi,
way4_tsuchi, wayl_tsuchi,
way2_tsuchi, way2x2_tsuchi,
room_kingchp_tsuchi
P2CU item cap tsuchi.jpg P2CU way3 tsuchi.jpg P2CU way4 tsuchi.jpg P2CU wayl tsuchi.jpg P2CU way2 tsuchi.jpg P2CU way2x2 tsuchi.jpg P2CU room kingchp tsuchi.jpg
1_ABE_manp_boss_conc.txt
Concrete
item_cap_conc, way3_conc,
way4_conc, wayl_conc,
way2_conc, way2x2_conc,
room_manh7x7p_boss_conc
P2CU item cap conc.jpg P2CU way3 conc.jpg P2CU way4 conc.jpg P2CU wayl conc.jpg P2CU way2 conc.jpg P2CU way2x2 conc.jpg P2CU room manh7x7p 9 conc.jpg
1_ABE_mid1_boss_tsuchi.txt
Soil
item_cap_tsuchi, way3_tsuchi,
way4_tsuchi, wayl_tsuchi,
way2_tsuchi, way2x2_tsuchi, room_mid1_6_boss_tsuchi
P2CU item cap tsuchi.jpg P2CU way3 tsuchi.jpg P2CU way4 tsuchi.jpg P2CU wayl tsuchi.jpg P2CU way2 tsuchi.jpg P2CU way2x2 tsuchi.jpg P2CU room mid1 6 tsuchi.jpg
1_ABE_mid1_metal.txt
Metal
cap_metal, item_cap_metal,
way3_metal, way4_metal,
wayl_metal, way2_metal,
way2x2_metal, room_mid2_3_metal
P2CU cap metal.jpg P2CU item cap metal.jpg P2CU way3 metal.jpg P2CU way4 metal.jpg P2CU wayl metal.jpg P2CU way2 metal.jpg P2CU way2x2 metal.jpg P2CU room mid2 3 metal.jpg
1_ABE_mid1_tsuchi.txt
Soil
item_cap_tsuchi, way3_tsuchi,
way4_tsuchi, wayl_tsuchi,
way2_tsuchi, way2x2_tsuchi,
room_mid1_6_tsuchi
P2CU item cap tsuchi.jpg P2CU way3 tsuchi.jpg P2CU way4 tsuchi.jpg P2CU wayl tsuchi.jpg P2CU way2 tsuchi.jpg P2CU way2x2 tsuchi.jpg P2CU room mid1 6 tsuchi.jpg
1_ABE_vshit67_toy.txt
Toybox
item_cap_toy, way3_toy,
way4_toy, wayl_toy,
way2_toy, way2x2_toy,
room_vs_hitode6x7_4_toy
P2CU item cap toy.jpg P2CU way3 toy.jpg P2CU way4 toy.jpg P2CU wayl toy.jpg P2CU way2 toy.jpg P2CU way2x2 toy.jpg P2CU room hitode6x7 4 toy.jpg
TBA
TBA
TBA
TBA
Credits: Jimble, Kai