feat(cellular): split collection evenly across a source's nutrients
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m31s
Foundation / postgres-tools (push) Successful in 21s
Foundation / server-image (push) Successful in 4m21s
Foundation / image (push) Successful in 5m3s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m31s
Foundation / postgres-tools (push) Successful in 21s
Foundation / server-image (push) Successful in 4m21s
Foundation / image (push) Successful in 5m3s
Playtest: phosphorus held growth back everywhere. Per-nutrient collection limits followed the body recipe (5% phosphorus), but the membrane is 10% phosphorus, so no cell could collect phosphorus as fast as it builds with it. Two optional revamp tuning keys, stored in a formerly reserved rules word so regions opened without them keep their exact meaning: - feeding.split_evenly: matter from one food source is split equally between the nutrients it holds (a carbon-only bubble gives the whole matter limit to carbon, carbon and phosphorus half each, all four a quarter each), each share scaled by the cell's collection trait; - feeding.collection_percent: every collection limit per cent (100 default). The DEV tuning file takes these keys with the image that reads them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1630,7 +1630,11 @@ std::vector<std::uint8_t> CellularLives::snapshot() const {
|
||||
if (revamp) {
|
||||
const auto& r = state_->revamp;
|
||||
out.put(r.body.essential_upkeep_per_thousand, 4);
|
||||
out.put(0, 4);
|
||||
// Formerly reserved: collection per cent (0 for the original 100) and the even split
|
||||
// in bit 16. Regions opened before these keys hold zero and keep their meaning.
|
||||
out.put((r.step.collection_percent == 100 ? 0U : r.step.collection_percent) |
|
||||
(r.step.split_evenly ? 0x10000U : 0U),
|
||||
4);
|
||||
for (const auto rate : r.burn_pj_per_kfg)
|
||||
out.put(rate);
|
||||
out.put(r.step.membrane_collection_per_mille_per_point, 4);
|
||||
@@ -2157,7 +2161,10 @@ CellularLives::restore(std::span<const std::uint8_t> bytes, std::uint64_t world,
|
||||
if (revamp_version) {
|
||||
const auto u32 = [&in] { return static_cast<std::uint32_t>(in.get(4)); };
|
||||
revamp.body.essential_upkeep_per_thousand = u32();
|
||||
const auto reserved = in.get(4);
|
||||
const auto feeding = in.get(4);
|
||||
revamp.step.collection_percent =
|
||||
(feeding & 0xFFFFU) == 0 ? 100U : static_cast<std::uint32_t>(feeding & 0xFFFFU);
|
||||
revamp.step.split_evenly = (feeding & 0x10000U) != 0;
|
||||
for (auto& rate : revamp.burn_pj_per_kfg)
|
||||
rate = in.get();
|
||||
revamp.step.membrane_collection_per_mille_per_point = u32();
|
||||
@@ -2169,7 +2176,8 @@ CellularLives::restore(std::span<const std::uint8_t> bytes, std::uint64_t world,
|
||||
revamp.drip_bubble_pj = in.get();
|
||||
revamp.drip_bubble_fg = in.get();
|
||||
spent = in.inventory();
|
||||
if (!read_revamp_offers(in, revamp) || reserved != 0 || !cellular_revamp_valid(revamp))
|
||||
if (!read_revamp_offers(in, revamp) || (feeding & ~0x1FFFFULL) != 0 ||
|
||||
(feeding & 0xFFFFU) == 100 || !cellular_revamp_valid(revamp))
|
||||
return std::unexpected{CellularLivesError::format};
|
||||
}
|
||||
const auto life_bytes =
|
||||
|
||||
Reference in New Issue
Block a user