Skip to content

Complete AI mob ecosystem systems - #52

Merged
xefensor merged 12 commits into
masterfrom
feature/ai-mob-systems
Aug 15, 2026
Merged

Complete AI mob ecosystem systems#52
xefensor merged 12 commits into
masterfrom
feature/ai-mob-systems

Conversation

@xefensor

Copy link
Copy Markdown
Owner

Summary

  • Complete the loaded and unloaded mob ecosystem pipeline with bounded hunger catch-up, feeder and forage use, predation, food-based breeding readiness, group migration, spawn debt, and Farmer production.
  • Expand aquatic ecology, food-anchored animal behavior, and Stage 2 Undead awareness, spawning pressure, targeting, and diplomacy.
  • Restore self-defense for wild and tamed predators while preserving Retold target ownership and player-mode safety rules.
  • Improve Villager communal work: villagers face their work targets, relight nearby torches in bounded batches, and use consistent action-facing for other sensible mob actions.
  • Add data-driven compatibility tags, focused GameTests and JUnit coverage, performance baselines, and corresponding design/status documentation.

Why

Several designed AI systems were documented but either absent or only partially connected to the established behavior pipeline. This change completes those paths while retaining Retold's movement/combat ownership, LOD, work-budget, persistence, world-protection, and datapack-compatibility rules.

It also fixes three concrete behavior gaps found during implementation: unloaded ecosystems did not reconcile elapsed time; replacement predator targeting did not cover ordinary wild/tamed predators consistently; and Villager torch cooldown/cadence prevented nearby maintenance from forming one coherent work run.

Player impact

  • Animal populations now continue through bounded ecological changes while chunks are unloaded and reconcile safely when loaded.
  • Animals can use real food sources, breed when food is available, migrate as groups, and participate in expanded land and aquatic food webs.
  • Hostile and allied mob targeting follows faction and ownership rules more consistently, including retaliation.
  • Villagers visibly look at torches and other work targets and can relight up to eight nearby torches during one interruptible maintenance run.

Risk and compatibility

  • Catch-up queues, spawn debt, migrations, block searches, and torch chains are capped and routed through existing budgets/caches to avoid unbounded work.
  • New semantic tags retain standalone defaults and provide datapack/mod extension points.
  • Long natural-world sessions, multiplayer/dedicated-server behavior, save/reload, and existing-world population evolution still benefit from ongoing play verification; these are not claimed as fully verified here.
  • The complete GameTest suite was intentionally not rerun; focused selectors were used per the repository testing strategy.

Validation

  • ./gradlew build
  • Focused unloaded-ecosystem JUnit and GameTest selectors covering food, predation, breeding, migration, starvation, Cube behavior, Farmer production, and spawn reconciliation
  • Focused aquatic survival and affected-species TPS phases (30 phases; peak 5.524 ms/tick)
  • Focused Undead targeting/pressure tests and affected-species TPS phases (40 phases; peak 6.046 ms/tick)
  • Focused predator retaliation tests across affected species and defense regressions
  • retold:villager_relight* (4/4 passed)
  • retold:mob_tps_villager (1/1 passed; peak 7.259 ms/tick at 20 TPS)
  • git diff --check

AI assistance

Implementation and documentation were developed with OpenAI Codex assistance and validated with the repository checks listed above.

@xefensor
xefensor merged commit 6d2ee19 into master Aug 15, 2026
2 checks passed
@xefensor
xefensor deleted the feature/ai-mob-systems branch August 15, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant