Editing Pikmin 2 cave generation

Jump to navigation Jump to search
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 publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{page title|''Pikmin 2'' cave generation}}
[[Cave]]s in {{p2}} are mostly generated [[random]]ly, a process with many moving parts.
[[Cave]]s in {{p2}} are mostly generated [[random]]ly, a process with many moving parts.


== Generation ==
== Generation ==
When a sublevel is entered, the game generates it [[random]]ly; it starts by building random terrain, and then populates it with random objects. All randomness is based on a {{w|random seed}} chosen at the start of generation, and this is a 32-bit number where the highest bit is unused, resulting in 2,147,483,648 possible seeds.
When a sublevel is entered, the game generates it [[random]]ly; it starts by building random terrain, and then populates it with random objects.


===Layout===
===Layout===
A sublevel's terrain is composed of several [[cave unit]]s stitched together. Each unit can be a dead end, a corridor, or a room, and has some spots where objects can spawn; each spot contains data about the amount and type of object that can spawn there. In each sublevel's configuration, there is data about which cave units it is allowed to use, and data about how the dead ends, corridors, and rooms should work in terms of quantities. The game then uses this information to randomly create and connect cave units.
A sublevel's terrain is composed of several [[cave units]] stitched together. Each unit can be a dead end, a corridor, or a room, and has some spots where objects can spawn; each spot contains data about the amount and type of object that can spawn there. In each sublevel's configuration, there is data about which cave units it is allowed to use, and data about how the dead ends, corridors, and rooms should work in terms of quantities. The game then uses this information to randomly create and connect cave units.


===Objects===
===Objects===
Line 40: Line 39:
* The object spawns [[out of bounds]] (spawn points randomly offset the spawned objects by an amount).
* The object spawns [[out of bounds]] (spawn points randomly offset the spawned objects by an amount).


Note that when the sublevel has finished generating, the game may purposely delete some objects for gameplay reasons. This happens to treasures in Story Mode that have already been collected, and Candypop Buds that do not meet the [[Candypop Bud#Maximum Pikmin requirement|maximum Pikmin requirement]].
Note that when the sublevel has finished generating, the game may purposely delete some objects for gameplay reasons. This happens to treasures in Story Mode that have already been collected, and Candypop Buds that do not meet the [[Candypop family#Maximum Pikmin requirement|maximum Pikmin requirement]].


Note also that the algorithm has no logic to figure out if the player can logistically reach and recover a treasure in the cave layout it generates. This is usually no problem, but in Hole of Heroes sublevel 6, it can result in one of the treasures being unobtainable, as explained [[Hole of Heroes#Sublevel 6|here]].
Note also that the algorithm has no logic to figure out if the player can logistically reach and recover a treasure in the cave layout it generates. This is usually no problem, but in Hole of Heroes sublevel 6, it can result in one of the treasures being unobtainable, as explained [[Hole of Heroes#Sublevel 6|here]].
Line 68: Line 67:


;Toybox
;Toybox
: [[File:P2 Lost Toy Box Sublevel 1.png|left|thumb|120px|[[Lost Toy Box]].]] These sublevel designs are in caves such as [[Glutton's Kitchen]] and the [[Dream Den]]. These levels are often filled with giant toys and treasures that are used for food, entertainment, and office supplies. The borders of the sublevels are smaller toys that Pikmin and [[Enemy|enemies]] can cross, but not [[leader]]s, similar to the garden theme. They sometimes can be covered with a large carpet or wood flooring that stretches for the entirety of the floor.
: [[File:Lost Toy Box.png|left|thumb|120px|[[Lost Toy Box]].]] These sublevel designs are in caves such as [[Glutton's Kitchen]] and the [[Dream Den]]. These levels are often filled with giant toys and treasures that are used for food, entertainment, and office supplies. The borders of the sublevels are smaller toys that Pikmin and [[Enemy|enemies]] can cross, but not [[leader]]s, similar to the garden theme. They sometimes can be covered with a large carpet or wood flooring that stretches for the entirety of the floor.
{{clear}}
{{clear}}


Please note that all contributions to Pikipedia are considered to be released under the Attribution-ShareAlike 4.0 International license (see Pikipedia:Copyrights for details). Your changes will be visible immediately. Please enter a summary of your changes above.

Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page: