主题
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 Goal | Start From | Read First |
|---|---|---|
| Full-screen Canvas/GameUI drawn gameplay: casual, card, grid, arcade, board, HUD-heavy | code_sample/src/FlappyBirdGame, Game2048, MarioGame, SandtrisGame | skills/canvas-2d-game/SKILL.md |
| SCE Unit/Ability gameplay: characters, monsters, skills, HP, AI, targeting, tower defense, ARPG, survivor | code_sample/src/VampireSurvivors3D, TowerDefenseGame, ARPGTemplate | skills/3d-unit-game/SKILL.md |
| Battle royale / survival arena with poison circle, level-up talents, ranking UI | map_templates/battle_grounds_template | skills/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 tool | code_sample/src/RendererViewportSample, RuntimeParticleBuilderSample | skills/client-only-debug/SKILL.md |
| Direct SceneGraph mini-game, local 3D physics, non-Unit GameSystemUI movement | code_sample/src/BlackHoleSample | skills/client-scenegraph-game/SKILL.md |
| Client-local top-down shooter with independently aimed upper body, moving 3D projectiles, enemy waves and game-over UI | map_templates/gamegraph_top_down_pve_template | client-scenegraph-game + game-visual-production |
| Multiplayer with smooth moving objects | code_sample/src/HybridFlappyBird, PropertyHostSample | skills/multiplayer-hybrid-sync/SKILL.md |
| Server-authoritative non-Unit physics objects | code_sample/src/FallGuysGame plus server physics guide | skills/server-authoritative-3d-physics/SKILL.md |
| Runtime particle effect prototype | code_sample/src/RuntimeParticleBuilderSample | skills/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
MapGameModeunless the task explicitly needs multiple modes. - Do not copy
DataGenerated/,TriggerGenerated/,bin/, orobj/. - Copy only the smallest set of source files needed for the pattern, then rename namespaces/classes.
- Preserve
#if CLIENT/#if SERVERboundaries. - For static GameData, prefer the authoring route already used by the project. Do not patch
src/DataGenerated. - Build both
Server-DebugandClient-Debug. - Run
sce-preview-verifywhen 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:
- Add one feature directory under
src/. - Add one main class implementing
IGameClassor following the chosen sample base pattern. - Register from
OnRegisterGameClass(). - Gate initialization by current game mode:
csharp
if (Game.GameModeLink != ScopeData.GameDataGameMode.MapGameMode) return;- Put rendering/UI/input under
#if CLIENT. - 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, notGame2048. - 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-DebugandClient-Debugcompile. - [ ] 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.