Cellular microscope UI: living cells, nutrient food, HUD and evolution cards
Foundation / checks (ecs) (push) Successful in 2m23s
Foundation / checks (deploy) (push) Successful in 4m12s
Foundation / checks (tsan) (push) Successful in 11m26s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (network) (push) Canceled after 17m48s
Foundation / checks (postgres) (push) Canceled after 17m48s
Foundation / checks (checks) (push) Canceled after 17m53s
Foundation / checks (client) (push) Canceled after 17m58s

From the maintainer's design review. In cellular play the world sits in a rounded
eyepiece with a vignette:
- Cells are drawn from their phenotype: the membrane wall thickens with membrane
  mass, flagella follow speed, organelles follow energy conversion, and a dead
  cell's membrane is torn.
- Food patches are granules coloured by nutrient, so a nutrient that runs out
  loses its colour.

The side panels become a HUD:
- a status pill and Field notes;
- Vitals in readable units (nJ, ng) with bars toward the next bud;
- an action dock with the last result explained;
- a "Mutation ready [E]" callout opening an evolution window of cards with
  before/after drawings and per-nutrient costs, which also handles the end of a
  life.

New ink, lavender and amber palette. Client only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-16 08:53:55 -04:00
co-authored by Claude Opus 5.5
parent ab5c29227c
commit 28629e1001
8 changed files with 883 additions and 392 deletions
+69 -18
View File
@@ -467,6 +467,8 @@ int main(int argc, char** argv) try {
bool auth_connect = false; // Connect when the requested grant arrives.
auto grant_requested = std::chrono::steady_clock::time_point{};
int drawn_organisms = -1;
evo::client_app::CellularScene scene; // Rebuilt each frame in cellular play.
bool scene_active = false;
evo::client_app::PanelActions actions;
(*app)->set_overlay([&] {
evo::client_app::PanelView view;
@@ -488,6 +490,7 @@ int main(int argc, char** argv) try {
view.cellular_feed_target = cellular_feed_target;
}
view.visible_organisms = drawn_organisms;
view.cellular_scene = scene_active ? &scene : nullptr;
view.bindings = &(*app)->bindings();
controls.fill(view);
actions = evo::client_app::draw_panels(view, buffers, display);
@@ -719,10 +722,16 @@ int main(int argc, char** argv) try {
*camera, display))
return 1;
const double width = state.logical_width, height = state.logical_height;
// Cellular patches under the organisms, so the own cell draws on top of them.
if (const auto* remote = host.session();
remote && mode() == Mode::remote && cellular_trial)
if (const auto* perception = remote->cellular_perception())
// 2026-10-16 microscope view: in cellular play, patches and cells are a scene the
// panels draw as granules and living cells; elsewhere organisms stay rectangles.
scene.patches.clear();
scene.cells.clear();
scene_active = false;
const auto* cellular_remote = host.session();
const bool microscope = cellular_remote && mode() == Mode::remote && cellular_trial;
if (microscope) {
const bool fresh = cellular_remote->cellular_play().fresh();
if (const auto* perception = cellular_remote->cellular_perception())
for (const auto& patch : perception->patches) {
const auto low =
camera->world_to_screen({static_cast<double>(patch.x_um) / 1000,
@@ -730,20 +739,62 @@ int main(int argc, char** argv) try {
const auto high = camera->world_to_screen(
{(static_cast<double>(patch.x_um) + 1000) / 1000,
(static_cast<double>(patch.y_um) + 1000) / 1000});
if (low && high)
evo::client_app::patch_box(
boxes, *low, *high, patch.energy_pj != 0,
std::ranges::any_of(patch.matter_fg, [](auto v) { return v != 0; }),
cellular_feed_target && cellular_feed_target->first == patch.x_um &&
cellular_feed_target->second == patch.y_um,
width, height, !remote->cellular_play().fresh());
if (!low || !high)
continue;
evo::client_app::ScenePatch p;
p.x = static_cast<float>((low->x + high->x) / 2);
p.y = static_cast<float>((low->y + high->y) / 2);
p.half = static_cast<float>(std::abs(high->x - low->x) / 2);
p.stock = {patch.energy_pj, patch.matter_fg[0], patch.matter_fg[1],
patch.matter_fg[2], patch.matter_fg[3]};
p.target = cellular_feed_target &&
cellular_feed_target->first == patch.x_um &&
cellular_feed_target->second == patch.y_um;
p.stale = !fresh;
p.seed = (static_cast<std::uint64_t>(patch.x_um) << 32U) ^ patch.y_um;
scene.patches.push_back(p);
}
const auto report = evo::render::append_organisms(
boxes, organism_budget, orgs,
org_layer ? org_layer->freshness() : evo::client::Freshness::none, *camera);
if (!report)
return 1;
drawn_organisms = static_cast<int>(report->drawn);
const auto own = cellular_remote->cellular_play().life();
if (orgs)
for (const auto& cell : orgs->cells()) {
const auto bounds = evo::render::organism_bounds(cell, *camera);
if (bounds.right < 0 || bounds.left > width || bounds.bottom < 0 ||
bounds.top > height)
continue;
const auto& ph = cell.phenotype;
evo::client_app::SceneCell c;
c.x = static_cast<float>((bounds.left + bounds.right) / 2);
c.y = static_cast<float>((bounds.top + bounds.bottom) / 2);
c.radius = static_cast<float>((bounds.right - bounds.left) / 2);
// One flagellum per 150 um/s of speed (a founder swims at 200).
c.flagella = ph.movement_speed == 0
? 0
: static_cast<int>(std::min<std::uint32_t>(
6, 1 + ph.movement_speed / 150));
const double wall = ph.total_mass == 0
? 0.0
: static_cast<double>(ph.membrane_mass) /
static_cast<double>(ph.total_mass);
c.membrane = static_cast<float>(std::clamp(1.0 + wall * 6.0, 1.0, 7.0));
c.organelles = 2 + static_cast<int>(std::min<std::uint32_t>(
3, ph.conversion_per_thousand / 250));
c.own = own != 0 && cell.id == own;
c.dead = cell.state == evo::client::OrganismState::dead;
c.stale =
org_layer && org_layer->freshness() != evo::client::Freshness::current;
c.seed = cell.id;
scene.cells.push_back(c);
}
drawn_organisms = static_cast<int>(scene.cells.size());
scene_active = true;
} else {
const auto report = evo::render::append_organisms(
boxes, organism_budget, orgs,
org_layer ? org_layer->freshness() : evo::client::Freshness::none, *camera);
if (!report)
return 1;
drawn_organisms = static_cast<int>(report->drawn);
}
if (const auto* remote = host.session(); remote && mode() == Mode::remote) {
for (const auto& m : remote->markers())
if (const auto at = camera->world_to_screen({m.x_mm, m.y_mm}))
@@ -772,7 +823,7 @@ int main(int argc, char** argv) try {
8,
8,
{240, 240, 240, 255}});
const auto frame = evo::render::Frame::create(boxes, {16, 20, 28, 255});
const auto frame = evo::render::Frame::create(boxes, {14, 12, 18, 255}); // Ink.
if (!frame)
return 1;
if (!screenshot.empty() && count + 1 == frames && !(*app)->request_screenshot(screenshot))