Editing Cave spawning

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 6: Line 6:
 
The game...
 
The game...
 
# Spawns the minimum amounts of objects requested by each [[Cave generation parameters#Entry|entry]] of the main category.
 
# Spawns the minimum amounts of objects requested by each [[Cave generation parameters#Entry|entry]] of the main category.
# Spawns random filler objects from the same entries, until it reaches the limit in [[Cave generation parameters#FloorInfo|parameter <code>{f002}</code>]]. The way it picks these entries in particular is complex, but one important note is that different entries have a different chance of being picked, controlled by the [[#Weight distribution|random weight distribution]].
+
# Spawns random filler objects from the same entries, until it reaches the limit in [[Cave generation parameters#FloorInfo|property <code>{f002}</code>]]. The way it picks these entries in particular is complex, but one important note is that different entries have a different chance of being picked, controlled by the [[#Weight distribution|random weight distribution]].
 
# Spawns the minimum amounts required by entries from the decorative category.
 
# Spawns the minimum amounts required by entries from the decorative category.
 
# Spawns the minimum amounts required by entries from the treasure category
 
# Spawns the minimum amounts required by entries from the treasure category
# Spawns random filler objects from the same entries (also with weights), until it reaches the limit in parameter <code>{f003}</code>.
+
# Spawns random filler objects from the same entries (also with weights), until it reaches the limit in property <code>{f003}</code>.
# Spawns the minimum amounts required by entries from the dead end category (non-falling and Candypop Buds).
+
# Spawns the minimum amounts required by entries from the primary dead end category.
 
# Spawns random filler objects from the same entries, until it runs out of possible dead ends.
 
# Spawns random filler objects from the same entries, until it runs out of possible dead ends.
# Spawns the minimum amounts required by entries from the dead end category (all other entries).
+
# Spawns the minimum amounts required by entries from the secondary dead end category.
 
# Spawns random filler objects from the same entries, until it runs out of possible dead ends.
 
# Spawns random filler objects from the same entries, until it runs out of possible dead ends.
# Spawns random filler objects from the gate category (also with weights), until it reaches the limit in parameter <code>{f004}</code>.
+
# Spawns random filler objects from the gate category (also with weights), until it reaches the limit in property <code>{f004}</code>.
  
 
== Process ==
 
== Process ==
Line 146: Line 146:
 
# If we haven't spawned all necessary minimum amounts for objects of the set, then:
 
# If we haven't spawned all necessary minimum amounts for objects of the set, then:
 
## Pick an entry whose minimum amounts haven't been met yet. Prioritize the order in the sublevel configuration file.
 
## Pick an entry whose minimum amounts haven't been met yet. Prioritize the order in the sublevel configuration file.
## If the entry is of the "type" 0, and if we can spawn two of these without going over the entry's minimum amount:
+
## If the entry is of the spawn type 0, and if we can spawn two of these without going over the entry's minimum amount:
 
### Pick this one, returning 2 as the amount.
 
### Pick this one, returning 2 as the amount.
 
## Otherwise:
 
## Otherwise:
Line 152: Line 152:
 
# Otherwise, if there are entries in the set with any weight, then:
 
# Otherwise, if there are entries in the set with any weight, then:
 
## Pick an entry in the set using [[#Weighted distribution|weighted randomness]], using the weights of the entries in the set.
 
## Pick an entry in the set using [[#Weighted distribution|weighted randomness]], using the weights of the entries in the set.
## If the entry is of the "type" 0, pick this one, returning 2 as the amount.
+
## If the entry is of the spawn type 0, pick this one, returning 2 as the amount.
 
## Otherwise, pick this one, returning 1 as the amount.
 
## Otherwise, pick this one, returning 1 as the amount.
 
# Otherwise:
 
# Otherwise:
Line 159: Line 159:
  
 
=== Notes ===
 
=== Notes ===
 +
{{todo|Confirm that 0-radius claim.}}
 
* If a spawn coordinate has a radius of 0, all objects to spawn will be placed in the same spot, and will physically push each other apart. Otherwise, the objects will be forced to maintain a fixed minimum distance from one another, even if that distance will push them beyond the spawn coordinate's radius.
 
* If a spawn coordinate has a radius of 0, all objects to spawn will be placed in the same spot, and will physically push each other apart. Otherwise, the objects will be forced to maintain a fixed minimum distance from one another, even if that distance will push them beyond the spawn coordinate's radius.
 
* If an object would spawn out of bounds, it will fail to spawn. This can happen if its spawn point is out of bounds, if it got pushed out of bounds due to the [[#Spawn type 0 algorithm|spawn type 0 algorithm]], etc.
 
* If an object would spawn out of bounds, it will fail to spawn. This can happen if its spawn point is out of bounds, if it got pushed out of bounds due to the [[#Spawn type 0 algorithm|spawn type 0 algorithm]], etc.

Please note that all contributions to Pikmin Technical Knowledge Base are considered to be released under the Creative Commons Attribution-ShareAlike (see Pikmin Technical Knowledge Base:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: