Difference between revisions of "Cave generation parameters"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(One intermediate revision by the same user not shown)
Line 92: Line 92:
 
|}
 
|}
  
{{todo|Finish the list of supported objects. ...Or list the unsupported objects, if that ends up being easier.}}
+
Not all objects support this feature. The objects that don't support the feature completely ignore the $ sign and spawn normally. No bosses or plants (besides candypop buds) are changed.  
Not all objects support this feature. Here is a list of known objects that do:
+
 
* Armored Cannon Beetle
+
Here is a list of all other known objects and whether or not they are capable of using this behavior.
* Egg
+
 
* Dwarf Orange Bulborb
+
{| class="wikitable sortable"
* Careening Dirigibug
+
! Enemy || Supported || Notes
* Bomb-rock
+
|-
* Volatile Dweevil
+
| Anode Beetle || Yes ||
* Boulder
+
|-
* Wollywog
+
| Anode Dweevil || Yes ||
* Yellow Wollywog
+
|-
* Anode Beetle
+
| Antenna Beetle || No ||
* Bumbling Snitchbug
+
|-
* Honeywisp
+
| Armored Cannon Beetle Larva (Buried) || No ||
* Queen Candypop Bud
+
|-
* Fiery Blowhog
+
| Armored Cannon Beetle Larva (Free) || Yes ||
* Withering Blowhog
+
|-
* Anode Dweevil
+
| Bomb-rock || Yes ||
* Fiery Dweevil
+
|-
* Caustic Dweevil
+
| Breadbug || No ||
* Swooping Snitchbug
+
|-
* Hairy Bulborb
+
| Bulbmin || Yes ||
* Dwarf Red Bulborb
+
|-
* Fiery Bulblax
+
| Bulborb Larva || Yes || Uses a unique falling animation, the same animation thats used when they are born from the Empress Bulblax.
* Wogpole
+
|-
* Water Dumple
+
| Bumbling Snitchbug || Yes || Floats down from the sky.
* Lesser Spotted Jellyfloat
+
|-
* Munge Dweevil
+
| Careening Dirigibug || Yes || Floats down from the sky.
* Spotty Bulbear
+
|-
 +
| Caustic Dweevil || Yes ||
 +
|-
 +
| Cloaking Burrow-nit || No ||
 +
|-
 +
| Creeping Chrysanthemum || No ||
 +
|-
 +
| Crimson Candypop Bud || Yes ||
 +
|-
 +
| Decorated Cannon Beetle || Yes ||
 +
|-
 +
| Doodlebug || No ||
 +
|-
 +
| Dwarf Bulbear || Yes ||
 +
|-
 +
| Dwarf Orange Bulborb || Yes ||
 +
|-
 +
| Dwarf Red Bulborb || Yes ||
 +
|-
 +
| Egg || Yes  || Breaks upon hitting the ground.
 +
|-
 +
| Electrical Wire || No ||
 +
|-
 +
| Falling Boulder || Yes || Falling boulders sort of float in place for a bit, then fall down at a much quicker speed than normal. If multiple boulders spawn inside of each other, they will bounce off of each other at an angle when they are triggered by the player.
 +
|-
 +
| Female Sheargrub || No  ||
 +
|-
 +
| Fiery Blowhog || Yes  ||
 +
|-
 +
| Fiery Bulblax || Yes  ||
 +
|-
 +
| Fiery Dweevil || Yes  ||
 +
|-
 +
| Fire Geyser || No  ||
 +
|-
 +
| Foxtail || No  ||
 +
|-
 +
| Gas Pipe || No  ||
 +
|-
 +
| Gatling Groink (Both variants) || Yes  ||
 +
|-
 +
| Golden Candypop Bud || Yes  ||
 +
|-
 +
| Greater Spotted Jellyfloat || Yes  || Floats down from the sky.
 +
|-
 +
| Hairy Bulborb || Yes  ||
 +
|-
 +
| Hermit Crawmad || No ||
 +
|-
 +
| Honeywisp || No  ||
 +
|-
 +
| Iridescent Flint Beetle || No  ||
 +
|-
 +
| Iridescent Glint Beetle || No  ||
 +
|-
 +
| Ivory Candypop Bud || Yes  ||
 +
|-
 +
| Lapis Lazuli Candypop Bud || Yes  ||
 +
|-
 +
| Lesser Spotted Jellyfloat || Yes  || Floats down from the sky
 +
|-
 +
| Lithopod Boulder (Unused) || Yes  ||
 +
|-
 +
| Male Sheargrub || No  ||
 +
|-
 +
| Mamuta || No  ||
 +
|-
 +
| Mitite || No  ||
 +
|-
 +
| Munge Dweevil || Yes  ||
 +
|-
 +
| Orange Bulborb || Yes  ||
 +
|-
 +
| Puffy Blowhog || Yes  || Floats down from the sky.
 +
|-
 +
| Queen Candypop Bud || Yes  ||
 +
|-
 +
| Ravenous Whiskerpillar || N/A  || Ravenous Whiskerpillars only work in above ground areas, and it's currently unknown how to give them the falling attribute with their object ID's instead of internal names. It is most likely that they can't use the behavior, because of how complex their AI is compared to other enemies, and how other buried enemies can't use the attribute either.
 +
|-
 +
| Red Bulborb || Yes  ||
 +
|-
 +
| Shearwig || No  ||
 +
|-
 +
| Skitter Leaf || No  ||
 +
|-
 +
| Snow Bulborb || Yes  ||
 +
|-
 +
| Spotty Bulbear || Yes  ||
 +
|-
 +
| Swooping Snitchbug || Yes  || Floats down from the sky.
 +
|-
 +
| Toady Bloyster || No  ||
 +
|-
 +
| Unmarked Spectralids || No  ||
 +
|-
 +
| Violet Candypop Bud || Yes  ||
 +
|-
 +
| Volatile Dweevil || Yes  ||
 +
|-
 +
| Water Dumple || Yes  ||
 +
|-
 +
| Waterwraith Rollers (Unused) || No  ||
 +
|-
 +
| Watery Blowhog || Yes  ||
 +
|-
 +
| Withering Blowhog || Yes  || Floats down from the sky.
 +
|-
 +
| Wogpole || Yes  ||
 +
|-
 +
| Wollywog || Yes  ||
 +
|-
 +
| Yellow Wollywog || Yes  ||
 +
|}
  
 
======Amount======
 
======Amount======
Line 137: Line 249:
 
| 2 || Treasure || 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 || {{unsure|Unused?}} || There is no cave definition file or cave unit definition file that uses this number. ||  
+
| 3 || {{unsure|Unknown}} || There is no cave definition file or cave unit definition file that uses this number. ||  
 
|-
 
|-
| 4 || {{unsure|Unknown}} || || <code>FixObj</code>
+
| 4 || Cave entrance/Geyser || Some cave units use this to spawn in the cave entrance for the next sublevel and for the geyser to appear. Nothing can spawn on here except for the cave entrance/geyser only. || <code>FixObj</code>
 
|-
 
|-
 
| 5 || Enemy, spawns at the entrances of dead ends || No cave unit definition file has a spawn coordinate with this number; the coordinate is likely calculated automatically given how simple and consistent it is. ||  
 
| 5 || Enemy, spawns at the entrances of dead ends || No cave unit definition file has a spawn coordinate with this number; the coordinate is likely calculated automatically given how simple and consistent it is. ||  

Revision as of 05:42, 5 August 2017

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}, which 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). The object spawn process for each sublevel is controlled by the following blocks, and is explained in a bit more detail here.

All notes (Japanese or English statements followed by a #) are unnecessary and it will save file space by deleting them.

FloorInfo

This block has a large number of parameters that determine how the sublevel works. All content in these parameters consist of two words. The first word is a number, 4 for numbers and -1 for strings. The second word is the actual value of the parameter - the one you can modify.


To do: Figure out what happens if you change {f000} and {f001}.

Parameter Description Japanese comment
{f000} The sublevel number this sublevel belongs to, minus 1. For example, if this floor is sublevel 1, the value is 0. Comment translates to "floor introduction". 階はじめ
{f001} Same as above. Comment translates to "floor end". 階おわり
{f002} Maximum enemy number. Enemies in dead ends do not count. 敵最大数
{f003} Maximum treasure number. アイテム最大数
{f004} Maximum gate number. ゲート最大数
{f005} Number of "room" cave units. ルーム数
{f006} Ratio that controls how many corridors there are compared to rooms. ルートの割合
{f007} 1 if this floor has a geyser, 0 otherwise. 帰還噴水(1=あり)
{f008} Cave unit list file name. 使用ユニット
{f009} Lighting definition file name. 使用ライト
{f00A} Skybox. Valid values are: none, f010, vrbox (they all mean none), ice (ice cavern), test (cavern), build (steel), hiroba (garden), flooring (wooden floor), tatami (carpet). VRBOX
{f010} 1 if the next sublevel hole is clogged, 0 otherwise. 階段を壊す岩で隠す(0=オフ 1=オン)
{f011} Unknown.[unsure] Comment translates to "α attribute". α属性
{f012} Music type. 0 for normal, 1 to mute (until a boss), 2 to use rest sublevel music β属性
{f013} 1 if sublevel has an invisible solid plane of ground, generally used for the hiroba, flooring and tatami skyboxes. If 0, Pikmin can fall off the edge to their deaths. 隠し床
{f014} Maximum number of dead ends. キャップ最大数
{f015} Sublevel format version?[unsure] Version
{f016} Time until the Waterwraith appears. BlackManTimer
{f017} 0 is normal, anything else makes it spawn two (connected) seesaw blocks randomly in the level. May spawn the leaders and Pikmin inside one. Unused. 沈む壁

TekiInfo

TekiInfo determines the main objects (enemies) to spawn on the sublevel.

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 how it spawns, 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 (only applicable if the object's type indicates that it's an enemy). The second line of each entry is the type of object.

To note is that if something is wrong with the object's spawn data, the game will probably break down, but it might also trigger an error handler. If it does, the object is turned into a fully-functional Common Glowcap.

Class

The first word in the first line contains the object class (fire geyser, Red Bulborb, clover, etc.), using its internal name (case insensitive). Treasures will not work; use the ItemInfo block for that.

If it is an enemy and is carrying something inside it, the internal name of that object's class is also included in that word, in lowercase, after an underscore (e.g. Chappy_key). In this case, the name of the enemy itself is no longer case insensitive and must be written in CamelCase, although exact casing depends on the object.

Spawn method

Some objects spawn from the sky, like Volatile Dweevils that only appear when you get close to their spawn position. To get an object to do this, write a dollar sign and/or a number before the name of the object, without a space in between. Example: $4BombOtakara. You have to write a specific thing to get a specific behavior, and if you write an invalid one, the game crashes:

Code Effect Notes
$ Always fall if a Pikmin or leader is nearby.
$0 Triggers the Common Glowcap error handler. Unused.
$1 Unknown.[unsure]
$2 Only fall if a Pikmin is nearby, leaders are ignored.
$3 Only fall if a leader is nearby, Pikmin are ignored. Unused.
$4 Only fall if Pikmin are carrying nearby.
$5 Only fall if a Purple causes an earthquake nearby.

Not all objects support this feature. The objects that don't support the feature completely ignore the $ sign and spawn normally. No bosses or plants (besides candypop buds) are changed.

Here is a list of all other known objects and whether or not they are capable of using this behavior.

Enemy Supported Notes
Anode Beetle Yes
Anode Dweevil Yes
Antenna Beetle No
Armored Cannon Beetle Larva (Buried) No
Armored Cannon Beetle Larva (Free) Yes
Bomb-rock Yes
Breadbug No
Bulbmin Yes
Bulborb Larva Yes Uses a unique falling animation, the same animation thats used when they are born from the Empress Bulblax.
Bumbling Snitchbug Yes Floats down from the sky.
Careening Dirigibug Yes Floats down from the sky.
Caustic Dweevil Yes
Cloaking Burrow-nit No
Creeping Chrysanthemum No
Crimson Candypop Bud Yes
Decorated Cannon Beetle Yes
Doodlebug No
Dwarf Bulbear Yes
Dwarf Orange Bulborb Yes
Dwarf Red Bulborb Yes
Egg Yes Breaks upon hitting the ground.
Electrical Wire No
Falling Boulder Yes Falling boulders sort of float in place for a bit, then fall down at a much quicker speed than normal. If multiple boulders spawn inside of each other, they will bounce off of each other at an angle when they are triggered by the player.
Female Sheargrub No
Fiery Blowhog Yes
Fiery Bulblax Yes
Fiery Dweevil Yes
Fire Geyser No
Foxtail No
Gas Pipe No
Gatling Groink (Both variants) Yes
Golden Candypop Bud Yes
Greater Spotted Jellyfloat Yes Floats down from the sky.
Hairy Bulborb Yes
Hermit Crawmad No
Honeywisp No
Iridescent Flint Beetle No
Iridescent Glint Beetle No
Ivory Candypop Bud Yes
Lapis Lazuli Candypop Bud Yes
Lesser Spotted Jellyfloat Yes Floats down from the sky
Lithopod Boulder (Unused) Yes
Male Sheargrub No
Mamuta No
Mitite No
Munge Dweevil Yes
Orange Bulborb Yes
Puffy Blowhog Yes Floats down from the sky.
Queen Candypop Bud Yes
Ravenous Whiskerpillar N/A Ravenous Whiskerpillars only work in above ground areas, and it's currently unknown how to give them the falling attribute with their object ID's instead of internal names. It is most likely that they can't use the behavior, because of how complex their AI is compared to other enemies, and how other buried enemies can't use the attribute either.
Red Bulborb Yes
Shearwig No
Skitter Leaf No
Snow Bulborb Yes
Spotty Bulbear Yes
Swooping Snitchbug Yes Floats down from the sky.
Toady Bloyster No
Unmarked Spectralids No
Violet Candypop Bud Yes
Volatile Dweevil Yes
Water Dumple Yes
Waterwraith Rollers (Unused) No
Watery Blowhog Yes
Withering Blowhog Yes Floats down from the sky.
Wogpole Yes
Wollywog Yes
Yellow Wollywog Yes
Amount

The second word is a number, where the last digit is the spawn distribution weight 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, are 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 Unknown[unsure] There is no cave definition file or cave unit definition file that uses this number.
4 Cave entrance/Geyser Some cave units use this to spawn in the cave entrance for the next sublevel and for the geyser to appear. Nothing can spawn on here except for the cave entrance/geyser only. FixObj
5 Enemy, spawns at the entrances of dead ends No cave unit definition file has a spawn coordinate with this number; the coordinate is likely calculated automatically given how simple and consistent it is.
6 Plant Plant
7 Leader spawn position Objects can't use this as the type. This is only used inside cave unit definitions to specify a possible player starting spot in the cave. The Y coordinate is ignored; it snaps to the ground. Start
8 Enemy, spawn coordinate group C Teki F

Objects can only use types 0, 1, 5, 6, or 8. Objects will not be spawned on a dead end under TekiInfo. To get them to spawn on dead ends, they must be declared in the CapInfo block; here, they can also use type 2.

Example
	{f002} 4 5 	# 敵最大数

(...)

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

Assuming there's enough space in the sublevel, this would make the game spawn 2 Wogpoles, that only pop up from the sky when you get close. Then, it spawns 3 randomly picked enemies, with each enemy having a 3/12 chance of being a Wogpole (like the aforementioned ones, these spawn from the sky), and a 9/12 chance of being a Skitter Leaf that is carrying a Coiled Launcher. 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.

The first number in the block is the total of entries. It is titled num. Each entry consists of one line. This line contains the internal name of the treasure, in all lowercase, and then after a space, the amount to spawn. This amount uses the same scheme as the TekiInfo block, except it is limited by {f003} instead. If you try to spawn something here that is not a treasure, the game will crash.

Example
	{f003} 4 4

(...)

# ItemInfo
{
	3
	key 10
	gold_medal 12
	saru_head 04
}

The game will spawn one The Key and one Lustrous Element, the next two treasures (because {f003} is set to 4), will have a 2/6 chance of being a Lustrous Element, and a 4/6 chance of being a Colossal Fossil.

GateInfo

GateInfo controls what gates will appear. Each individual gate on a sublevel is randomly colored. The game will spawn the number of gates defined in {f004}, but will stop spawning them if there isn't enough room.

The first number in the block is the total of entries. It is titled num.

  1. Each entry consists of two lines.
  2. The first line is the gate's HP. It is titled with life. This line starts with any word (although the word gate is what's used in the vanilla game), and after a space, the amount of hit points it has, with decimal places (e.g. 1000.000000).
  3. The second line is the spawn distribution weight. Only the last digit of this number is used.[unsure] If the number is 0, this type of gate will not spawn at all, of course.
Example

	{f004} 4 2

(...)

# GateInfo
{
	2
	gate 4000.000000
	1
	gate 2500.000000
	1
}

This will spawn two different types of gates of random colours in random locations. The total number of gates appearing in the level is dependent on the value set in {f004}, which in this case is 2 so only two gates will spawn.

CapInfo

CapInfo determines what objects to spawn in dead ends.

The first number in the block is the total number of entries. It is titled num. Each entry consists of three lines.

The logic is the exact same as spawning objects in the TekiInfo block, except for the following things:

  1. Each entry is defined by three. There is an extra line before the usual weight and type lines, which determines, presumably, the type of dead end this spawn applies to. It is titled captype, and always has the value 0.
  2. Objects spawned here appear in dead ends.
  3. Enemies spawned with this block do not count for the enemy limit.
Example
# CapInfo
{
	1
	0
	$2Egg 1
	1
	0
	WhitePom 1
	1
}

This will spawn an egg that will fall down upon spawning and a Ivory Candypop Bud, both in random dead-ends.