sdk-first-feature

Workflow for SDK-First Feature Development (Simulate before UI)

SDK-First Feature Development

When implementing complex game features (bosses, minigames, skills), follow this workflow to ensure logic is testable without UI/Assets.

1. Define the SDK Interface

  • Goal: Decouple logic from Bevy ECS/UI where possible.
  • Create a sdk.rs module in your feature directory.
  • Define Traits/Structs that represent the feature's data and behavior.
  • Constraint: Do not import bevy::render or bevy::ui in the SDK module.

2. Create Searchable/Spawnable Entities

  • Goal: Make the feature accessible via the Plugin Hub / Automation.
  • Implement a builder pattern or spawn() function.
  • Ensure the entity can be spawned via AutomationCommand::SpawnEntity or similar debug command.

3. Implement Simulation Harness

  • Goal: "Simulate everything via the SDK".
  • Create simulation.rs or headless_test.rs.
  • Setup a minimal Bevy app with ONLY necessary plugins (No default plugins).
  • Implement helper methods: tick_game(seconds), assert_state(expected).

4. Verify Logic (Headless)

  • Goal: Prove stability before Art/UI integration.
  • Write unit tests using the Simulation Harness.
  • Verify state transitions, tough edge cases, and performance.
  • Do not start UI work until logic is verified.

5. UI Integration (Deferred)

  • Only after logic is verified, create the UI/Asset integration layer.
  • Use placeholder assets (cubes/spheres) if art is missing.