feat(cellular): playtest fixes - edge, cell count, mixed bubbles, still pools
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 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m29s
Foundation / postgres-tools (push) Successful in 29s
Foundation / server-image (push) Successful in 4m24s
Foundation / image (push) Successful in 4m58s
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 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m29s
Foundation / postgres-tools (push) Successful in 29s
Foundation / server-image (push) Successful in 4m24s
Foundation / image (push) Successful in 4m58s
From the first rules-13 playtest: - An earned offer waits until a single cell can split (keeping its count), so choices are no longer refused one after another. - The client draws the region's walls (dimming outside), names the edge when the cell is against it, shows the region's cell count, and says when upkeep is burning kept matter because no energy is left. - Mixed bubbles hold every nutrient at once (--mixed-motes; none leaves the scatter stream unchanged) and are drawn as small pools of their nutrients. With intake split by the body's recipe, single-nutrient phosphorus bubbles fed slowly; mixed ones carry it with everything else. - Liquid openings move each pool out of the currents to the nearest still water (cellular_still_centre). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -152,10 +152,40 @@ void invalid_configurations() {
|
||||
const auto still = generate(none);
|
||||
CHECK(still.routes().empty() && still.sample(30'000, 30'000) == CellularFlowSample{});
|
||||
}
|
||||
// A pool in a current moves to the nearest centre whose whole disc is still; one in still
|
||||
// water stays.
|
||||
void pools_rest_in_still_water() {
|
||||
const auto field = generate(v0(7));
|
||||
const auto disc_still = [&](CellularPatchAddress at, std::int64_t r) {
|
||||
for (std::int64_t dx = -r; dx <= r; dx += r / 2)
|
||||
for (std::int64_t dy = -r; dy <= r; dy += r / 2)
|
||||
if (dx * dx + dy * dy <= r * r &&
|
||||
field.sample(at.x_um + dx, at.y_um + dy) != CellularFlowSample{})
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
std::size_t moved{};
|
||||
for (std::uint32_t x = 5'000; x <= 55'000; x += 5'000)
|
||||
for (std::uint32_t y = 5'000; y <= 55'000; y += 5'000) {
|
||||
const CellularPatchAddress at{x, y};
|
||||
const auto rested = cellular_still_centre(field, at, 500);
|
||||
if (field.sample(x, y) != CellularFlowSample{}) {
|
||||
CHECK(rested != at && disc_still(rested, 500));
|
||||
CHECK(rested.x_um >= 500 && rested.y_um >= 500 && rested.x_um <= 59'500 &&
|
||||
rested.y_um <= 59'500);
|
||||
++moved;
|
||||
} else {
|
||||
// Still at its centre: it stays, or moves only to clear a current at its rim.
|
||||
CHECK(disc_still(rested, 500));
|
||||
}
|
||||
}
|
||||
CHECK(moved != 0);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
try {
|
||||
pools_rest_in_still_water();
|
||||
routes_within_configuration();
|
||||
bounded_with_quiet_water_and_still_walls();
|
||||
route_centreline_runs_at_route_speed();
|
||||
|
||||
@@ -222,8 +222,29 @@ void refusals() {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// Mixed bubbles hold every nutrient at once and follow the single-nutrient ones from the same
|
||||
// stream: without them the scatter is unchanged.
|
||||
void mixed_bubbles_hold_every_nutrient() {
|
||||
CellularHabitatConfig base{100, 1, 9, 60'000, 60'000, {}, cellular_habitat_deposit_format, 1};
|
||||
const auto plain = scatter_deposits(base, {}, {300, 7, energy(70), 99});
|
||||
CHECK(plain);
|
||||
Inventory mixed{{1'000}, {{{500}, {150}, {50}, {300}}}};
|
||||
CellularMoteField field{300, 7, energy(70), 99, 200, mixed};
|
||||
const auto both = scatter_deposits(base, {}, field);
|
||||
CHECK(both && both->patches.size() == 500);
|
||||
CHECK(std::ranges::count(both->patches, mixed, &CellularPatch::stock) == 200);
|
||||
field.mixed_count = 0;
|
||||
const auto none = scatter_deposits(base, {}, field);
|
||||
CHECK(none && none->patches == plain->patches);
|
||||
// Mixed bubbles alone, and a mixed count without an amount.
|
||||
const auto only = scatter_deposits(base, {}, {0, 7, {}, 99, 50, mixed});
|
||||
CHECK(only && only->patches.size() == 50);
|
||||
CHECK(!scatter_deposits(base, {}, {0, 7, {}, 99, 50, {}}));
|
||||
}
|
||||
|
||||
int main() {
|
||||
try {
|
||||
mixed_bubbles_hold_every_nutrient();
|
||||
format_three_round_trip();
|
||||
liquid_deposits_are_perceived();
|
||||
still_water_keeps_bubbles();
|
||||
|
||||
@@ -334,19 +334,14 @@ void a_choice_splits_the_cell(bool become) {
|
||||
"control did not follow the choice");
|
||||
require(state->habitat().patches().size() >= deposits + 1, "the paid cost was not reclaimed");
|
||||
closed(*state);
|
||||
// A half-grown founder cannot split again: the choice is refused and the offer kept.
|
||||
// A half-grown founder cannot split again, so its next offer waits until it has regrown.
|
||||
if (!become) {
|
||||
for (int tick = 0; tick < 40; ++tick)
|
||||
checked(state->advance_tick(swim(*state, {1'000, 0})), "swim tick");
|
||||
const auto offer = life_of(*state, 101).revamp.offer;
|
||||
require(offer.count == 3, "no second offer");
|
||||
const auto refused =
|
||||
checked(state->advance_tick_with_mutations(swim(*state, {}),
|
||||
choose(*state, 101, offer.ids.at(1), 9'010)),
|
||||
"refused split tick");
|
||||
require(refused.mutations.front().result == CellularMutationResult::split_refused &&
|
||||
life_of(*state, 101).revamp.offer == offer && !state->archive().find(9'010),
|
||||
"a split below full growth was not refused with the offer kept");
|
||||
const auto& founder_now = life_of(*state, 101);
|
||||
require(founder_now.growth.realized_per_thousand < 1'000 &&
|
||||
founder_now.revamp.offer.count == 0,
|
||||
"a half-grown founder was offered a split");
|
||||
closed(*state);
|
||||
}
|
||||
// Rules 13 wildlife (the founder after become): its controller's intents are always
|
||||
|
||||
Reference in New Issue
Block a user