Difference between revisions of "Cave unit generation"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
m (12 revisions imported)
(Changed the formatting a bit and added details and information.)
Line 1: Line 1:
Each cave unit in ''Pikmin 2'' has a SZS file with its settings. Each unit's setting file archive can be found in <code>/user/Mukki/mapunits/arc/*/texts.szs</code>.
+
The caves you see in ''Pikmin 2'' are interesting that it takes individual models and stitches them together to create what you see. The information necessary for this is split between two folders.
 +
==Arc folder==
 +
In <code>/user/Mukki/mapunits/arc/*</code> it contains two SZS archives which contain the bulk of the data. The <code>arc.szs</code> contains the model data in BMD format as well as its corresponding pause menu map texture as an IA BTI texture. The second archive labeled <code>texts.szs</code> contains it's collision, mapcode, route, and waterbox data. Extracting these archives puts them under the same folder called tmp.If you intend to recompile these folders with changes you've made make sure the split up the files according to which SZS archive contained them.
 +
==arc.szs==
  
==grid.bin==
+
===BMD model===
[[Pikmin 2 collision format|Collision file for area models]].
+
BMD models used for caves are particular given that the model typically must be created in chunks that are in 170x170 meters. This consistancy is necessary for the game to be able to correctly place each individual model seamlessly along one another. Some caves may only consist of a single large model. This gives a bit of creative freedom in the sense that the cave will always look the same without the RNG factor of cave generation. Consistant sizes aren't needed here since there is no concern for attaching two models. See [[Custom models|here]] for more information on creating a custom model.
This file is the collision data located where the waterbox and mapcode files are for area maps. Yoshi2's tool obj2grid[https://github.com/RenolY2/obj2grid] converts any .OBJ to a perfectly working <code>grid.bin</code> and <code>mapcode.bin</code> which will work in-game.
+
===texture.bti===
 +
{{todo|Create and link a page that details BTI texture formats.}}
 +
A tiny texture that is used by the game to build the map you see on the pause menu. Each 8x8 pixels represents each 170x170 meters from its corresponding model. It is in an IA compressed BTI format. More information about GameCube's BTI texture formats can be found [http://wiki.tockdom.com/wiki/Image_Formats here].
 +
==text.szs==
 +
===grid.bin===
 +
This holds the [[Pikmin 2 collision format|collision data for area models]]. Yoshi2's tool obj2grid[https://github.com/RenolY2/obj2grid] converts any .OBJ to a working <code>grid.bin</code> and <code>mapcode.bin</code> that will work in-game.
  
==layout.txt==
+
===mapcode.bin===
This file controls the spawn coordinates for objects.
+
Handles extra data assigned to the grid.bin to change the collison's "slipperyiess" and footstep sounds.
 +
{{todo|Create and link a page that details mapcode.bin format.}}
 +
===layout.txt===
 +
{{todo|Create and link a page that details layout.txt format move specific information there.}}
 +
This file controls the spawn coordinates for objects.The second line of the file, which follows the comment <code>BaseGen file</code>, specifies the number of spawn coordinate entries in the list. It is commented with <code>num gens</code> (number of generators).Each entry in the list is inside its own block. The first line in the block is the "type". Think of it as a group.  
  
The second line of the file, which follows the comment <code>BaseGen file</code>, specifies the number of spawn coordinate entries in the list. It is commented with <code>num gens</code> (number of generators).
+
Whenever the game wants to spawn an enemy, it picks a random coordinate from the same group as the enemy is. For instance, static Gatling Groinks should probably belong in a different group from the regular, free-roaming enemies. For a list of group IDs and what they're normally used for (although this is not a hard rule), see [[Cave definition file#Type|here]].
 
 
Each entry in the list is inside its own block.
 
 
 
===Spawn coordinate===
 
The first line in the block is the "type". Think of it as a group. Whenever the game wants to spawn an enemy, it picks a random coordinate from the same group as the enemy is. For instance, static Gatling Groinks should probably belong in a different group from the regular, free-roaming enemies. For a list of group IDs and what they're normally used for (although this is not a hard rule), see [[Cave definition file#Type|here]].
 
  
 
The second line is the coordinates themselves, in the format <code>X Y Z</code>.
 
The second line is the coordinates themselves, in the format <code>X Y Z</code>.
Line 23: Line 30:
 
The fifth and sixth lines are the lower and upper limits of the random amount. Every time the game picks a spawn coordinate to use, it generates a number between these two limits, inclusive. Then, it spawns that number of enemies in this spot (until it spawns more than it intended to, at least).
 
The fifth and sixth lines are the lower and upper limits of the random amount. Every time the game picks a spawn coordinate to use, it generates a number between these two limits, inclusive. Then, it spawns that number of enemies in this spot (until it spawns more than it intended to, at least).
  
==mapcode.bin==
+
===route.txt===
{{todo|Document this.}}
+
Carrying paths plotted in coordinates based off the model.
More Collison.
+
{{todo|Create and link a page that details route.txt format.}}
 +
 
 +
===waterbox.txt===
 +
Water boxes placed as two sets of coordinates to spawn a pool of water.
 +
{{todo|Create and link a page that details waterbox.txt format.}}
  
==route.txt==
+
==Units folder==
Carrying paths.
+
{{todo|Merge this page with [[Cave unit list file]] and rename this page to Cave unit generation?}}
{{todo|Document this.}}
+
This folder <code>/user/Mukki/mapunits/units/*</code> holds definitions that tells the game how to piece together cave models in a simple txt format.
  
==waterbox.txt==
 
Water boxes in the unit.
 
{{todo|Document this.}}
 
  
 
[[Category:Pikmin 2]]
 
[[Category:Pikmin 2]]
 
[[Category:File formats]]
 
[[Category:File formats]]

Revision as of 04:11, 2 June 2018

The caves you see in Pikmin 2 are interesting that it takes individual models and stitches them together to create what you see. The information necessary for this is split between two folders.

Arc folder

In /user/Mukki/mapunits/arc/* it contains two SZS archives which contain the bulk of the data. The arc.szs contains the model data in BMD format as well as its corresponding pause menu map texture as an IA BTI texture. The second archive labeled texts.szs contains it's collision, mapcode, route, and waterbox data. Extracting these archives puts them under the same folder called tmp.If you intend to recompile these folders with changes you've made make sure the split up the files according to which SZS archive contained them.

arc.szs

BMD model

BMD models used for caves are particular given that the model typically must be created in chunks that are in 170x170 meters. This consistancy is necessary for the game to be able to correctly place each individual model seamlessly along one another. Some caves may only consist of a single large model. This gives a bit of creative freedom in the sense that the cave will always look the same without the RNG factor of cave generation. Consistant sizes aren't needed here since there is no concern for attaching two models. See here for more information on creating a custom model.

texture.bti

To do: Create and link a page that details BTI texture formats.

A tiny texture that is used by the game to build the map you see on the pause menu. Each 8x8 pixels represents each 170x170 meters from its corresponding model. It is in an IA compressed BTI format. More information about GameCube's BTI texture formats can be found here.

text.szs

grid.bin

This holds the collision data for area models. Yoshi2's tool obj2grid[1] converts any .OBJ to a working grid.bin and mapcode.bin that will work in-game.

mapcode.bin

Handles extra data assigned to the grid.bin to change the collison's "slipperyiess" and footstep sounds.

To do: Create and link a page that details mapcode.bin format.

layout.txt

To do: Create and link a page that details layout.txt format move specific information there.

This file controls the spawn coordinates for objects.The second line of the file, which follows the comment BaseGen file, specifies the number of spawn coordinate entries in the list. It is commented with num gens (number of generators).Each entry in the list is inside its own block. The first line in the block is the "type". Think of it as a group.

Whenever the game wants to spawn an enemy, it picks a random coordinate from the same group as the enemy is. For instance, static Gatling Groinks should probably belong in a different group from the regular, free-roaming enemies. For a list of group IDs and what they're normally used for (although this is not a hard rule), see here.

The second line is the coordinates themselves, in the format X Y Z.


To do: Document the third line.

The fourth line is the maximum radius in which the enemies can randomly spread out from the initial point.

The fifth and sixth lines are the lower and upper limits of the random amount. Every time the game picks a spawn coordinate to use, it generates a number between these two limits, inclusive. Then, it spawns that number of enemies in this spot (until it spawns more than it intended to, at least).

route.txt

Carrying paths plotted in coordinates based off the model.

To do: Create and link a page that details route.txt format.

waterbox.txt

Water boxes placed as two sets of coordinates to spawn a pool of water.

To do: Create and link a page that details waterbox.txt format.

Units folder

To do: Merge this page with Cave unit list file and rename this page to Cave unit generation?

This folder /user/Mukki/mapunits/units/* holds definitions that tells the game how to piece together cave models in a simple txt format.