Skip to content

WasiCore Game Scaffold ​

Use this skill before creating a new game or large gameplay prototype. The goal is to start from the smallest matching sample, not from a blank IGameClass.

If the user has only an editor installation or a newly generated project that has never run, begin with sce-first-game for creation, authorization and the first connected run; use this skill to choose its gameplay starting point.

If the request is still phrased only as "2D game" or "3D game", first read skills/wasicore-game-architecture/SKILL.md. Choose architecture by Unit/Ability, direct GameGraph, or Canvas/GameUI route rather than by visual dimension.

When creating a playable game rather than a focused API demonstration, also read game-visual-production. Name a visual direction and build one representative playable scene with its HUD before multiplying levels, enemies, or features. Match the user's reference in composition, asset identity, materials, and feedback; architecture choice alone does not establish visual quality.

First Decision ​

User GoalStart FromRead First
Full-screen Canvas/GameUI drawn gameplay: casual, card, grid, arcade, board, HUD-heavycode_sample/src/FlappyBirdGame, Game2048, MarioGame, SandtrisGameskills/canvas-2d-game/SKILL.md
SCE Unit/Ability gameplay: characters, monsters, skills, HP, AI, targeting, tower defense, ARPG, survivorcode_sample/src/VampireSurvivors3D, TowerDefenseGame, ARPGTemplateskills/3d-unit-game/SKILL.md
Battle royale / survival arena with poison circle, level-up talents, ranking UImap_templates/battle_grounds_templateskills/3d-unit-game/SKILL.md + skills/data-editor/SKILL.md + skills/trigger-editor-mcp/SKILL.md
Pure client visual preview, GameGraph scene, render-to-texture, UI toolcode_sample/src/RendererViewportSample, RuntimeParticleBuilderSampleskills/client-only-debug/SKILL.md
Direct SceneGraph mini-game, local 3D physics, non-Unit GameSystemUI movementcode_sample/src/BlackHoleSampleskills/client-scenegraph-game/SKILL.md
Client-local top-down shooter with independently aimed upper body, moving 3D projectiles, enemy waves and game-over UImap_templates/gamegraph_top_down_pve_templateclient-scenegraph-game + game-visual-production
Multiplayer with smooth moving objectscode_sample/src/HybridFlappyBird, PropertyHostSampleskills/multiplayer-hybrid-sync/SKILL.md
Server-authoritative non-Unit physics objectscode_sample/src/FallGuysGame plus server physics guideskills/server-authoritative-3d-physics/SKILL.md
Runtime particle effect prototypecode_sample/src/RuntimeParticleBuilderSampleskills/runtime-particle-builder/SKILL.md

Use docs/examples-index.md to locate exact sample directories and key files. If a sample disagrees with a skill, follow the skill.

battle_grounds_template is a full editor project template, not a small code_sample folder. Most of its gameplay is authored in GameData and trigger JSON: poison circle, three-choice talents, experience drops, ranking sync, and Buff pools. When adapting it, inspect the template README plus editor/data/** and editor/trigger/**; do not copy only the C# bootstrap files.

gamegraph_top_down_pve_template is a complete client-local visual/gameplay reference. Read its README before adapting; its mechanical characters use static articulated parts and its rifle is a normal child mesh, not a rigged humanoid or automatic weapon attachment example. Its projectile collision and enemy state run locally. Preserve the chosen project's authority model when reusing its visual patterns; multiplayer needs a separate authority/synchronization design.

game_entry Is Minimal, Not UI-Empty ​

The current game_entry template contains a client trigger named 游戏开始时初始化. By default it calls:

  • GameSystemUI.Utility.CreateAndEnableMoveControl(...)
  • GameSystemUI.Utility.CreateAndEnableAbilityJoyStick(...)

These calls create the default movement control and ability joystick. If the user wants a project with no default GameSystemUI controls, remove the two actions in the trigger editor. If 游戏开始时初始化 still contains only those actions, the whole client trigger can be deleted. For AI-assisted removal, use trigger-editor-mcp; inspect the trigger first, preserve any unrelated initialization the user has added, save through trigger_save, and never edit editor/trigger/**/*.json directly.

Scaffold Rules ​

  • Keep the existing MapGameMode unless the task explicitly needs multiple modes.
  • Do not copy DataGenerated/, TriggerGenerated/, bin/, or obj/.
  • Copy only the smallest set of source files needed for the pattern, then rename namespaces/classes.
  • Preserve #if CLIENT / #if SERVER boundaries.
  • For static GameData, prefer the authoring route already used by the project. Do not patch src/DataGenerated.
  • Build both Server-Debug and Client-Debug.
  • Run sce-preview-verify when the scaffold has visible behavior.
  • For a game deliverable, perform a visual improvement pass after the initial sample runs: scene composition, coherent assets/materials, readable themed HUD, and observable hit/death/restart feedback. Capture the resulting normal gameplay view and relevant close-up or motion sequence; a non-black screenshot alone is a rendering check.

Minimal Project Shape ​

For a new hand-written C# scaffold:

  1. Add one feature directory under src/.
  2. Add one main class implementing IGameClass or following the chosen sample base pattern.
  3. Register from OnRegisterGameClass().
  4. Gate initialization by current game mode:
csharp
if (Game.GameModeLink != ScopeData.GameDataGameMode.MapGameMode) return;
  1. Put rendering/UI/input under #if CLIENT.
  2. Put authoritative gameplay state under #if SERVER.

When To Avoid A Heavy Template ​

Do not introduce a large game template when the user only needs one subsystem. Examples:

  • Need a particle: use runtime-particle-builder, not ARPG.
  • Need a menu: use ui-layout-api, not Game2048.
  • Need smooth multiplayer movement: use multiplayer-hybrid-sync, not a full game clone.
  • Need model/animation choice: use sce-resource-picker, not a full 3D sample.

Deliverable Checklist ​

  • [ ] The chosen starting sample is named.
  • [ ] Only relevant files were copied or recreated.
  • [ ] Server-Debug and Client-Debug compile.
  • [ ] Runtime preview or screenshot evidence exists for visible behavior.
  • [ ] A game deliverable has an intentional scene/HUD direction and inspected gameplay, motion, and failure/restart evidence appropriate to its mechanics.
  • [ ] Any intentionally skipped systems are listed for follow-up.