Foundation / checks (checks) (push) Successful in 47m40s
Foundation / checks (client) (push) Successful in 17m27s
Foundation / checks (deploy) (push) Successful in 4m17s
Foundation / checks (ecs) (push) Successful in 4m31s
Foundation / checks (network) (push) Successful in 22m1s
Foundation / checks (tsan) (push) Successful in 13m10s
Foundation / checks (postgres) (push) Successful in 20m54s
Foundation / image (push) Successful in 4m15s
Foundation / postgres-tools (push) Successful in 5m32s
Foundation / server-image (push) Successful in 7m15s
Square patches invited camping and left the space between them empty. Rules 8 run on a format-2 habitat of deposits: - pools and single-nutrient bubbles at free micrometre centres, each with a stable id and a contact radius; the cellular-v7 opening scatters bubbles reproducibly from the genesis commit (three in ten in loose clumps) and lists pools with --pool; - every cell drains what it touches, up to its intake rate per tick, with no target; a pool gives at most a quarter of that rate; an emptied deposit disappears; - a dead cell's detritus breaks into one bubble per non-empty channel; - wildlife swims to the nearest non-empty deposit and feeds by touch. Bundle v9 (habitat 2) and schema v43 admit it. Session v11 carries the owner's 512 nearest deposits (id, centre, radius, shape, a drained flag and 16-bit amount codes) instead of patches; every other cellular message is v10's. The client asks for v11, draws bubbles (nutrient-coloured, pulsing while drained, popping when gone) and pools as puddles, slows near food and sends no feed target; the HUD summarises food in range. Earlier rules, regions and v10 clients are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
123 lines
5.5 KiB
C++
123 lines
5.5 KiB
C++
#pragma once
|
|
// M9.8c engineering panels (ADR-0084). Drawn inside Application's overlay callback;
|
|
// they read presentation copies and report what the user asked for. Only this file
|
|
// pair and the platform adapter use the toolkit.
|
|
#include "evo/client/auth.hpp"
|
|
#include "evo/client/bindings.hpp"
|
|
#include "evo/client/environment_view.hpp"
|
|
#include "evo/client/launcher.hpp"
|
|
#include "evo/client/organism_view.hpp"
|
|
#include "evo/client/outcome_log.hpp"
|
|
#include "evo/client/selection.hpp"
|
|
#include "evo/client/ui_state.hpp"
|
|
#include "evo/render/environment.hpp"
|
|
#include "remote_session.hpp"
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
namespace evo::client_app {
|
|
enum class Mode : std::uint8_t { launcher, fixture, remote };
|
|
// The cellular microscope view (2026-10-16 UI), in logical window coordinates. The client
|
|
// loop builds it from copied presentations each frame; the panels draw it with the
|
|
// toolkit, since membranes, flagella and granules are not rectangles. Appearance comes
|
|
// from the phenotype only: size from extent, flagella from movement speed, wall
|
|
// thickness from membrane mass, organelles from energy conversion.
|
|
struct SceneCell {
|
|
float x{}, y{}, radius{}, membrane{};
|
|
int flagella{}, organelles{};
|
|
bool own{}, dead{}, stale{};
|
|
std::uint64_t seed{}; // Stable per organism: organelle layout (and orientation at rest).
|
|
bool facing{}; // Heading is known: the cell faces it, flagella trailing.
|
|
float heading{}; // Screen radians.
|
|
// What hovering the cell shows (its replicated phenotype; no hidden state).
|
|
std::uint32_t extent_um{}, speed_um_s{}, conversion_per_thousand{}, grown_per_thousand{};
|
|
std::uint64_t mass_fg{}, membrane_fg{}, ingestion_fg_s{};
|
|
};
|
|
struct ScenePatch {
|
|
float x{}, y{}, half{}; // Centre and half side of the 1 mm contact footprint.
|
|
std::array<std::uint64_t, 5> stock{}; // Energy pJ, then C, N, P, other fg.
|
|
bool target{}, stale{};
|
|
std::uint64_t seed{};
|
|
};
|
|
// ADR-0136 (v11): a pool (a puddle) or a bubble, centred, with its contact radius in pixels.
|
|
struct SceneDeposit {
|
|
float x{}, y{}, radius{};
|
|
std::array<std::uint64_t, 5> stock{}; // Approximate (v11 amount codes), same channels.
|
|
bool pool{}, drained{}, stale{};
|
|
std::uint64_t seed{};
|
|
};
|
|
// A bubble that just ran out: an expanding, fading ring for a moment.
|
|
struct ScenePop {
|
|
float x{}, y{}, radius{}, age{}; // Age 0..1 over the pop's life.
|
|
int channel{};
|
|
};
|
|
struct CellularScene {
|
|
std::vector<ScenePatch> patches;
|
|
std::vector<SceneDeposit> deposits;
|
|
std::vector<ScenePop> pops;
|
|
std::vector<SceneCell> cells;
|
|
};
|
|
// Notice layout (logical pixels); the window name is the prefix plus the notice id.
|
|
inline constexpr float notice_width = 320, notice_close_width = 22;
|
|
inline constexpr const char* notice_window_prefix = "##notice";
|
|
// Text-field storage for the connect form (bounded; never persisted).
|
|
struct FormBuffers {
|
|
bool engineering{};
|
|
bool evolution_open{}; // The mutation window (E or the callout opens it).
|
|
CellularControls cellular_controls;
|
|
std::array<char, client::max_field_bytes> endpoint{}, server_name{}, authority{}, grants{};
|
|
void load(const client::ConnectForm& form);
|
|
[[nodiscard]] client::ConnectForm form() const;
|
|
};
|
|
// One key slot of one action in the controls panel.
|
|
struct ControlSlot {
|
|
client::Action action{};
|
|
bool secondary{};
|
|
friend bool operator==(const ControlSlot&, const ControlSlot&) = default;
|
|
};
|
|
struct PanelView {
|
|
Mode mode{Mode::launcher};
|
|
const client::Launcher* launcher{};
|
|
std::optional<client::LaunchError> form_error;
|
|
bool remote_available{};
|
|
bool cellular_trial{};
|
|
client::AuthStatus auth;
|
|
const client::EnvironmentLayer* environment{};
|
|
const client::OrganismLayer* organisms{};
|
|
const client::Selection* selection{};
|
|
const client::UiState* ui{};
|
|
std::optional<RemoteStatus> remote;
|
|
const network::CellularPerception* cellular_perception{};
|
|
const CellularPlay* cellular_play{};
|
|
const CellularScene* cellular_scene{}; // Drawn under the panels when present.
|
|
std::optional<std::pair<std::uint32_t, std::uint32_t>> cellular_feed_target;
|
|
const client::OutcomeLog* outcomes{};
|
|
int visible_organisms{-1}; // -1 when unknown.
|
|
const client::Bindings* bindings{}; // In force (hints).
|
|
// Controls panel, drawn while `controls` is set. Edits stay in the draft until Apply.
|
|
const client::BindingEditor* controls{};
|
|
std::optional<ControlSlot> capturing; // Waiting for the next key press.
|
|
std::optional<client::BindingProblem> controls_problem;
|
|
};
|
|
struct PanelActions {
|
|
bool fixture{}, connect{}, cancel{}, retry{}, back{}, ask_disconnect{};
|
|
bool sign_in{}, sign_out{}, auth_connect{}, cancel_sign_in{};
|
|
std::optional<std::uint64_t> dismiss_notice, confirm_dialog, cancel_dialog;
|
|
bool open_controls{}, apply_controls{}, reset_controls{}, close_controls{}, cancel_capture{};
|
|
std::optional<ControlSlot> capture_key;
|
|
std::optional<client::Action> clear_secondary;
|
|
std::optional<bool> cellular_trial;
|
|
std::optional<std::pair<std::uint32_t, std::uint32_t>> feed_patch;
|
|
bool stop_feeding{};
|
|
std::optional<CellAction> cell_action;
|
|
std::optional<MutationChoice> mutation;
|
|
bool restart_life{}, keep_unknown{};
|
|
};
|
|
// Draws every panel for this frame. `display` may be changed by the layer selector.
|
|
[[nodiscard]] PanelActions draw_panels(const PanelView& view, FormBuffers& form,
|
|
render::EnvironmentDisplay& display);
|
|
} // namespace evo::client_app
|