Editing Cave generation parameters
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | In ''Pikmin 2'', the files that define a cave's settings can be found in <code>/user/Mukki/mapunits/caveinfo</code>. For instance, the Emergence Cave uses <code>tutorial_1.txt</code> | + | In ''Pikmin 2'', the files that define a cave's settings can be found in <code>/user/Mukki/mapunits/caveinfo</code>. For instance, the Emergence Cave uses <code>tutorial_1.txt</code>. |
− | + | ==Header== | |
+ | Each file starts with a simple block titled <code>CaveInfo</code>. It contains only one parameter, <code>{c000}</code>, with takes two values, a <code>4</code> 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. | |
− | |||
− | Each | + | ==Sublevel== |
+ | Each sublevel starts with a block titled <code>FloorInfo</code> (the comment for the first sublevel has a number to the left of it; this is the [[#Header|number of sublevels]]). | ||
− | + | ===FloorInfo=== | |
+ | This block has a large number of parameters that determine how the sublevel works. | ||
− | { | + | {{todo|List the parameters.}} |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ===TekiInfo=== | |
+ | The next block in the sublevel is titled <code>TekiInfo</code>, and determines the main objects to spawn on the sublevel. | ||
− | + | 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 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. 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 both the object class (fire geyser, Red Bulborb, clover, etc.), using its internal name (case insensitive). | ||
− | + | 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. <code>Chappy_key</code>). The name of the main object itself must also 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: <code>$4BombOtakara</code>. You have to write a specific thing to get a specific behavior, and if you write an unknown one, the game crashes: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
+ | ! Code || Effect || Notes | ||
|- | |- | ||
− | + | | <code>$</code> || Always fall if a Pikmin or leader is nearby. || | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | <code> | + | | <code>$0</code> || Invalid; triggers the Common Glowcap error handler. || '''Unused'''. |
|- | |- | ||
− | | <code> | + | | <code>$1</code> || {{unsure|Unknown.}} || |
|- | |- | ||
− | | <code> | + | | <code>$2</code> || Only fall if a Pikmin is nearby, leaders are ignored. || |
|- | |- | ||
− | | <code> | + | | <code>$3</code> || Only fall if a leader is nearby, Pikmin are ignored. || '''Unused'''. |
|- | |- | ||
− | | <code> | + | | <code>$4</code> || Only fall if Pikmin are carrying nearby. || |
|- | |- | ||
− | | <code> | + | | <code>$5</code> || Only fall if a Purple causes an earthquake nearby. || |
|} | |} | ||
− | + | {{todo|Finish the list of supported objects. ...Or list the unsupported objects, if that ends up being easier.}} | |
− | + | Not all objects support this feature. Here is a list of known objects that do: | |
+ | * Armored Cannon Beetle | ||
+ | * Egg | ||
+ | * Dwarf Orange Bulborb | ||
+ | * Careening Dirigibug | ||
+ | * Bomb-rock | ||
+ | * Volatile Dweevil | ||
+ | * Boulder | ||
+ | * Wollywog | ||
+ | * Yellow Wollywog | ||
+ | * Anode Beetle | ||
+ | * Bumbling Snitchbug | ||
+ | * Honeywisp | ||
+ | * Queen Candypop Bud | ||
+ | * Fiery Blowhog | ||
+ | * Withering Blowhog | ||
+ | * Anode Dweevil | ||
+ | * Fiery Dweevil | ||
+ | * Caustic Dweevil | ||
+ | * Swooping Snitchbug | ||
+ | * Hairy Bulborb | ||
+ | * Dwarf Red Bulborb | ||
+ | * Fiery Bulblax | ||
+ | * Wogpole | ||
+ | * Water Dumple | ||
+ | * Lesser Spotted Jellyfloat | ||
+ | * Munge Dweevil | ||
+ | * Spotty Bulbear | ||
− | The | + | ====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>. | ||
− | + | ====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 <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" | |
− | + | ! Group || Content || Notes || <code>layout.txt</code> comment | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 0 || Enemy, spawn coordinate group A || || <code>Teki A</code> |
|- | |- | ||
− | | <code> | + | | 1 || Enemy, spawn coordinate group B || || <code>Teki B</code> |
|- | |- | ||
− | | <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. || |
|- | |- | ||
− | | <code> | + | | 4 || {{unsure|Unknown}} || || <code>FixObj</code> |
|- | |- | ||
− | | | + | | 5 || Enemy, spawns in 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. || |
|- | |- | ||
− | | <code> | + | | 6 || Plant || || <code>Plant</code> |
|- | |- | ||
− | | | + | | 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. || <code>Start</code> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 8 || Enemy, spawn coordinate group C || || <code>Teki F</code> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | | | ||
− | | | ||
− | |||
− | | | ||
|} | |} | ||
− | + | Enemies can only use types 0, 1, 6, or 8. | |
− | |||
− | + | ====Example==== | |
+ | <pre> | ||
+ | {f002} 4 5 # 敵最大数 | ||
− | + | (...) | |
− | + | # TekiInfo | |
− | + | { | |
+ | 2 # num | ||
+ | $Tadpole 23 # weight | ||
+ | 0 # type | ||
+ | Sokkuri_bane 9 # weight | ||
+ | 1 # type | ||
+ | } | ||
+ | </pre> | ||
− | + | 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 (three in twelve because 3 + 9 = 12) 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 <code>ItemInfo</code>. It controls how treasures spawn. Treasures inside enemies aren't included here. | ||
− | {{ | + | {{todo|Expand.}} |
− | === | + | ===GateInfo=== |
− | + | The next block is titled <code>GateInfo</code> and controls what gates will appear. | |
− | + | {{todo|Expand.}} | |
− | The | + | ===CapInfo=== |
+ | The final block in a sublevel is titled <code>CapInfo</code>. It determines what objects to spawn in dead ends. | ||
− | {| | + | {{todo|Expand.}} |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Pikmin 2]] | [[Category:Pikmin 2]] | ||
[[Category:File formats]] | [[Category:File formats]] |