Nimbin[12]?Games / Entropie / commits / 58007af

Entropie git · main

Entropie festival game; first steps

sdl c game entropie cmake · first commit 2026-10-10 · last commit 2026-11-02 (17 hours ago) · synced 8 hours ago

C 88.5% Markdown 9.1% GLSL 2.3%
git clone https://git.christianimmanuel.de/games/Entropie.gitwget https://git.christianimmanuel.de/games/Entropie/archive/Entropie.tar.gz

entropie 1.83.0: a hand on it, and the ashtray gets emptied

Christian Immanuel · 2026-10-15 16:40 · 58007afb6fca6fd53ec834e583b1b657a614eaf5

- Peeing standing: one hand holds it (the Urinella to the body), the other
  stays at the belt
- A full ashtray (12 butts) gets emptied by somebody tidy: into a scrap of
  paper, off to the bin
- Fix: a tidy person could stand still for minutes, reaching again and
  again for trash just out of reach

Includes 1.82.0 (if not committed separately):
- Walking styles: feet wider or narrower, toes out more or less, bouncier
  or flatter (livelier when lively), hips swaying more or less
- The ashtray stands on the cool box by the fire (on the ground it was in
  everybody's way)

Includes 1.81.0 (if not committed separately):
- Fix: following someone on a chat break (and walking up to things) went
  walk-stop-walk every frame, the whole body shook; now they slow down
  coming up and stay with them
- Fix: an elbow could flip over when a hand went up past the shoulder
  (scratching the head); it turns round the arm now

Includes 1.80.0 (if not committed separately):
- An old tin by the fire as ashtray: you and the tidy put butts in there
- The Urinella is drawn while it's used; the dress is lifted higher
- After peeing you take up again what you put down
- The others can slip off a wobbly ladder too

Includes 1.79.0 (if not committed separately):
- Helpers (G) follow you up a leaning ladder onto a roof or wall and down
  again; without a ladder they pull themselves up after you (if they reach)
  and jump down when you're down
- Pulling up is a module for anybody now (people/climb.c), not only you

Includes 1.78.0 (if not committed separately):
- Cold nights: away from the fire a jacket goes on (each their own colour)
- Working hard in the midday sun your shirt comes off too
- Women who never tried a Urinella may try one: some like it, some don't
- Dying for a smoke makes restless; a wobbling ladder rocks
- Moving heavy wood: tested with a called helper; the player is asked when
  nobody else is around

Includes 1.77.0 (if not committed separately):
- Ladders: carried nearly upright when out; stood up on their own they
  fall over; leaned, how steady they stand depends on angle, ground, feet
  and what holds them; a wobbly one wobbles, then slips and falls with you
- Somebody holds it (hands on the rails, a foot on the bottom rung):
  helpers (G) when you climb, helpful people when it looks wobbly
- The work place: the tidy clear away what lies where they'd stand; no room
  to swing, they take the piece somewhere with room (carried, or dragged
  with somebody called to help)
- The sporty pull up and climb ladders much quicker

Includes 1.76.0 (if not committed separately):
- Smoking: packs and tobacco in the pockets (used up); smokers get a
  craving and light up in a quiet moment - rolling one first, the lighter
  to it, drags (the tip glows), smoke breathed out, the butt flicked away
- Shared: "Got a light?", bumming a cigarette (or a no); talk to ask for
  one or offer one; K lights yours / puts it out; Tab shows your pockets
- Shadows: soft, smooth edges instead of stair steps

Includes 1.75.0 (if not committed separately):
- Urinellas: one-time use, up to 4 in the pocket; a box by the toilet
  refills it (the others fetch more when they run out, you click it)
- Peeing: what's in the hands is put down first (the others take it up
  again); standing, the fly is open or the skirt or dress lifted
- Lighter: needed to light the fire, runs empty; borrowed when there's
  none, given back (or not), owners ask for it; talk: borrow, give back,
  ask for yours back
- Working hard in the midday sun the shirt comes off (women keep a top)
- Dropping from high up: knees pulled up, legs reach for the ground, deep
  into the knees, a roll or a crash
- Ladders: one-handed climbing (you may slip), a lying ladder is stepped
  over, kicked it hardly moves and your toe hurts
- Dev menu: teleport to the parkour / yard; the player spawns 1 m up

Includes 1.74.0 (if not committed separately):
- Fix: legs showed through a skirt or dress standing normally; the thighs
  under it are cloth now and it's wider over the hips
- Mila's Urinellas come in a pack of 3 (then she squats); now and then a
  mishap (on the shoes); used ones go into the bag, are dropped or flung
  away (drunk) as trash

Includes 1.73.0 (if not committed separately):
- Clothes: trousers, shorts, skirt, dress; squatting to pee trousers come
  down, a skirt or dress is gathered up

Includes 1.72.0 (if not committed separately):
- Fix: walking off the other way from something half stepped over left
  one foot planted behind, sliding along

Includes 1.71.0 (if not committed separately):
- Two-handed fidgets: rubbing the hands, hands behind the head, both
  hands on the hips

Includes 1.70.0 (if not committed separately):
- More one-hand gestures (neck, nose, ear, hair, thumb in the belt, hand
  on the chest, shading the eyes); mood and personal habits pick them

Includes 1.69.0 (if not committed separately):
- Faster with a crowd: 750 people 22 -> 14 ms a frame (kind index, cell
  grid for company, no foot checks far from you)

Includes 1.68.0 (if not committed separately):
- The walking map is updated in place when fixed things change
  (0.3 ms instead of 10 ms)

Includes 1.67.0 (if not committed separately):
- Pour your drink on the fire (C): a small fire goes out, a big one
  hisses, vodka flares up

Includes 1.66.0 (if not committed separately):
- Careful people sort the woodpile by length (front even) and put the
  branches lying about onto a heap at the end of the woodpile

Includes 1.65.0 (if not committed separately):
- Smooth off the ladder (a step back, one foot after the other) and
  taking it down (the hand reaches for the rail at chest height)

Includes 1.64.0 (if not committed separately):
- Smooth ladder and climbs: getting on, over the edge at the top, feet
  from where they are; the easy 1 m climb no longer drops you off again

Includes 1.63.0 (if not committed separately):
- The hose melts in the fire (leaks, burns through); duct tape and the
  shears mend it

Includes 1.62.0 (if not committed separately):
- Smooth pull-ups: no hop at the end, feet and knees ease over the edge,
  elbows and hands taking hold blend in (audit walk: joint jumps 161 -> 58)

Includes 1.61.0 (if not committed separately):
- A step ladder in the tool room: stands on its own, at a wall with its
  back to it; climb onto the wall from its top

Includes 1.60.0 (if not committed separately):
- A folding ladder (two 2.5 m halves on a hinge, 5 m open) beside the
  telescopic one; one click at a wall unfolds it and leans it there

Includes 1.59.0 (if not committed separately):
- Stepping up onto blocks above knee high; set moves and jumps only for
  things standing on the ground in front of you

Includes 1.58.0 (if not committed separately):
- Walking over knee-high things is one smooth set move that always
  finishes; at a run: jump up onto blocks, catch climbable edges
 entropie/Makefile               |  2 +-
 entropie/README.md              |  5 ++++-
 entropie/STATE.md               |  9 ++++-----
 entropie/commit_message.txt     | 10 +++++++++-
 entropie/src/people/ai.h        |  2 ++
 entropie/src/people/ai_help.c   | 23 ++++++++++++++++++++++-
 entropie/src/people/body_pose.c |  4 ++++
 entropie/src/world/world.c      | 15 +++++++++++++++
 8 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/entropie/Makefile b/entropie/Makefile
index b0a707b..db3f986 100644
--- a/entropie/Makefile
+++ b/entropie/Makefile
@@ -1,5 +1,5 @@
 APP       := entropie
-VERSION   := 1.82.0
+VERSION   := 1.83.0
 
 PREFIX    ?= /usr
 BINDIR    ?= $(PREFIX)/bin
diff --git a/entropie/README.md b/entropie/README.md
index bd199c8..78c5fb3 100644
--- a/entropie/README.md
+++ b/entropie/README.md
@@ -447,6 +447,8 @@ say no more often and don't come to you for a bit.
   front between drags. Hands needed: it goes into the mouth
 - Done: flicked away or dropped as a butt (into the fire when close; the
   tidy and you use the old tin on the cool box by the fire as ashtray)
+- A full ashtray gets emptied by somebody tidy (into a scrap of paper, off
+  to the bin)
 - K: light one (yours, or somebody next to you gives you a light), K again
   puts it out. Talk: ask somebody for a cigarette, or offer one
 - Packs and tobacco run out; Tab (skills page) shows your pockets
@@ -471,7 +473,8 @@ say no more often and don't come to you for a bit.
 - Women who never tried a Urinella may try one from the box: some like it,
   some say "not for me" and squat again
 - Before peeing, what's in the hands is put down beside you, and taken up
-  again after (you too). The Urinella shows while it's used
+  again after (you too). The Urinella shows while it's used. Standing,
+  one hand holds it (or him), the other stays at the belt
   A used Urinella goes into the bag (tidy), is dropped (careless) or flung
   away (drunk); now and then it ends up on the shoes
 - Clothes: trousers, shorts (Jonas), a skirt (Ida) or a dress (Mila)
diff --git a/entropie/STATE.md b/entropie/STATE.md
index 85f2881..05a874e 100644
--- a/entropie/STATE.md
+++ b/entropie/STATE.md
@@ -70,7 +70,7 @@ Climbing for anybody (`people/climb.c`, moved out of the game): `Climb_ledgeAhea
 
 Walking styles (`Body.style[4]`, -1..1 per person, made from the quirks - no extra dice, so nothing else changes): feet apart x (1 + 0.15 style0), toes out + 0.04 rad x style1, the bob x (1 + 0.35 style2 + 0.25 lively), the hips swaying over the standing foot x (1 + 0.35 style3). (The audit swings both ways with it - it changes where everybody goes; overall the player's numbers are lower.)
 
-Ashtray (FURN_ASHTRAY, an old tin on the cool box by the fire - on the ground it was in everybody's way, `stored` = butts): a finished cigarette within 4 m of it goes in if it's yours or the smoker is tidy (likes trash over 0.2 or pride over 0.4, under 0.6 drunk). The Urinella is drawn while it's used (skeleton `uri`, a funnel from the body to the spout; the stream starts at its end); standing with one, a skirt or dress is lifted higher in front. You take up again what you put down to pee (`ai.set_aside`, within 1.8 m). The others slip off wobbly ladders like you (`ai_climbing`: wobble, then the ladder falls sideways).
+Ashtray (FURN_ASHTRAY, an old tin on the cool box by the fire - on the ground it was in everybody's way, `stored` = butts): a finished cigarette within 4 m of it goes in if it's yours or the smoker is tidy (likes trash over 0.2 or pride over 0.4, under 0.6 drunk). Emptying it (`ai_help.c` ai_tidyUp, ASHTRAY_FULL 12 butts): somebody tidy (likes trash 0.35+), idle or wandering, a hand free, not smoking, within 50 m walks over (gives up after 45 s: skipped a while); `ai.empty_tray` -> `world.c` emptyTray: the butts into a scrap of paper ("Butts in paper", OBJ_TRASH) in the hand, `stored` 0; then to the bin like other trash. Trash just out of reach is skipped instead of reached for again and again (Ida stood still for minutes). Standing to pee, one hand holds it (the Urinella to the body; the side by `quirk[1]`), the other stays at the belt (`body_pose.c`). The Urinella is drawn while it's used (skeleton `uri`, a funnel from the body to the spout; the stream starts at its end); standing with one, a skirt or dress is lifted higher in front. You take up again what you put down to pee (`ai.set_aside`, within 1.8 m). The others slip off wobbly ladders like you (`ai_climbing`: wobble, then the ladder falls sideways).
 
 Smoother: walking up to something (`goTo`) slows down as they get there (no full speed then stop, then on again); on a chat break they stay "close" until 1.6 x the chatting distance (was: one frame walking, one standing, after somebody walking slowly - the whole body shook). Arms: when the elbow's pole lies nearly along the arm (a hand going up past the shoulder) the bend leans on "out to the side" or "down and back", blended (`twoBone`, arms only), and an elbow moves at most 5.5 m/s (`JOINT_TOP_ELBOW`): no elbow flipping over (worst arm jump in the audit 58 -> 40 cm).
 
@@ -181,7 +181,7 @@ A cell grid of the site (2 m cells, `src/world/grid.c`, built once a frame) answ
 Most important first.
 
 **Bugs**
-- Joint jumps left in the audit: jog+stop 191, sprint 358 (worst 28 cm) - running into things; ladder 45: toes on the sloping roof (a landing step's toes snap onto the slope, 16 cm; blending them in made all walking worse), toes turning onto the rungs getting on from the top (14 cm)
+- Joint jumps left in the audit: jog+stop 171, sprint 297 (worst 26 cm) - running into things: a hurried catch step swings through in a few frames (step 0.07 -> 0.34, the ankle up 20 cm). Capping the swing speed helped sprint (278) but made jumps, drunk walk and the NPCs worse - tried and reverted in 1.83; ladder 45: toes on the sloping roof (a landing step's toes snap onto the slope, 16 cm; blending them in made all walking worse), toes turning onto the rungs getting on from the top (14 cm)
 
 **Body and moving**
 - Obstacle approach, still to do: prefer a step in between on top of something stable (or unstable, if clumsy) over a long stride; NPCs: pull up on their own for their own reasons (now only following a leader), jumping onto things
@@ -193,8 +193,7 @@ Most important first.
 **People**
 - The work place, still to do: other jobs than split / cut (felling room, trash); walking a heavy piece round tight corners
 - Ladders, still to do: a holder for a ladder standing free; NPCs taking a ladder somewhere for their own work
-- Smoking, still to do: buying more (a kiosk); emptying the ashtray
-- Peeing, still to do: the hands holding the Urinella (now at the belt)
+- Smoking, still to do: buying more (a kiosk); the butts showing in the tin (the mesh always has 3)
 - "No shirt no service" policy (decision open)
 - Clothing, still to do: more outfits for extra people (they all wear trousers); fetching the jacket from somewhere
 
@@ -205,4 +204,4 @@ Most important first.
 - Drawing many figures on a real graphics card: not measured (software GL: 300 people cost 3x the rest of the scene)
 
 ---
-State of `entropie 1.82.0 (build 274c0cf)`
+State of `entropie 1.83.0 (build a45a9ec)`
diff --git a/entropie/commit_message.txt b/entropie/commit_message.txt
index dae1255..152a468 100644
--- a/entropie/commit_message.txt
+++ b/entropie/commit_message.txt
@@ -1,5 +1,13 @@
-entropie 1.82.0: everyone walks their own way
+entropie 1.83.0: a hand on it, and the ashtray gets emptied
 
+- Peeing standing: one hand holds it (the Urinella to the body), the other
+  stays at the belt
+- A full ashtray (12 butts) gets emptied by somebody tidy: into a scrap of
+  paper, off to the bin
+- Fix: a tidy person could stand still for minutes, reaching again and
+  again for trash just out of reach
+
+Includes 1.82.0 (if not committed separately):
 - Walking styles: feet wider or narrower, toes out more or less, bouncier
   or flatter (livelier when lively), hips swaying more or less
 - The ashtray stands on the cool box by the fire (on the ground it was in
diff --git a/entropie/src/people/ai.h b/entropie/src/people/ai.h
index f3148fb..7d79c2d 100644
--- a/entropie/src/people/ai.h
+++ b/entropie/src/people/ai.h
@@ -157,8 +157,10 @@ typedef struct {
     bool           pee_hidden;  /* ... if there is something */
     float          annoyed;     /* 0..1: left waiting for an answer, ignored; eases off over minutes */
     bool           wants_bag;   /* at the garbage bags: the world hands them one */
+    struct Object *empty_tray;  /* at a full ashtray: the world tips it out into their hand */
     bool           tool_asked;  /* asked the player for their axe (once per order) */
     float          tidy_pause;  /* bending down for trash on the way (seconds left) */
+    float          tray_time;   /* on the way to empty the ashtray this long */
     bool           tool_waiting; /* waiting for the player to put the axe down */
     unsigned char  banned;      /* tools (1 << ToolKind) they were told to leave alone ... */
     unsigned char  defies;      /* ... and those they use anyway ("I know what I'm doing") */
diff --git a/entropie/src/people/ai_help.c b/entropie/src/people/ai_help.c
index 97ecc9c..0369dcf 100644
--- a/entropie/src/people/ai_help.c
+++ b/entropie/src/people/ai_help.c
@@ -218,6 +218,7 @@ static bool helpWood(Object *self, Object *const *objects, int count, float dt)
 #define TIDY_LIKE    0.35f  /* liking tidying up this much ... */
 #define TIDY_REACH   1.3f   /* ... picks up trash this close on the way */
 #define TIDY_BIN     50.0f  /* takes it to a container this far away when there's time */
+#define ASHTRAY_FULL 12     /* butts: the tidy empty the ashtray */
 
 static Object *trashInHands(const Object *self) {
     for (int h = 0; h < 2; h++)
@@ -245,14 +246,34 @@ bool ai_tidyUp(Object *self, Object *const *objects, int count, float dt) {
             float d = vec3_length(to);
             if (d > TIDY_REACH || (d > 0.5f && vec3_dot(vec3_scale(to, 1.0f / d), f) < 0.2f)) continue;
             if (claimed(self, objects, count, o)) continue;
+            if (!Hands_pickUpObject(self, hand, o)) { skipTarget(ai, o); continue; } /* (just out of reach: not again and again) */
             stand(self);
             turnTowards(self, to, dt);
-            Hands_pickUpObject(self, hand, o);
             ai->tidy_pause = 0.7f;
             if (random01(ai) < 0.25f) Ai_say(self, random01(ai) < 0.5f ? "Tsk. People..." : "That doesn't belong here.");
             return true;
         }
     }
+    /* a full ashtray, nothing else to do: tipped out (into a scrap of paper), off to the bin with it */
+    if ((ai->mode == AI_IDLE || ai->mode == AI_WANDER) && hand >= 0 && !trashInHands(self) && !Body_isSmoking(&self->body)) {
+        Object *tin = NULL;
+        for (int i = 0; i < count && !tin; i++) {
+            Object *o = objects[i];
+            if (o->type == OBJ_FURNITURE && o->variant == FURN_ASHTRAY && o->stored >= ASHTRAY_FULL &&
+                flatDistance(o->position, self->position) < TIDY_BIN && !claimed(self, objects, count, o)) tin = o;
+        }
+        if (tin) {
+            if ((ai->tray_time += dt) > 45.0f) { skipTarget(ai, tin); ai->tray_time = 0.0f; return false; } /* (can't get there) */
+            if (goTo(self, tin, objects, count, 0.75f, dt)) {
+                ai->tray_time = 0.0f;
+                turnTowards(self, flat(vec3_sub(tin->position, self->position)), dt);
+                ai->empty_tray = tin;
+                ai->tidy_pause = 1.0f;
+                Ai_say(self, random01(ai) < 0.5f ? "Full to the brim again." : "Who smokes all this?");
+            }
+            return true;
+        }
+    }
     /* nothing better to do: to the container with it */
     if ((ai->mode == AI_IDLE || ai->mode == AI_WANDER) && trashInHands(self)) {
         Object *bin = ai_nearestOf(self, objects, count, OBJ_BIN, OBJ_BOX);
diff --git a/entropie/src/people/body_pose.c b/entropie/src/people/body_pose.c
index fb33c03..90098a4 100644
--- a/entropie/src/people/body_pose.c
+++ b/entropie/src/people/body_pose.c
@@ -719,6 +719,10 @@ static void solveStanding(Body *b, Vec3 position, Vec3 facing, float s, float dt
             if (pee >= fmaxf(fmaxf(clasp, behind), bent)) {
                 palm = vec3(sign * 0.04f + j[JOINT_PELVIS].x, 0.84f, 0.14f);
                 pole = vec3(sign * 0.8f, -0.2f, -0.4f);
+                if (hold > 0.5f && !b->squat_pee) { /* standing: one hand holds it (the Urinella to the body), the other the belt or the hem */
+                    palm = vec3_add(j[JOINT_PELVIS], b->urinella_use ? vec3(sign * 0.02f, -0.12f, 0.12f) : vec3(sign * 0.015f, -0.095f, 0.13f));
+                    pole = vec3(sign * 0.9f, -0.1f, -0.5f);
+                }
             }
             blendArm(&arm, palm, pole, habit);
         }
diff --git a/entropie/src/world/world.c b/entropie/src/world/world.c
index d815bff..f9feb2d 100644
--- a/entropie/src/world/world.c
+++ b/entropie/src/world/world.c
@@ -953,6 +953,20 @@ static void handOutBag(World *world, Object *o) {
     if (bag && World_add(world, bag)) Hands_pickUpObject(o, hand, bag);
 }
 
+/* A full ashtray tipped out into a scrap of paper in someone's hand (it goes to the bin then). */
+static void emptyTray(World *world, Object *o) {
+    Object *tin = o->ai.empty_tray;
+    o->ai.empty_tray = NULL;
+    int hand = Hands_freeHand(o);
+    if (hand < 0 || !tin || tin->stored <= 0) return;
+    Object *butts = Object_create(OBJ_TRASH, PALETTE_WARM, vec3_add(tin->position, vec3(0.0f, 0.16f, 0.0f)), vec3(0.07f, 0.03f, 0.06f), 0.04f);
+    if (!butts) return;
+    snprintf(butts->name, sizeof(butts->name), "Butts in paper");
+    if (!World_add(world, butts)) return;
+    tin->stored = 0;
+    if (!Hands_pickUpObject(o, hand, butts)) Hands_receive(o, hand, butts); /* (the tin a bit far: tipped into the hand all the same) */
+}
+
 void World_update(World *world, float dt, float game_dt) {
     Object_indexKinds(world->objects, world->count); /* (who's a person, where the fires are: looked up again and again) */
     for (int i = 0; i < world->count; i++) {
@@ -972,6 +986,7 @@ void World_update(World *world, float dt, float game_dt) {
         Condition_update(o, world->objects, world->count, dt, game_dt);
         if (o->type == OBJ_HUMAN) { Ai_useGrid(&world->grid); Ai_useWorld(world); Ai_update(o, world->objects, world->count, dt); }
         if (o->type == OBJ_HUMAN && o->ai.wants_bag) handOutBag(world, o);
+        if (o->type == OBJ_HUMAN && o->ai.empty_tray) emptyTray(world, o);
     }
 
     Physics_useGrid(&world->grid);