content asset patches - cheaterbob/CR-Guide GitHub Wiki

Asset patches

Use an assetPatch when the goal is to replace published PNG artwork without creating new gameplay content. A patch targets a stable content ID and maps its public slot names to pack-local PNG files. Mod API v1 does not expose Core audio through assetPatch; pack-local audio remains available on content types that explicitly declare audio fields.

Caution

Do not package the default 4× PNGs from DragonBonesExports/core-enemies as simple replacements. Those images are enlarged for DragonBones and rely on the round-trip sidecar to restore their size. For a 1:1 retexture, use a Pixel preview scale of 1 or resize a default export to 25% with nearest-neighbor/no interpolation. Example: Jenny's 136×188 DragonBones head should be 34×47 for a normal assetPatch.

Keep the replacement canvas at the baseline sprite-region size unless the artwork is deliberately supposed to occupy more space. Files under Unity's Assets/Texture2D may contain transparent padding around the actual sprite region, so their full texture dimensions are not always the dimensions an assetPatch should use.

Minimal example

{
  "schemaVersion": 1,
  "type": "assetPatch",
  "id": "yourname.my-pack:patch/starter-pistol",
  "target": "core:weapon/pistol",
  "replacements": {
    "body": "assets/pistol.png",
    "slide": "assets/slide.png",
    "base": "assets/base.png"
  }
}

The manifest must authorize replacement of each full slot ID:

"overrides": [
  "core:weapon/pistol/body",
  "core:weapon/pistol/slide",
  "core:weapon/pistol/base"
]

This explicit declaration makes replacements reviewable and prevents matching filenames from changing unrelated content.

Multipart enemy example

Target the enemy owner and use its relative body slots when retexturing a Core enemy. Do not use shared core:sprite/... compatibility slots when an enemy-specific slot exists.

{
  "schemaVersion": 1,
  "type": "assetPatch",
  "id": "yourname.jenny-retexture:patch/body",
  "target": "core:enemy/jenny",
  "replacements": {
    "body/l-foot-base": "assets/jenny/left-foot-base.png",
    "body/r-foot-base": "assets/jenny/right-foot-base.png",
    "body/l-foot-end": "assets/jenny/left-foot-end.png",
    "body/r-foot-end": "assets/jenny/right-foot-end.png",
    "body/breast": "assets/jenny/breast.png",
    "body/breast-bg": "assets/jenny/breast-background.png"
  }
}

Authorize the corresponding full IDs in manifest.json, such as core:enemy/jenny/body/l-foot-base. The Core enemy asset-slot catalog lists every exact body part, original sprite name, animation-only variant, and compatibility alias for all 21 Core enemies.

The complete enemy-specific catalog is available in game version 2.2.1 and newer. Packs intended for older builds must use only the slots actually published by that build.

Published slot families

The current Core adapter publishes slots for:

  • weapon pieces and inventory sprites;
  • player body and face artwork by semantic part and skin;
  • clothing icons and semantic rig pieces;
  • selected map machines and props;
  • Core enemy body, rig, and anatomy artwork;
  • reviewed interface, environment, effect, and presentation assets.

The public asset-slot catalog lists the exact IDs. Runtime lookup uses these public IDs, never Unity GUIDs or private hierarchy paths. Legacy-presentation slots are a compatibility layer over reviewed Core sprite names; prefer player, clothing, weapon, enemy, and stage semantic slots when both forms exist.

Every legacy-presentation slot requires its Core baseline to be loaded. The game log reports Core legacy visual slots=<registered>/<advertised> after binding and lists any advertised names unavailable in the current scene. A temporarily unavailable baseline is retried after scene loads and after relevant Core objects start.

Resolution rules

  • A replacement applies only when the target and slot exist, the file is valid, and the manifest authorizes the exact slot ID.
  • A missing or invalid replacement leaves the previously resolved asset active.
  • Two enabled packs targeting the same slot conflict unless the later pack is explicitly authorized under the load-order rules.
  • Disabling a patch restores the baseline asset when the title scene reloads.
  • Filename case and / separators must be portable across supported platforms.
  • A PNG that is entirely black or transparent is still structurally valid. Inspect extracted legacy artwork before packaging; do not assume every changed Unity texture contains authored art.

When not to use a patch

Use an additive weapon, clothing, enemy, or other content definition when the original and new content should coexist. Use a rule profile when behavior changes. Asset patches should not silently carry gameplay changes.

Examples

  • ExampleMods/simple-nerf-gun: three-piece pistol artwork.
  • ExampleMods/cod-wonderweapon: one Core weapon presentation replacement.
  • ExampleMods/goblin-slayer-armor: several Core clothing replacements.
  • ExampleMods/shaded-girl: player artwork slots.
  • ExampleMods/futazombies: Core enemy artwork slots.

See Your first pack for a complete beginner workflow and asset-patch.schema.json in the schema index for the exact contract.

⚠️ **GitHub.com Fallback** ⚠️