feat(server): initialize Rust/bevy_ecs simulation server
Server boilerplate epic (276) complete. Establishes the Rust simulation server foundation per D-020 (subprocess/IPC architecture). Structure: - bevy_ecs 0.18 + bevy_app 0.18, MessagePack serialization (rmp-serde) - SimulationPlugin with deterministic resources: SimulationTime (D-031), SimRng (D-030), InputQueue (D-010) - Core IPC types: ObserverSnapshot, PlayerInput, SimBridge trait (D-020) - CauseChain production component for provenance tracking (D-030) - SimulationTier types with LRU eviction support (D-026) - NPC 10-axis model components (D-024) - 15 tests: inline unit tests + integration smoke/serialization tests - make ci-server passes (clippy, fmt, build, test) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
// NPC module - NPC entity definitions and AI systems
|
||||
// Implements D-024: 10-axis NPC model + CombatCapability component
|
||||
// Background tier state machines for schedule, mood, relationships, job
|
||||
|
||||
use bevy_ecs::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Component, Debug)]
|
||||
pub struct Npc;
|
||||
|
||||
// 7 essential axes (D-024)
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Want {
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Secret {
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Relationships {
|
||||
pub entries: Vec<Relationship>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Relationship {
|
||||
pub target_name: String,
|
||||
pub kind: String,
|
||||
pub trust_level: f32,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ToleranceThreshold {
|
||||
pub current_stress: f32,
|
||||
pub threshold: f32,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct DailyRoutine {
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct InformationInventory {
|
||||
pub known_facts: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Contentment {
|
||||
pub level: f32,
|
||||
}
|
||||
|
||||
// 3 supporting axes (D-024)
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PersonalityTraits {
|
||||
pub traits: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct TellSystem {
|
||||
pub tells: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SkillSet {
|
||||
pub skills: Vec<String>,
|
||||
pub combat_trained: bool,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct CombatCapability {
|
||||
pub weapon_proficiency: f32,
|
||||
pub combat_style: String,
|
||||
}
|
||||
Reference in New Issue
Block a user