Files
aevolution/include/evo/server/lifecycle/wildlife_controller.hpp
T
dingoandClaude Opus 5.5 108f29eda5
Foundation / checks (ecs) (push) Successful in 2m25s
Foundation / checks (deploy) (push) Successful in 5m15s
Foundation / checks (network) (push) Successful in 21m56s
Foundation / checks (client) (push) Successful in 22m54s
Foundation / checks (tsan) (push) Successful in 47m4s
Foundation / checks (postgres) (push) Successful in 1h15m49s
Foundation / checks (checks) (push) Failing after 1h30m4s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
feat(biology): evolve photosynthetic producers that capture light
ADR-0175 implements ADR-0136 step C with trial costs to be balanced after
playtesting. Genome schema 5 adds a photosynthesis efficiency (empty in
schemas 1-4, so earlier offers and draws are unchanged; mutation operators
29-32 are appended). Development version 5 builds the organelles as
internal membrane (p/4 of structure, upkept twice) and slows movement by
p/2 per thousand. Founder 4 and cellular rules 11 let lineages earn the
capability as an offspring plan that children express.

Owner format 9 declares the region's light. Inside each tick's detached
candidate, active unfrozen producers capture cross-section x irradiance x
efficiency (a quarter while moving), credited to the reserve and boundary
inflow together and replayed from recorded intentions. Well-lit wildlife
producers hold still. The joint owner keeps infall, water and radiation and
nests a rules-11 owner unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 18:06:02 -04:00

32 lines
1.7 KiB
C++

#pragma once
#include "evo/server/lifecycle/cellular_lives.hpp"
#include <cstdint>
#include <expected>
#include <vector>
// M11.5d (ADR-0125): the bounded deterministic wildlife controller. It reads only the
// committed owner state and the tick being built, and proposes the same intentions a
// player could send. Its output is recorded in the trace, so replay never runs it, and
// the owner still validates and funds every intention.
namespace evo::server {
// A wildlife cell that could fund a bud asks for one at most once per this many ticks
// (offset by its life id), and a wandering cell keeps a direction for this many ticks.
inline constexpr std::uint64_t wildlife_bud_interval_ticks = 20; // 1 s
inline constexpr std::uint64_t wildlife_wander_interval_ticks = 40; // 2 s
inline constexpr std::int16_t wildlife_full_speed = 1'000;
// Full speed toward (dx, dy): the intent's length is at most wildlife_full_speed, as a
// cellular intent requires (a longer one is refused and fails the whole tick).
[[nodiscard]] biology::CellularIntent wildlife_toward(std::int64_t dx, std::int64_t dy) noexcept;
// One intention per wildlife life (zero account), sorted by life id: bud when the reserve
// funds one, else steer to and feed from the nearest perceived patch holding energy,
// else wander. Owned lives are left to their players. ADR-0175: under rules 11 with
// the region's declared light, a photosynthetic cell that would capture at least its
// maintenance by holding still stays still (it still feeds from whatever it touches).
[[nodiscard]] std::expected<std::vector<CellularLifeIntent>, CellularLivesError>
wildlife_intents(const CellularLives& state, std::uint64_t tick);
} // namespace evo::server