AgentSkillsCN

content-placement

在游戏内容与平台代码之间合理划分职责。当您需要创建新文件,或迁移现有代码时,这一原则将为您提供清晰的指导。

SKILL.md
--- frontmatter
name: content-placement
description: Where to place game content vs platform code. Use when creating new files or moving existing code.

Content Placement Rules

The Sparkling Farce separates platform code from game content. This is fundamental to the mod system.

The Golden Rule

Game content NEVER goes in core/. The base game is just a mod.

Directory Structure

code
sparklingfarce/
├── core/                    # Platform code ONLY
│   ├── systems/             # Autoload singletons
│   ├── resources/           # Resource class definitions
│   ├── components/          # Reusable node components
│   ├── registries/          # Type registries
│   ├── mod_system/          # ModLoader, ModRegistry
│   └── utils/               # Utility functions
│
├── mods/                    # ALL game content
│   ├── demo_campaign/       # Demo content (priority 100)
│   │   ├── mod.json
│   │   ├── data/
│   │   │   ├── characters/
│   │   │   ├── items/
│   │   │   ├── abilities/
│   │   │   ├── battles/
│   │   │   └── ...
│   │   ├── maps/
│   │   ├── cinematics/
│   │   └── assets/
│   │
│   ├── _platform_defaults/  # Core fallbacks (priority -1)
│   └── _starter_kit/        # Development assets
│
└── scenes/                  # UI scenes, battle scenes, etc.

What Goes Where

Content TypeLocationExample
Character definitionsmods/*/data/characters/max.tres, sarah.tres
Item definitionsmods/*/data/items/wooden_sword.tres
Ability definitionsmods/*/data/abilities/fireball.tres
Battle configurationsmods/*/data/battles/intro_battle.tres
Map metadatamods/*/data/maps/hometown.tres
Dialoguemods/*/data/dialogues/intro_dialogue.tres
Cinematicsmods/*/cinematics/opening.json
Character spritesmods/*/assets/characters/max.png
Tilesetsmods/*/tilesets/forest.tres
Audiomods/*/audio/battle_theme.ogg

What Goes in core/

Content TypeLocationExample
Resource class scriptscore/resources/character_data.gd
Manager singletonscore/systems/battle_manager.gd
Reusable componentscore/components/unit.gd
Type registriescore/registries/equipment_registry.gd
Utility functionscore/utils/dict_utils.gd

Mod Priority System

Priority RangeUse For
-1 to -100Platform defaults (fallbacks)
0 to 99Official content
100 to 8999User mods
9000+Total conversions

Higher priority mods override lower priority ones for the same resource ID.

Creating New Content

  1. New character?mods/demo_campaign/data/characters/
  2. New item?mods/demo_campaign/data/items/
  3. New resource type?core/resources/ (class definition only)
  4. New manager?core/systems/
  5. New UI component?scenes/ui/components/

Testing Content

Use mods/_sandbox/ for experimental content that shouldn't ship:

code
mods/_sandbox/
├── mod.json           # priority: 9999 (loads last, overrides everything)
└── data/
    └── characters/
        └── test_hero.tres