Difference between revisions of "Cave unit layout file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Document line 3)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{todo|Fix up this page's format.}}
+
In ''Pikmin 2'', each cave unit has a <code>layout.txt</code> file, which controls the spawn coordinates for objects and a few other special things. These can be found in <code>/user/Mukki/mapunits/arc/*/arc.szs/tmp/layout.txt</code>.
This file controls the spawn coordinates for objects. The second line of the file, which follows the comment <code>BaseGen file</code>, specifies the number of spawn coordinate entries in the list. It is commented with <code>num gens</code> (number of generators).Each entry in the list is inside its own block. The first line in the block is the "type". Think of it as a group.  
 
  
Whenever the game wants to spawn an enemy, it picks a random coordinate from the same group as the enemy is. For instance, static Gatling Groinks should probably belong in a different group from the regular, free-roaming enemies. For a list of group IDs and what they're normally used for (although this is not a hard rule), see [[Cave definition file#Type|here]].
+
== Format ==
  
The second line is the coordinates themselves, in the format <code>X Y Z</code>.
+
=== Header ===
 +
The first value in the file specifies the number of spawn coordinate entries this cave unit has. In the canon files, it is commented with <code>num gens</code> ("number of generators"), and is on the second line, since the first line has the comment, <code>BaseGen file</code>.
  
{{todo|Document the third line.}}
+
After the header follows the list of entries.
  
The fourth line is the maximum radius in which the enemies can randomly spread out from the initial point.
+
=== Entry ===
 +
Each entry in the list is inside its own block, delimited with <code>{</code> and <code>}</code>.
  
The fifth and sixth lines are the lower and upper limits of the random amount. Every time the game picks a spawn coordinate to use, it generates a number between these two limits, inclusive. Then, it spawns that number of enemies in this spot (until it spawns more than it intended to, at least).
+
The first line in the block is the "type of coordinate". Only objects that match this type can spawn here. For a list of type IDs and what they're normally used for (although this is not a hard rule), see [[Cave definition file#Type|here]].
 +
 
 +
The second line is the coordinates themselves, in the format <code>X Y Z</code>. The coordinates are based on the cave unit, not the world coordinates.
 +
 
 +
The third line is the angle spawned objects will face, given in degrees.
 +
 
 +
The fourth line is the maximum radius in which the objects can randomly spread out from the initial point. Whenever an object chooses to spawn here, it randomly spreads out from the exact coordinates, using this information.
 +
 
 +
The fifth and sixth lines are the lower and upper limits of the random amount, respectively. Every time the game picks a spawn coordinate to use, it generates a number between these two limits, inclusive. Then, it spawns that number of objects in this spot (until it spawns more than it intended to, at least).
 +
 
 +
[[Category:Pikmin 2]]
 +
[[Category:File formats]]

Latest revision as of 15:21, 5 August 2021

In Pikmin 2, each cave unit has a layout.txt file, which controls the spawn coordinates for objects and a few other special things. These can be found in /user/Mukki/mapunits/arc/*/arc.szs/tmp/layout.txt.

Format[edit]

Header[edit]

The first value in the file specifies the number of spawn coordinate entries this cave unit has. In the canon files, it is commented with num gens ("number of generators"), and is on the second line, since the first line has the comment, BaseGen file.

After the header follows the list of entries.

Entry[edit]

Each entry in the list is inside its own block, delimited with { and }.

The first line in the block is the "type of coordinate". Only objects that match this type can spawn here. For a list of type IDs and what they're normally used for (although this is not a hard rule), see here.

The second line is the coordinates themselves, in the format X Y Z. The coordinates are based on the cave unit, not the world coordinates.

The third line is the angle spawned objects will face, given in degrees.

The fourth line is the maximum radius in which the objects can randomly spread out from the initial point. Whenever an object chooses to spawn here, it randomly spreads out from the exact coordinates, using this information.

The fifth and sixth lines are the lower and upper limits of the random amount, respectively. Every time the game picks a spawn coordinate to use, it generates a number between these two limits, inclusive. Then, it spawns that number of objects in this spot (until it spawns more than it intended to, at least).