Drive wildlife with a deterministic controller recorded in the trace
M11.5d (ADR-0125): wildlife_intents gives each unowned cell a bud intent when it can fund one (at most once a second), else steers it to the nearest perceived food patch and feeds, else wanders. The cellular server puts these intentions into each tick's baseline, so replay and publication treat them like player input. fund_bud refuses a reserve short of the bare investment before scanning growth levels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
#include "evo/processes/development_opening.hpp"
|
||||
#include "evo/server/cellular_session_batch.hpp"
|
||||
#include "evo/server/lifecycle/primitive_lives.hpp"
|
||||
#include "evo/server/lifecycle/wildlife_controller.hpp"
|
||||
#include "evo/server/ops_http.hpp"
|
||||
#include "evo/server/primitive_region_host.hpp"
|
||||
#include "evo/server/region_host.hpp"
|
||||
@@ -1054,6 +1055,16 @@ int serve_cellular(Options& o) {
|
||||
for (const auto& life : state->lives())
|
||||
baseline.push_back({life.identity.life, {}});
|
||||
std::ranges::sort(baseline, {}, &server::CellularLifeIntent::life_id);
|
||||
// ADR-0125: wildlife follow the deterministic controller; its intentions
|
||||
// ride the trace like a player's, and the owner validates them.
|
||||
if (const auto wild = server::wildlife_intents(*state, tick); wild) {
|
||||
for (const auto& intent : *wild) {
|
||||
const auto found = std::ranges::lower_bound(
|
||||
baseline, intent.life_id, {}, &server::CellularLifeIntent::life_id);
|
||||
if (found != baseline.end() && found->life_id == intent.life_id)
|
||||
*found = intent;
|
||||
}
|
||||
}
|
||||
auto actions = bridge->carry(tick);
|
||||
auto builder =
|
||||
server::CellularSessionBatchBuilder::create(*state, host.committed()->head);
|
||||
|
||||
Reference in New Issue
Block a user