feat(admin): take reserve, cull wildlife, wildlife cap, fresh bud costs (schema 67)
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m34s
Foundation / postgres-tools (push) Successful in 26s
Foundation / server-image (push) Successful in 4m30s
Foundation / image (push) Successful in 5m46s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m34s
Foundation / postgres-tools (push) Successful in 26s
Foundation / server-image (push) Successful in 4m30s
Foundation / image (push) Successful in 5m46s
ADR-0182 section 16, from playtesting region 16 at its 256-life cap. - Bud costs: the region host's cache of each genome's bud cost was keyed by genome only, so after a tuning adoption the client kept the old cost (or "cannot bud"). It now clears when the rules' encoding changes. - Wildlife cap: reproduction.wildlife_cap (optional, 0..organism cap, 0 = the organism cap) refuses buds of parents without an account at that many lives, keeping the slots above it for players. Bits 17-31 of the energy-cycle word, so older rules keep their bytes. DEV file: 200. - Schema 67: admin command kinds take_reserve (8: up to the amounts from a life's reserve to the spent pool) and remove_wildlife (9: every life without an account, as remove_cell). - Region view: caps; the portal shows lives against the cap. - Portal: Take reserve in the inspector, Remove all wildlife, and marking cells on the map (shift+click, shift+drag) for bulk removal; the guided editor lists optional keys the base revision lacks. - Client: a refused bud says the region may be full. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -222,6 +222,12 @@ class CellularBridge {
|
||||
return result;
|
||||
};
|
||||
sessions_->replicate(tick, source);
|
||||
// A tuning adoption changes what a bud costs, so cached costs hold for one rules set.
|
||||
if (auto rules = server::encode_cellular_revamp_rules(state.revamp_rules());
|
||||
rules != bud_rules_) {
|
||||
bud_rules_ = std::move(rules);
|
||||
bud_costs_.clear();
|
||||
}
|
||||
for (const auto& life : state.lives()) {
|
||||
if (life.presence == server::CellularPresence::suspended)
|
||||
continue;
|
||||
@@ -378,13 +384,11 @@ class CellularBridge {
|
||||
const auto before = deposit_stock_.find(patch.id);
|
||||
deposit.drained = before != deposit_stock_.end() &&
|
||||
(patch.available.energy.value < before->second.energy.value ||
|
||||
std::ranges::any_of(
|
||||
std::array{0, 1, 2, 3},
|
||||
[&](int c) {
|
||||
const auto i = static_cast<std::size_t>(c);
|
||||
return patch.available.matter.at(i).value <
|
||||
before->second.matter.at(i).value;
|
||||
}));
|
||||
std::ranges::any_of(std::array{0, 1, 2, 3}, [&](int c) {
|
||||
const auto i = static_cast<std::size_t>(c);
|
||||
return patch.available.matter.at(i).value <
|
||||
before->second.matter.at(i).value;
|
||||
}));
|
||||
seen_stock_[patch.id] = patch.available;
|
||||
// Rules 12 (v13): a bubble's world velocity, current plus induced drift, so the
|
||||
// client can carry it between perceptions.
|
||||
@@ -700,6 +704,7 @@ class CellularBridge {
|
||||
std::vector<SentOffer> offers_; // Last offer view sent to each owner.
|
||||
std::map<std::pair<std::uint64_t, std::uint64_t>, std::optional<accounting::Inventory>>
|
||||
bud_costs_;
|
||||
std::vector<std::uint8_t> bud_rules_; // The rules bud_costs_ were computed under.
|
||||
// ADR-0136: deposit stocks seen at the last replicated tick, and this tick's.
|
||||
std::map<std::uint32_t, accounting::Inventory> deposit_stock_, seen_stock_;
|
||||
std::vector<std::pair<server::LifeAccount, std::uint64_t>> owned_; // At last replication.
|
||||
|
||||
Reference in New Issue
Block a user