tutorial area todo
Guide for tutorial area todo
Agent Work Split - Tutorial Area Development
Agent 1 (Current) - Editor & Spawn System
Focus: Wire up spawn point placement and persistence
Todo
- Spawn Point Input Handling (
editor/input.rs)- Add click handler for
EditorTool::Spawn - Spawn marker entity at click position with
SpawnPointcomponent - Use colored sphere mesh for visualization:
- 🟢 Green for NPC
- 🔴 Red for Enemy
- 🔵 Blue for TriggerZone
- 🟡 Yellow for Waypoint
- Add click handler for
- Spawn Point Persistence (
map.rs)- Add
spawn_points: Vec<SavedSpawnPoint>toMapData - Create
SavedSpawnPointstruct matchingSpawnPointfields + position - Update save/load to include spawn points
- Add
- Spawn Point Visualization
- Add text label above spawn marker showing entity_id
- Make markers selectable with Select tool
- Delete functionality for spawn points
Agent 2 - NPC AI with big-brain
Focus: Integrate utility AI for tutorial NPCs
Setup
cd loh-game
cargo add big-brainTodo
- Add big-brain to Cargo.toml
big-brain = "0.21" # Check latest version - Create AI Module (
src/systems/ai/behavior.rs)- Define
TutorialGuideAIscorer/action components - Implement
GreetPlayeraction (triggers dialogue) - Implement
Patrolaction (move between waypoints) - Implement
WaitIdleaction
- Define
- NPC Behavior Trees
// Example structure Thinker::build() .picker(FirstToScore { threshold: 0.5 }) .when(PlayerNearby::new(5.0), GreetPlayer) .when(Always, Patrol) - Tutorial NPC Entity (
src/systems/world/npcs.rs)- Create
spawn_tutorial_npcfunction - Attach Thinker component
- Use entity_id from SpawnPoint to determine which NPC to spawn
- Create
Shared Data Contracts
SpawnPoint Component (Already Created)
// src/systems/editor/state.rs
pub struct SpawnPoint {
pub spawn_type: SpawnPointType, // Npc, Enemy, TriggerZone, Waypoint
pub entity_id: String, // e.g., "tutorial_guide"
pub level: i32, // For enemies
}Files Agent 1 Will Modify
src/systems/editor/input.rssrc/systems/map.rssrc/systems/editor/ui.rs(minor)
Files Agent 2 Will Create/Modify
src/systems/ai/behavior.rs(NEW)src/systems/ai/mod.rssrc/systems/world/npcs.rs(NEW or existing)
Testing
- Agent 1: Open editor (F1), use Spawn tool, place markers, save/load map
- Agent 2: Run game, verify NPC spawns at spawn point, test patrol behavior
- Both: Combine work, verify spawn points + AI integration