Explain gene effects and scoring and fix clipped amoeba artwork

This commit is contained in:
coyotte508 2026-09-19 11:42:14 +02:00
commit 91a03e8c09
8 changed files with 51 additions and 19 deletions

View file

@ -50,7 +50,7 @@ export const GENES = [
2,
3,
[1, 2],
"No special action, but counts as a gene for evolution.",
"No special action. Adds 1 to the gene total used to calculate evolution points at the end of each round.",
),
gene(
"movement1",
@ -106,7 +106,7 @@ export const GENES = [
5,
-2,
[1, 2],
"Reduces total mutation sensitivity by 2. Does not count as a gene when scoring evolution.",
"Reduces total mutation sensitivity by 2. Does not count towards the gene total used to calculate evolution points.",
),
gene(
"streamline",

View file

@ -71,7 +71,7 @@ function amoeba(color, variant = 0, feature = "") {
: variant % 3 === 1
? "M18 47C5 34 16 22 29 27C24 10 42 6 49 20C56 5 73 14 70 25C88 16 98 30 84 40C103 49 94 63 81 63C90 80 72 87 61 73C58 90 38 89 34 73C19 84 7 74 18 61C5 63 5 48 18 47Z"
: "M19 55C5 48 11 30 25 33C12 17 34 8 40 24C44 5 64 8 66 25C81 11 97 30 83 42C104 43 98 63 82 62C89 80 65 89 59 74C47 93 27 86 31 70C11 82 4 61 19 55Z";
return `<svg viewBox="0 0 100 100" aria-hidden="true"><defs><radialGradient id="${id}" cx="40%" cy="24%" r="75%"><stop stop-color="${c.light}"/><stop offset=".48" stop-color="${c.body}"/><stop offset="1" stop-color="${c.shade}"/></radialGradient></defs>
return `<svg viewBox="0 0 100 100" overflow="visible" aria-hidden="true"><defs><radialGradient id="${id}" cx="40%" cy="24%" r="75%"><stop stop-color="${c.light}"/><stop offset=".48" stop-color="${c.body}"/><stop offset="1" stop-color="${c.shade}"/></radialGradient></defs>
${traits.has("movement") ? `<path d="M23 65Q-12 45 2 35Q17 40 23 53M77 60Q105 35 99 25Q84 31 77 43" fill="${c.body}" stroke="${c.stroke}" stroke-width="2"/>` : ""}
${traits.has("spines") ? `<path d="M25 29 17 8 39 23M64 21 80 6 77 31M82 54 99 71 76 69M37 72 31 94 52 76M19 52 0 64 23 67" fill="${c.shade}" stroke="${c.stroke}" stroke-width="2" stroke-linejoin="round"/>` : ""}
${traits.has("tentacle") ? `<g fill="none" stroke-linecap="round"><path d="M28 64C13 79 2 72 5 56s14-8 9-4M77 61c20 2 23 18 13 19s-10-7-5-7" stroke="${c.stroke}" stroke-width="8"/><path d="M28 64C13 79 2 72 5 56s14-8 9-4M77 61c20 2 23 18 13 19s-10-7-5-7" stroke="${c.body}" stroke-width="4.5"/></g>` : ""}

View file

@ -159,5 +159,5 @@ export function geneArt(id) {
default:
art = creature();
}
return `<svg class="gene-illustration" viewBox="0 0 120 100" aria-hidden="true">${art}</svg>`;
return `<svg class="gene-illustration" viewBox="-6 -6 132 112" aria-hidden="true">${art}</svg>`;
}

26
viewer/gene-summary.js Normal file
View file

@ -0,0 +1,26 @@
const summaries = {
intelligence: "1 gene for scoring; no special ability.",
movement1: "Swim: roll two dice and choose one.",
movement2: "Choose your swimming direction.",
spores: "Place new amoebas anywhere without your colour.",
speed: "A second swim costs no extra BP.",
defense: "Pay 1 BP to fight off an attack.",
escape: "Try to escape an attack for 1 BP.",
substitution: "Eat an extra cube to replace a colour.",
ray: "−2 mutation sensitivity; 0 genes for scoring.",
streamline: "Swimming and escaping cost 0 BP.",
holding: "Stay instead of drifting, or follow another amoeba.",
longevity: "Survive 2 injuries.",
frugality: "Eat one fewer food cube.",
struggle: "If starving, attack for 1 BP to feed.",
parasitism: "An opponent here pays 1 BP; eat one fewer cube.",
division: "New amoebas cost 4 BP instead of 6 BP.",
persistence: "Retry a failed attack or defense for free.",
aggression: "One attack for 1 BP after natural deaths.",
armor: "Cannot be eaten; Aggression causes 1 injury.",
};
export const geneSummary = (id, playerCount) =>
id === "tentacle"
? `Carry up to ${playerCount === 3 ? 2 : 3} food cubes when moving.`
: summaries[id];

View file

@ -1023,7 +1023,7 @@ dialog .modal-intro {
place-items: center;
border-bottom: 1px solid #d4ddc9;
}
.shop-art svg {
.shop-art > svg {
width: 95px;
height: 95px;
}
@ -1535,7 +1535,7 @@ dialog .modal-intro {
border-bottom: 0;
border-right: 1px solid #d4ddc9;
}
.shop-art svg {
.shop-art > svg {
width: 75px;
}
.shop-body {

View file

@ -239,6 +239,10 @@
}
.soup .gene p {
font-size: 10px;
color: #64795e;
}
.soup .gene-text {
min-width: 0;
}
.empty-genes {
font-size: 12px;
@ -695,7 +699,8 @@
height: 22px;
}
.soup .gene p {
display: none;
display: block;
font-size: 9px;
}
.soup .colony-metrics {
grid-column: 1;
@ -753,7 +758,7 @@
.soup .shop-art {
height: auto;
}
.soup .shop-art svg {
.soup .shop-art > svg {
width: 70px;
}
.soup .shop-body h3 {

View file

@ -152,7 +152,7 @@ export const chapters = {
step(
"welcome",
"A little life in the soup",
"You are the green colony. Grow your population and evolve genes to advance along the evolution track. Highest score wins. These short lessons use prepared positions so you can learn one idea at a time.",
"You are the green colony. Grow your population and evolve genes to earn evolution points at the end of each round and advance along the evolution track. Highest score wins. These short lessons use prepared positions so you can learn one idea at a time.",
undefined,
undefined,
"colonies",
@ -276,7 +276,7 @@ export const chapters = {
only("done"),
),
],
"Open any gene you own, or the gene pool, to read its full effect. Genes also help you advance on the evolution track at the end of each round. For this calculation, normal genes count as 1, advanced genes as 2, and Ray Protection as 0. For example, two normal genes plus one advanced gene count as four genes, earning two spaces on the track in addition to those earned by your amoebas.",
"Open any gene you own, or the gene pool, to read its full effect. Genes also earn evolution points at the end of each round. For this calculation, normal genes count as 1, advanced genes as 2, and Ray Protection as 0. For example, two normal genes plus one advanced gene count as four genes, earning two evolution points in addition to those earned by your amoebas.",
),
environment: config(
"environment",
@ -340,14 +340,14 @@ export const chapters = {
),
step(
"scoring",
"Four survivors advance two spaces",
"A dead amoeba leaves two nutrients of every colour, if available. Your four survivors earn 2 evolution spaces. Genes can add more. Scoring starts with the leader, and occupied scores are jumped over without using a step.",
"Four survivors earn two evolution points",
"A dead amoeba leaves two nutrients of every colour, if available. Your four survivors earn 2 evolution points. Genes can add more. Scoring starts with the leader, and occupied scores are jumped over without using a step.",
undefined,
undefined,
"colonies",
),
],
"Population scoring: 0–2 / 3 / 4 / 5 / 6 / 7 amoebas → 0 / 1 / 2 / 4 / 5 / 6 spaces. Gene scoring: 0–2 / 3 / 4 / 5 / 6+ genes → 0 / 1 / 2 / 3 / 4. Finish the round when someone reaches 42 or the last environment card is drawn; highest score wins.",
"Population scoring: 0–2 / 3 / 4 / 5 / 6 / 7 amoebas → 0 / 1 / 2 / 4 / 5 / 6 evolution points. Gene scoring: 0–2 / 3 / 4 / 5 / 6+ genes → 0 / 1 / 2 / 3 / 4 evolution points. Finish the round when someone reaches 42 points or the last environment card is drawn; highest score wins.",
),
"movement-genes": config(
"movement-genes",
@ -373,7 +373,7 @@ export const chapters = {
step(
"double",
"Count the new gene correctly",
"You now choose a swimming direction without rolling. The move still costs 1 BP. Movement II counts as two genes for evolution and has mutation 5. It does not include Streamline or Speed.",
"You now choose a swimming direction without rolling. The move still costs 1 BP. Movement II counts as two genes when calculating evolution points and has mutation 5. It does not include Streamline or Speed.",
undefined,
undefined,
"genes",

View file

@ -17,6 +17,7 @@ import {
} from "../engine/index.js";
import { amoeba, icon, colors, colonyTraits } from "./art.js";
import { geneArt } from "./gene-art.js";
import { geneSummary } from "./gene-summary.js";
import { geneIcon, geneLabel } from "./gene-label.js";
import { richText, food, bp, injury, sensitivity } from "./rich-text.js";
import { pondArt } from "./pond.js";
@ -149,7 +150,7 @@ export function mountGame(
target.append(root);
root.innerHTML = `<header class="topbar"><div class="brand"><span>${amoeba("green", 0)}</span><div><h1>primordial soup<span class="title-dot">.</span></h1><span class="byline">DORIS MATTHÄUS & FRANK NESTEL</span></div></div><nav class="utilities" aria-label="Game options"><button class="quiet-button" data-ui="genes">${icon("spark")} Genes</button><button class="icon-button" data-ui="rules" aria-label="How to play">${icon("help")}</button><button class="icon-button" data-ui="fullscreen" aria-label="Fullscreen">${icon("expand")}</button></nav></header>
<div class="tutorial-slot"></div><section class="players" aria-label="The colonies" data-tutorial="colonies"></section>
<main class="play-area"><section class="pond-section" aria-label="Primordial soup board"><div class="pond-toolbar"><div><span class="eyebrow">A LITTLE LIFE IN A BIG SOUP</span><span class="pond-subtitle" id="turn-order"></span></div><button class="quiet-button" data-ui="journal">${icon("history")} Journal</button></div><div class="board-wrap"><div class="board" data-tutorial="board"><svg id="pond-art" viewBox="0 0 900 650" preserveAspectRatio="none" aria-hidden="true">${pondArt()}</svg><div class="cells"></div><div class="organisms"></div><div class="current-compass" data-tutorial="current"><span>CURRENT</span><div class="compass-arrow">➜</div><b class="compass-label"></b><small>Ozone <strong class="ozone"></strong></small></div><div class="soup-board-key"><span>EVOLUTION</span><b>42</b><small>Finish the round<br>when a colony reaches 42.</small></div></div></div><div class="pond-bottom"><span class="last-move" aria-live="polite"></span><span class="food-reserve" title="Food cubes remaining in the common supply"></span></div></section><aside class="colony-panel" data-tutorial="colony"></aside></main>
<main class="play-area"><section class="pond-section" aria-label="Primordial soup board"><div class="pond-toolbar"><div><span class="eyebrow">A LITTLE LIFE IN A BIG SOUP</span><span class="pond-subtitle" id="turn-order"></span></div><button class="quiet-button" data-ui="journal">${icon("history")} Journal</button></div><div class="board-wrap"><div class="board" data-tutorial="board"><svg id="pond-art" viewBox="0 0 900 650" preserveAspectRatio="none" aria-hidden="true">${pondArt()}</svg><div class="cells"></div><div class="organisms"></div><div class="current-compass" data-tutorial="current"><span>CURRENT</span><div class="compass-arrow">➜</div><b class="compass-label"></b><small>Ozone <strong class="ozone"></strong></small></div><div class="soup-board-key"><span>EVOLUTION POINTS</span><b>42</b><small>Finish the round<br>when a colony reaches 42 points.</small></div></div></div><div class="pond-bottom"><span class="last-move" aria-live="polite"></span><span class="food-reserve" title="Food cubes remaining in the common supply"></span></div></section><aside class="colony-panel" data-tutorial="colony"></aside></main>
<footer class="turnbar" data-tutorial="actions"><div class="round"><span>ROUND</span><strong class="round-number"></strong></div><div class="turn-details"><div class="phase-label"></div><div class="phase-instruction" aria-live="polite"></div><div class="phase-dots"></div></div><div class="action-buttons"></div></footer><div class="game-message" role="alert"></div>
<dialog><button class="close-modal icon-button" data-ui="close" aria-label="Close">×</button><div class="modal-content"></div></dialog>`;
const $ = (q) => root.querySelector(q),
@ -254,10 +255,10 @@ export function mountGame(
$(".food-reserve").innerHTML =
`<small>Supply</small>${nutrients(state.supply)}`;
$(".colony-panel").innerHTML =
`<div class="colony-heading"><div><span class="eyebrow">${shown === seat ? "YOUR COLONY" : "THE COLONY"}</span><h2>${esc(pl.name)}</h2></div><div class="bio-balance" data-tutorial="bp" title="Biological points">${icon("bio")}<strong>${pl.bp}</strong><span>BP</span></div></div><div class="specimen"><div class="specimen-orbit"></div><div id="selected-portrait">${amoeba(pl.color, a?.n ?? 1, colonyTraits(pl.genes))}</div><span class="specimen-coord">${a ? coordinate(a.cell) : "—"}</span></div><div class="specimen-heading"><h3>${a ? `Amoeba #${a.n}` : "Ready to grow"}</h3><span class="health ${a?.hp ? "hurt" : ""}">${a?.hp ? injury(a.hp) : "Feeling great"}</span></div><div class="diet"><span>Food colours</span><div>${state.players.map((_, p) => (p !== shown ? food(p) : "")).join("")}</div></div>${positions.length ? `<label class="amoeba-picker">New amoeba <select aria-label="Amoeba number">${[...new Set(positions.map((m) => m.n))].map((n) => `<option value="${n}" ${n === number ? "selected" : ""}>#${n}</option>`).join("")}</select></label>` : ""}<div class="gene-heading"><h3>Genes <span>${geneCount(state, shown)}</span></h3><button class="text-button" data-ui="genes">${t?.kind === "genes" && canAct() ? "Evolve ↗" : "Gene pool ↗"}</button></div><div class="gene-list" data-tutorial="genes">${pl.genes.map((g) => `<button class="gene" data-gene="${g.id}"><span class="gene-art">${geneIcon(g.id)}</span><span class="gene-text"><strong>${GENE[g.id].name}</strong><p>${GENE[g.id].points === 2 ? "Advanced gene" : "Colony adaptation"}</p></span><span class="gene-sensitivity" title="Mutation sensitivity">${icon("sun")}${GENE[g.id].mutation}</span></button>`).join("") || '<p class="empty-genes">No genes yet. New abilities evolve in phase 3.</p>'}</div><div class="colony-metrics"><span>${icon("sun")} <strong>${mutation(state, shown)}</strong> mutation</span><span title="Evolution before any further division or deaths">${icon("spark")} <strong>+${evolution(state, shown)}</strong> evolution</span></div>`;
`<div class="colony-heading"><div><span class="eyebrow">${shown === seat ? "YOUR COLONY" : "THE COLONY"}</span><h2>${esc(pl.name)}</h2></div><div class="bio-balance" data-tutorial="bp" title="Biological points">${icon("bio")}<strong>${pl.bp}</strong><span>BP</span></div></div><div class="specimen"><div class="specimen-orbit"></div><div id="selected-portrait">${amoeba(pl.color, a?.n ?? 1, colonyTraits(pl.genes))}</div><span class="specimen-coord">${a ? coordinate(a.cell) : "—"}</span></div><div class="specimen-heading"><h3>${a ? `Amoeba #${a.n}` : "Ready to grow"}</h3><span class="health ${a?.hp ? "hurt" : ""}">${a?.hp ? injury(a.hp) : "Feeling great"}</span></div><div class="diet"><span>Food colours</span><div>${state.players.map((_, p) => (p !== shown ? food(p) : "")).join("")}</div></div>${positions.length ? `<label class="amoeba-picker">New amoeba <select aria-label="Amoeba number">${[...new Set(positions.map((m) => m.n))].map((n) => `<option value="${n}" ${n === number ? "selected" : ""}>#${n}</option>`).join("")}</select></label>` : ""}<div class="gene-heading"><h3>Genes <span>${geneCount(state, shown)}</span></h3><button class="text-button" data-ui="genes">${t?.kind === "genes" && canAct() ? "Evolve ↗" : "Gene pool ↗"}</button></div><div class="gene-list" data-tutorial="genes">${pl.genes.map((g) => `<button class="gene" data-gene="${g.id}"><span class="gene-art">${geneIcon(g.id)}</span><span class="gene-text"><strong>${GENE[g.id].name}</strong><p>${richText(geneSummary(g.id, state.players.length))}</p></span><span class="gene-sensitivity" title="Mutation sensitivity">${icon("sun")}${GENE[g.id].mutation}</span></button>`).join("") || '<p class="empty-genes">No genes yet. New abilities evolve in phase 3.</p>'}</div><div class="colony-metrics"><span>${icon("sun")} <strong>${mutation(state, shown)}</strong> mutation</span><span title="Evolution points earned at the end of the round with the current amoebas and genes">${icon("spark")} <strong>+${evolution(state, shown)}</strong> evolution points</span></div>`;
$(".round-number").textContent = state.round || "—";
$(".phase-label").textContent = state.finished
? "Evolution complete"
? "Game complete"
: typeof state.phase === "number"
? `${state.phase + 1} / 6 · ${PHASES[state.phase]}`
: "Life begins · Setup";
@ -317,13 +318,13 @@ export function mountGame(
.join("")}</ol>`;
else if (GENE[modalKind]) {
const g = GENE[modalKind];
html = `<div class="gene-explainer-art">${geneArt(g.id)}</div><span class="eyebrow">${g.points === 2 ? "ADVANCED GENE" : "COLONY GENE"}</span><h2>${g.name}</h2><p>${richText(g.text)}</p><p>${bp(g.cost)} · ${sensitivity(g.mutation)} · counts as ${g.points} gene${g.points === 1 ? "" : "s"} for evolution.</p><div class="action-buttons">${actions()
html = `<div class="gene-explainer-art">${geneArt(g.id)}</div><span class="eyebrow">${g.points === 2 ? "ADVANCED GENE" : "COLONY GENE"}</span><h2>${g.name}</h2><p>${richText(g.text)}</p><p>${bp(g.cost)} · ${sensitivity(g.mutation)} · counts as ${g.points} gene${g.points === 1 ? "" : "s"} when calculating evolution points.</p><div class="action-buttons">${actions()
.map((m, i) =>
m.type === "discard" && m.gene === g.id ? actionButton(m, i) : "",
)
.join("")}</div>`;
} else
html = `<span class="eyebrow">HOW LIFE WORKS</span><h2>Welcome to the soup.</h2><p>Grow your population and evolve genes. At the end of each round, advance along the evolution track. When a colony reaches 42 — or the last environment card is revealed — finish the round. The highest score wins.</p><div class="help-steps"><section><h3>1 · Move & feed</h3><p>Lowest score first; amoebas act in number order. Drift with the current for free, or pay 1 BP to swim: roll a die for direction. 1 west, 2 north, 3 east, 4 south, 5 stay, 6 choose. A blocked move stays in place.</p></section><section><h3>Food & injuries</h3><p>Eat three nutrients, never your own colour. With four colonies, eat one of each other colour; with three, eat two of one and one of the other. After eating, excrete two nutrients of your own colour onto the same space. If you cannot eat, excrete nothing and take one injury instead.</p></section><section><h3>2 · Environment</h3><p>A new card sets the next current and ozone layer. If your mutation exceeds the ozone, pay the difference in BP or discard genes. No defects in round one.</p></section><section><h3>3 · New genes</h3><p>Highest score first. Buy as many genes as you can afford. Advanced genes replace a prerequisite owned since a previous round.</p></section><section><h3>4 · Cell division</h3><p>Receive 10 BP. Each new amoeba costs 6 BP and goes next to one of yours, without sharing your colour's space. With one amoeba, the second may go anywhere. With none, the first returns anywhere for free.</p></section><section><h3>5 · Survival</h3><p>Two injuries cause death, or three with Longevity. Return two food cubes of every colour to that space. Aggression happens after natural deaths.</p></section><section><h3>6 · Evolution</h3><p>3 / 4 / 5 / 6 / 7 amoebas advance 1 / 2 / 4 / 5 / 6 spaces. 3 / 4 / 5 / 6+ genes add 1 / 2 / 3 / 4. Advanced genes count twice; Ray Protection does not count. Jump over occupied scores.</p></section><section><h3>Food supply</h3><p>There are 55 cubes of each colour. If the supply runs out, place only the cubes still available. Dead amoeba numbers may be used again.</p></section></div><p><a href="${RULES_URL}" target="_blank" rel="noopener">Read the original English rules (PDF) ↗</a></p>`;
html = `<span class="eyebrow">HOW LIFE WORKS</span><h2>Welcome to the soup.</h2><p>Grow your population and evolve genes. At the end of each round, earn evolution points from your amoebas and genes. Advance along the evolution track, skipping occupied scores. When a colony reaches 42 points — or the last environment card is revealed — finish the round. The highest score wins.</p><div class="help-steps"><section><h3>1 · Move & feed</h3><p>Lowest score first; amoebas act in number order. Drift with the current for free, or pay 1 BP to swim: roll a die for direction. 1 west, 2 north, 3 east, 4 south, 5 stay, 6 choose. A blocked move stays in place.</p></section><section><h3>Food & injuries</h3><p>Eat three nutrients, never your own colour. With four colonies, eat one of each other colour; with three, eat two of one and one of the other. After eating, excrete two nutrients of your own colour onto the same space. If you cannot eat, excrete nothing and take one injury instead.</p></section><section><h3>2 · Environment</h3><p>A new card sets the next current and ozone layer. If your mutation exceeds the ozone, pay the difference in BP or discard genes. No defects in round one.</p></section><section><h3>3 · New genes</h3><p>Highest score first. Buy as many genes as you can afford. Advanced genes replace a prerequisite owned since a previous round.</p></section><section><h3>4 · Cell division</h3><p>Receive 10 BP. Each new amoeba costs 6 BP and goes next to one of yours, without sharing your colour's space. With one amoeba, the second may go anywhere. With none, the first returns anywhere for free.</p></section><section><h3>5 · Survival</h3><p>Two injuries cause death, or three with Longevity. Return two food cubes of every colour to that space. Aggression happens after natural deaths.</p></section><section><h3>6 · Evolution points</h3><p>3 / 4 / 5 / 6 / 7 amoebas earn 1 / 2 / 4 / 5 / 6 evolution points. 3 / 4 / 5 / 6+ genes earn another 1 / 2 / 3 / 4 evolution points. Advanced genes count twice; Ray Protection does not count. Jump over occupied scores.</p></section><section><h3>Food supply</h3><p>There are 55 cubes of each colour. If the supply runs out, place only the cubes still available. Dead amoeba numbers may be used again.</p></section></div><p><a href="${RULES_URL}" target="_blank" rel="noopener">Read the original English rules (PDF) ↗</a></p>`;
$(".modal-content").innerHTML = html;
if (modalKind === "rules") {
for (const text of $(".modal-content").querySelectorAll(