Skip to main content

Shape Codes

CategoryWorld
Category
World

Overview

Shape Codes are the textual representation of shapes in Shapez 2. They are compact strings that encode every layer, part type, and color of a shape so shapes can be copied, pasted, transmitted between machines, stored in blueprints, or shared outside the game. Shape Codes list layers from bottom to top, with each layer separated by a colon (:). Each part in a layer is represented by two characters: the first character is the part type code and the second is the color code. Parts in a layer are written starting from the top-right quadrant and proceeding clockwise without any separators.

The game supports different Shapes Configurations that determine how many parts are in each layer. The Quad configuration uses 4 parts per layer (the default), while the Hex configuration uses 6 parts per layer. Flexible rules allow shapes to contain parts from any configuration and any number of parts per layer (as long as all layers have the same number of parts), but the Strict ruleset requires shapes to match the current Scenario’s configuration and part count. Shape Codes themselves do not enforce a ruleset; validation of a Shape Code input is performed against the active ruleset when needed.

Part type and color characters are drawn from the in-game code tables. Part type codes include entries such as C (circle), R (square), S (star), W (diamond), X/Y (refined/exotic shapes), H/F/G (hex-specific types), P (pin), c (crystal), and - (empty). Color codes include u (uncolored), r (red), g (green), b (blue), c (cyan), m (magenta), y (yellow), w (white), and k (black). For part types that cannot have a color (for example pins or empty quadrants), the color character is -, so a pin is encoded as P- and an empty quadrant as --. For types that can have color, the second character is one of the color characters above (for example Cu represents a circle that is uncolored, Cr is a circle colored red).

Shape Codes are used throughout simulated device examples and machine logic. For example, a two-layer shape with a bottom layer of four circles all uncolored and a top layer of four squares all uncolored is written as CuCuCuCu:RuRuRuRu. Single-layer shapes omit the colon and upper layers, e.g., CuCuCuCu encodes a single quad layer of uncolored circles.

Practical notes and constraints:

  • When creating shapes from a Shape Code, layers beyond the maximum allowed by the current Scenario can be present in the created shape; these extra layers remain until the shape passes through a machine that applies Shape Gravity Rules, at which point excess layers get deleted as appropriate.
  • The ordering inside a layer is fixed: top-right then clockwise. This affects rotations and other operations that manipulate parts by position.
  • Parts that cannot have color must use - as the color character. Crystals keep their color once created and are encoded with the crystal type code c followed by a color.
  • Shape validation depends on the active ruleset: the Strict ruleset enforces the Scenario’s configuration and layer part count, while the Flexible ruleset permits different configurations as long as all layers have the same number of parts.
  • The character tables for part types and colors are the authoritative source for valid characters used in Shape Codes; consult those tables when constructing or parsing codes.

Other entities of this type

Related pages

Last updated: