Replicate and HuggingFace APIs for Spawn3D are back online. 🎉

Sprite Generation

Spawn's Sprite Generation system provides a robust, layered approach to constructing 2D characters from customizable parts. Leveraging open-source artwork (e.g., the Liberated Pixel Cup base assets) and an advanced layer-mapping engine, developers can rapidly prototype characters with unique body types, outfits, accessories, and animations.

Layered Architecture & Data Model

Multi-Layer Composition

Each character sprite is composed of multiple layers (body, hair, clothes, accessories, etc.). Layers stack in a specific z-position order so that, for instance, a belt draws over pants, while a cape draws behind the torso.

Data Structures

  • ILayer: Defines each asset layer with a zPos (render priority) and separate image references for each body type (male, female, muscular, etc.).
  • ISpritesheetMap: Groups all layers under a named entry (e.g., "Warrior_SpriteSet") with a master list of variants, whether the layer should match body color, and optional preview rows.
  • BodyTypes: Enumerates valid base body forms (e.g., "male", "female", "child", "zombie").
  • CharacterTraitsType: Enumerates all possible clothing, hair, or accessory categories (e.g., "hair", "armour", "belt"), ensuring the pipeline knows how to place them.

Layer Enforcement

The layering logic ensures no conflicts (e.g., no body hair layer behind the body). If a user selects multiple items that occupy the same layer, the system either merges them or respects a higher/lower zPos.