Difference between revisions of "Cave generation parameters"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
Line 15: Line 15:
  
 
===TekiInfo===
 
===TekiInfo===
The next block in the sublevel is titled <code>TekiInfo</code>, and determines what enemies to spawn.
+
The next block in the sublevel is titled <code>TekiInfo</code>, and determines what enemies &ndash; or other objects &ndash; to spawn.
  
The first number in the block is the total of entries. It is titled <code>num</code>. Each entry consists of two lines. The first line in an entry determines the enemy's type, what object it has inside, how many to spawn, and how likely this enemy is to be used to fill the enemy slots. The second line of each entry is the type of spawn coordinate to pick from.
+
The first number in the block is the total of entries. It is titled <code>num</code>. Each entry consists of two lines. The first line in an entry determines the object's class, what treasure it has inside, how many to spawn, and how likely this object is to be used to fill the enemy slots. The second line of each entry is the type of object.
  
====Enemy type====
+
====Class====
The first word in the first line contains both the enemy type (using its internal name, starting with an uppercase), and, if the enemy is carrying something inside it, the internal name of the object, after an underscore.
+
The first word in the first line contains both the object class (using its internal name, starting with an uppercase), and, if it is an enemy and is carrying something inside it, the internal name of that object, after an underscore.
  
====Enemy amount====
+
====Amount====
 
The second word is a number, where the last digit is the spawn distribution weight (ranges from 0 to 9, explained [[Cave enemy spawning|here]]) and the other digits are the minimum amount to spawn. If only one digit is present, that determines the distribution weight, and the minimum amount defaults to 0. A distribution weight of 0 means that the game will only spawn the minimum amount and no more. This line is commented with <code>weight</code>.
 
The second word is a number, where the last digit is the spawn distribution weight (ranges from 0 to 9, explained [[Cave enemy spawning|here]]) and the other digits are the minimum amount to spawn. If only one digit is present, that determines the distribution weight, and the minimum amount defaults to 0. A distribution weight of 0 means that the game will only spawn the minimum amount and no more. This line is commented with <code>weight</code>.
  
====Spawn coordinate type====
+
====Type====
This number controls where the enemy spawns. The number ranges from 0 to 8, and it determines which group of spawn coordinates to choose from when deciding where to spawn the enemy. This line is commented with <code>type</code>. Some objects can only belong to specific groups. The following table lists the numbers, and the comments on the various [[Cave unit definition file|unit layout files]], in <code>/user/Mukki/mapunits/arc/*/texts.szs/layout.txt</code>, is also included due to them helping understand what each number means.
+
This number controls what type of object this is, and where it spawns. The number ranges from 0 to 8, and most also correspond to a group of spawn coordinates. When spawning an instance of this object, the game picks a random coordinate from the group, if applicable. This line is commented with <code>type</code>. The following table lists the possible numbers, and the comments on the various [[Cave unit definition file|unit layout files]], in <code>/user/Mukki/mapunits/arc/*/texts.szs/layout.txt</code>, is also included due to them helping understand what each number means.
  
 
{| class="wikitable"
 
{| class="wikitable"
 
! Group || Content || Notes || <code>layout.txt</code> comment
 
! Group || Content || Notes || <code>layout.txt</code> comment
 
|-
 
|-
| 0 || Enemies, group A || || <code>Teki A</code>
+
| 0 || Enemy, spawn coordinate group A || || <code>Teki A</code>
 
|-
 
|-
| 1 || Enemies, group B || || <code>Teki B</code>
+
| 1 || Enemy, spawn coordinate group B || || <code>Teki B</code>
 
|-
 
|-
| 2 || Treasures || There is no cave definition file that uses this number. || <code>Item</code>
+
| 2 || Treasure || There is no cave definition file that uses this number. || <code>Item</code>
 
|-
 
|-
 
| 3 || '''Unused''' || There is no cave definition file or cave unit definition file that uses this number. ||  
 
| 3 || '''Unused''' || There is no cave definition file or cave unit definition file that uses this number. ||  
Line 41: Line 41:
 
| 4 || {{unsure|Unknown}} || || <code>FixObj</code>
 
| 4 || {{unsure|Unknown}} || || <code>FixObj</code>
 
|-
 
|-
| 5 || {{unsure|Dead ends}} || Used in some cave definition files, but not used in any cave unit definition file. ||  
+
| 5 || Enemy, spawns in dead ends || Used in some cave definition files, but not used in any cave unit definition file. ||  
 
|-
 
|-
| 6 || Plants || || <code>Plant</code>
+
| 6 || Plant || || <code>Plant</code>
 
|-
 
|-
 
| 7 || {{unsure|Leader spawn position?}} || || <code>Start</code>
 
| 7 || {{unsure|Leader spawn position?}} || || <code>Start</code>
 
|-
 
|-
| 8 || Enemies, group C || || <code>Teki F</code>
+
| 8 || Enemy, spawn coordinate group C || || <code>Teki F</code>
 
|}
 
|}
  

Revision as of 23:59, 18 October 2016

In Pikmin 2, the files that define a cave's settings can be found in /user/Mukki/mapunits/caveinfo. For instance, the Emergence Cave uses tutorial_1.txt.

Header

Each file starts with a simple block titled CaveInfo. It contains only one parameter, {c000}, with takes two values, a 4 and the number of sublevels in the cave.

After the opening block, there is a lone number. This number is, once again, the number of sublevels in the cave. After this comes a series of blocks, with each group of 5 belonging to a sublevel.

Sublevel

Each sublevel starts with a block titled FloorInfo (the comment for the first sublevel has a number to the left of it; this is the number of sublevels).

FloorInfo

This block has a large number of parameters that determine how the sublevel works.


To do: List the parameters.

TekiInfo

The next block in the sublevel is titled TekiInfo, and determines what enemies – or other objects – to spawn.

The first number in the block is the total of entries. It is titled num. Each entry consists of two lines. The first line in an entry determines the object's class, what treasure it has inside, how many to spawn, and how likely this object is to be used to fill the enemy slots. The second line of each entry is the type of object.

Class

The first word in the first line contains both the object class (using its internal name, starting with an uppercase), and, if it is an enemy and is carrying something inside it, the internal name of that object, after an underscore.

Amount

The second word is a number, where the last digit is the spawn distribution weight (ranges from 0 to 9, explained here) and the other digits are the minimum amount to spawn. If only one digit is present, that determines the distribution weight, and the minimum amount defaults to 0. A distribution weight of 0 means that the game will only spawn the minimum amount and no more. This line is commented with weight.

Type

This number controls what type of object this is, and where it spawns. The number ranges from 0 to 8, and most also correspond to a group of spawn coordinates. When spawning an instance of this object, the game picks a random coordinate from the group, if applicable. This line is commented with type. The following table lists the possible numbers, and the comments on the various unit layout files, in /user/Mukki/mapunits/arc/*/texts.szs/layout.txt, is also included due to them helping understand what each number means.

Group Content Notes layout.txt comment
0 Enemy, spawn coordinate group A Teki A
1 Enemy, spawn coordinate group B Teki B
2 Treasure There is no cave definition file that uses this number. Item
3 Unused There is no cave definition file or cave unit definition file that uses this number.
4 Unknown[unsure] FixObj
5 Enemy, spawns in dead ends Used in some cave definition files, but not used in any cave unit definition file.
6 Plant Plant
7 Leader spawn position?[unsure] Start
8 Enemy, spawn coordinate group C Teki F

Enemies can only use types 0, 1, 6, or 8.

Example

	{f002} 4 5 	# 敵最大数

(...)

# TekiInfo
{
	2 	# num
	Tadpole 23 	# weight
	0 	# type
	Sokkuri 9 	# weight
	1 	# type
}

Assuming there's enough space in the sublevel, this would make the game spawn 2 Wogpoles, and then spawn 3 more randomly picked enemies, with each enemy having a 3/12 chance (three in twelve because 3 + 9 = 12) of being a Wogpole, and a 9/12 chance of being a Skitter Leaf. Any Wogpole in this sublevel will spawn in the set of coordinates that belong to group 0, whereas any Skitter Leaf will spawn on the coordinates of group 1.

ItemInfo

The next block is titled ItemInfo. It controls how treasures spawn. Treasures inside enemies aren't included here.


To do: Expand.

GateInfo

The next block is titled GateInfo and controls what gates will appear.


To do: Expand.

CapInfo

The final block in a sublevel is titled CapInfo. It determines what objects to spawn in dead ends.


To do: Expand.