Conversation
Preserve social history instead of overwriting, expose configurable personality inputs, embed fractal templates, and document SystemsPlugin configuration.
- UtilitySmoothing: Component that smooths scorer outputs over time with continuation bonuses to prevent rapid action switching (thrashing) - ThreatTracker: Tracks visible threats with distance-based severity, natural decay, and exponential panic calculation for fear-driven behaviors Both components integrate seamlessly with existing scorer and perception systems.
Config extraction: - PersonalityConfig: social influence distance tuning - GravityParams: Barnes-Hut algorithm parameters (depth, bodies per node) - ThreatTrackerConfig: decay rate and forget timeout defaults - SocialConfig: relationship decay time scale and blending weights Fixes: - Remove threat panic "sticky" floor, now decays naturally with accumulated threat - Add HashMap capacity hints (EntityTracker, ThreatTracker, SocialNetwork) Breaking API changes: - SocialNetwork methods now require &SocialConfig parameter - update_collective_influence() requires Res<PersonalityConfig> (Bevy auto-injects)
Architecture: • entity_tracker: Data storage (position, last_seen, EntityMetadata enum) • threat_tracker: Threat evaluation (panic calculation from entity data) • prey_tracker: Food evaluation (attractiveness from entity data) • Clean separation: data layer independent from evaluation layer Changes: • Added entity_tracker.rs (data storage with metadata enum) • Added threat_tracker.rs (evaluates threats, outputs panic level) • Added prey_tracker.rs (evaluates food sources, outputs hunger score) • Deleted base_tracker.rs (replaced by entity_tracker) • Updated mod.rs with future tracker plans Benefits: • Data storage separate from evaluation logic • Easy to add new tracker types (just implement evaluation) • Trackers read shared EntityTracker (no duplication) • Scalable pattern for LP's multi-organism ecosystem Future trackers planned: • aggression, social, territory, noise, obstacle, injury
Reformat line wrapping in gravity calculations and import lists for consistency with Rust style guidelines. - gravity.rs: Adjust force magnitude calculation line breaks - mod.rs: Consolidate prelude import lists
Standardize code patterns across the AI system crate for better maintainability: - Standardize import order: std → bevy → crate (consistent across all files) - Add default implementation to AIModule::update() trait method - Remove empty update() implementations using new default - Remove redundant new() constructors that just call Default::default() Changes maintain backward compatibility while reducing boilerplate.
Apply DRY, KISS, and consistency improvements to forces, energy, and information crates: **Import Order:** - Standardize to: std → bevy → crate (energy/electromagnetism, information/fractals) **DRY Improvements:** - Extract duplicated normalize_or() helper to waves/mod.rs - Remove duplicate implementations from oscillation.rs and propagation.rs **Redundant Code Cleanup:** - Remove WaveParameters::new() (use Default instead with builder pattern) - Keep MassProperties::new() (actively used in gravity.rs:164) **Code Quality:** - All changes maintain backward compatibility - Zero functional changes, pure refactoring
Extracted common evaluation logic (time decay + distance factors) from ThreatTracker and PreyTracker into shared helper function `evaluate_tracked_entities_with_decay()`. Changes: - Add evaluate_tracked_entities_with_decay() in trackers/mod.rs - Handles exponential time-based decay - Applies linear distance-based scoring - Generic over metadata extraction via closure - Simplify ThreatTracker::update() - Uses shared helper with Threat severity extraction - Preserves original panic saturation formula - Simplify PreyTracker::update() - Uses shared helper with Prey attractiveness extraction - Preserves original best-prey selection logic No behavior changes purely refactoring to reduce 80% code duplication between trackers. Future trackers (aggression, social, territory) will use the same helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Consolidate 15 commits from dev branch:
Implementation
1. Tracker Deduplication - Main focus of recent work
evaluate_tracked_entities_with_decay()helper function2. AI Architecture Simplification
3. Code Consistency
std->bevy->crate(across all files)normalize_or()in waves)new()constructors usingDefaultinstead4. Minor Fixes
Core AI Systems:
Systems Infrastructure:
Testing
Compilation:
Behavior Preserved:
exp(-decay_rate * time_since)unchangedNo breaking changes to public APIs.
Code Example
Before: Duplicated Evaluation
After: Shared Helper
Technical Notes
Modularity:
Future Trackers:
Performance: