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:
@@ -754,6 +754,8 @@ int main(int argc, char** argv) try {
|
||||
scene.deposits.clear();
|
||||
scene.pops.clear();
|
||||
scene.cells.clear();
|
||||
scene.region = scene.at_edge = false;
|
||||
scene.region_cells = 0;
|
||||
scene_active = false;
|
||||
const auto* cellular_remote = host.session();
|
||||
const bool microscope = cellular_remote && mode() == Mode::remote && cellular_trial;
|
||||
@@ -914,6 +916,43 @@ int main(int argc, char** argv) try {
|
||||
}
|
||||
}
|
||||
const auto own = cellular_remote->cellular_play().life();
|
||||
// The region's walls, from the perceived current configuration (mm).
|
||||
double region_w_mm = 0, region_h_mm = 0;
|
||||
if (const auto* perception = cellular_remote->cellular_perception();
|
||||
perception && perception->currents) {
|
||||
region_w_mm = static_cast<double>(perception->currents->width_um) / 1000;
|
||||
region_h_mm = static_cast<double>(perception->currents->height_um) / 1000;
|
||||
const auto low = camera->world_to_screen({0, 0});
|
||||
const auto high = camera->world_to_screen({region_w_mm, region_h_mm});
|
||||
if (low && high) {
|
||||
scene.region = true;
|
||||
scene.region_left = static_cast<float>(std::min(low->x, high->x));
|
||||
scene.region_right = static_cast<float>(std::max(low->x, high->x));
|
||||
scene.region_top = static_cast<float>(std::min(low->y, high->y));
|
||||
scene.region_bottom = static_cast<float>(std::max(low->y, high->y));
|
||||
}
|
||||
}
|
||||
if (orgs) {
|
||||
scene.region_cells = static_cast<std::size_t>(
|
||||
std::ranges::count_if(orgs->cells(), [](const auto& cell) {
|
||||
return cell.state != evo::client::OrganismState::dead;
|
||||
}));
|
||||
// Against a wall: within 50 um of it (positions are the lower-left corner).
|
||||
for (const auto& cell : orgs->cells()) {
|
||||
if (own == 0 || cell.id != own || region_w_mm == 0)
|
||||
continue;
|
||||
constexpr auto pitch = static_cast<double>(evo::world::cell_pitch_mm);
|
||||
const double x = static_cast<double>(cell.voxel.x) * pitch +
|
||||
static_cast<double>(cell.x.value) / 1000;
|
||||
const double y = static_cast<double>(cell.voxel.y) * pitch +
|
||||
static_cast<double>(cell.y.value) / 1000;
|
||||
const double extent = static_cast<double>(cell.phenotype.extent) / 1000;
|
||||
constexpr double near = 0.05;
|
||||
scene.at_edge = x <= near || y <= near ||
|
||||
x + extent >= region_w_mm - near ||
|
||||
y + extent >= region_h_mm - near;
|
||||
}
|
||||
}
|
||||
// ADR-0176: the owner's view lists the producers it can see, by organism.
|
||||
const auto* seen = cellular_remote->cellular_perception();
|
||||
const auto photosynthesis = [&](std::uint64_t organism) -> std::uint32_t {
|
||||
|
||||
Reference in New Issue
Block a user