Files
dingoandClaude Opus 5.5 af32af36ee
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 1m6s
Foundation / checks (deploy) (push) Successful in 5m41s
Foundation / postgres-tools (push) Successful in 1m33s
Foundation / image (push) Successful in 4m42s
Foundation / server-image (push) Successful in 4m55s
feat(cellular): random founder spawns, tunable thrust cost, commit timing
Playtest feedback on region 10.

Rules-12 founders now start at a seeded random spot anywhere in the region (1 mm
clear of the edges, clear of other cells; seeded by world, region and the life's
identity so replay is exact). The provisioned sites remain the fallback.

Thrust energy is tunable: founder.thrust_cost_per_mille scales the metabolic
full-speed movement cost for thrust and braking (trial 250, a quarter of today's
cost). It is part of the liquid rules declared when a region opens, persisted in
the format-10 block's reserved slot (zero stands for the original 1,000), so
existing regions keep their meaning.

The server logs every cellular commit slower than 50 ms (and one in 60) with its
tick count and duration, to find what stalls the loop once a second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 06:40:12 -04:00

37 lines
1.9 KiB
C++

#pragma once
#include "evo/biology/cellular_currents.hpp"
#include "evo/biology/cellular_deposit_motion.hpp"
#include "evo/biology/cellular_tuning.hpp"
#include <compare>
#include <cstdint>
#include <expected>
// Rules 12 (Cellular_Region_Movement_Plan.md, ADR-0177): the liquid region a cellular owner
// declares when it upgrades to owner format 10. Taken from the Git tuning file and a seed when
// the region opens and persisted with the owner, so replay and restore never read the file.
namespace evo::server {
struct CellularLiquidRules {
biology::CellularCurrentConfig currents{}; // Its area is the owner's area.
biology::CellularHandling founder{}; // Per-tick founder handling; costs unused.
biology::CellularDepositMotionRules deposits{};
// Thrust energy as a share of the metabolic full-speed movement cost, 1..10,000 per mille.
std::uint32_t thrust_cost_per_mille{1'000};
auto operator<=>(const CellularLiquidRules&) const = default;
};
// Every field is within the kinematic, current and deposit bounds for `area`.
[[nodiscard]] bool cellular_liquid_valid(const CellularLiquidRules& rules,
biology::CellularArea area) noexcept;
// Rules for a region of `area` from the tuning file and a current seed.
[[nodiscard]] CellularLiquidRules cellular_liquid_rules(const biology::CellularTuning& tuning,
biology::CellularArea area,
std::uint64_t seed);
// An organism's handling: its genome's arrangement scaled from the declared founder handling,
// with full-output costs from its metabolic budget.
[[nodiscard]] std::expected<biology::CellularHandling, biology::CellularHandlingError>
cellular_liquid_handling(const biology::Genome& genome, const biology::MetabolicBudget& budget,
const CellularLiquidRules& rules);
} // namespace evo::server