Entropie git · main
Entropie festival game; first steps
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.gzentropie 1.73.0: clothes - trousers, shorts, skirt, dress
- People wear trousers, shorts (Jonas), a skirt (Ida) or a dress (Mila); skirts and dresses are a cone from the waist to the knees that widens as the knees part, bare legs under them - Squatting to pee: trousers come down to the knees, a skirt or dress is gathered up to the hips 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 | 4 +++- entropie/STATE.md | 7 ++++--- entropie/assets/shaders/figure.frag | 27 +++++++++++++++++++++++---- entropie/commit_message.txt | 14 ++++++++++---- entropie/src/people/body_pose.c | 2 ++ entropie/src/render/figure.h | 5 +++++ entropie/src/render/renderer.c | 4 ++++ entropie/src/render/renderer.h | 1 + entropie/src/world/scene.c | 2 ++ 10 files changed, 55 insertions(+), 13 deletions(-) diff --git a/entropie/Makefile b/entropie/Makefile index a694be4..3f02923 100644 --- a/entropie/Makefile +++ b/entropie/Makefile @@ -1,5 +1,5 @@ APP := entropie -VERSION := 1.72.0 +VERSION := 1.73.0 PREFIX ?= /usr BINDIR ?= $(PREFIX)/bin diff --git a/entropie/README.md b/entropie/README.md index a19e5df..3a6691e 100644 --- a/entropie/README.md +++ b/entropie/README.md @@ -417,7 +417,9 @@ say no more often and don't come to you for a bit. Aim with the mouse, hold Shift to push harder (further, quicker done). Next to the toilet (the blue cabin by the barn) P takes you inside; the others use it too when it's not too far, and wait if it's occupied -- Women squat to pee, unless they have a Urinella (Mila does) +- Women squat to pee, unless they have a Urinella (Mila does). Squatting, + trousers come down to the knees, a skirt or dress is gathered up +- Clothes: trousers, shorts (Jonas), a skirt (Ida) or a dress (Mila) - The others use the toilet when it's free and not too far; busy (they wait a while, less when it's urgent) or far: a decently hidden spot behind a bush, tree, wall or car, away from the others; spots others used are diff --git a/entropie/STATE.md b/entropie/STATE.md index ee38756..5cb3004 100644 --- a/entropie/STATE.md +++ b/entropie/STATE.md @@ -67,6 +67,7 @@ Talk topics: offer, ask, suggest, where (new woodpile spot), ask for a hand, ask - **Poses**: up, falling, lying down to sleep, down, getting up; sitting on a seat or cross-legged on the ground. Lying down (or falling) before ever having faced anywhere (asleep or passed out right where they stood): back, as usual (it collapsed into a heap "sitting over the floor") - **Fidgets** (standing about): shake a leg, rock on the toes, stretch, roll shoulders, stretch the neck, fold arms, tap a foot; two-handed: rubbing the hands (nervous), hands behind the head (at ease, proud, lively), both hands on the hips (proud) - **Gestures** (one hand, idle; `body.c` picks, `body_pose.c` gesturePalm): hip, scratching the head, chin, pocket, rubbing the neck, rubbing the nose, earlobe, back through the hair, thumb in the belt, hand on the chest, shading the eyes. Weighted by mood: proud (hip, hair, thumb), shy (pocket, neck, ear, chest), nervous (head, chin, nose, ear), tired (neck), lively (hair, shading). Everyone has two habits of their own (`habit`, x3 and x2) +- **Clothes** (`FigureLook.garment`, drawn in `figure.frag`): trousers, shorts (bare shins), a skirt (pants colour) or a dress (shirt colour): a cone from the waist to just below the knees, wider as the knees part; under it bare legs. Squatting to pee (`Skeleton.undress`, from the pee and the crouch): trousers down to the knees (hips and thighs bare, the trousers bunched round the shins), a skirt or dress gathered up to the hips. Cast: You and Ben trousers, Jonas shorts, Ida a skirt, Mila a dress - **Face**: mouth, eyelids, brows, smile, gaze; drunk, tired, shy, proud show in it - **Falls**: straight over, knees first, twisting, diving forward; reeling back first; stumbles over the foot that caught - **Where a fall lands**: the way it was going if there's room, else turned aside or shorter (crumpling at the foot of a wall); lies across things up to 0.5 m high, never into or over higher ones; no part of the body goes into what it comes down on (lifted onto it, limbs refitted); sitting, the legs rest on what lies in front; the lift eases in and out (5 m/s), no jumps @@ -149,8 +150,8 @@ Most important first. - More gestures and feelings to pick personalities from: the lists in Body / Fidgets and Gestures can grow **People** -- Peeing properly: open the fly; women crouch and pull down / lift the skirt or dress; Urinella (some don't like it; mishaps; tidy, careless or high disposal) -- Clothing (trousers, skirt, dress, fly) – needed for the above +- Peeing, still to do: open the fly standing; Urinella (some don't like it; mishaps; tidy, careless or high disposal) +- Clothing, still to do: more outfits for extra people (they all wear trousers), jackets at night **Tools for us** - Optional local AI (llama.cpp, small model) for talking and tasks; the menu stays as fallback @@ -159,4 +160,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.72.0 (build d4392f3)` +State of `entropie 1.73.0 (build 79fb1fb)` diff --git a/entropie/assets/shaders/figure.frag b/entropie/assets/shaders/figure.frag index 79a15fa..5759dca 100644 --- a/entropie/assets/shaders/figure.frag +++ b/entropie/assets/shaders/figure.frag @@ -37,6 +37,8 @@ uniform vec3 shoeColor; uniform vec3 stream[4]; // pee or sick: an arc from the body to the ground (figure space) uniform int streamKind; // 0 none, 1 pee, 2 sick, 3 water uniform float streamWidth; +uniform int garment; // 0 trousers, 1 shorts, 2 skirt, 3 dress +uniform float undress; // squatting to pee: trousers down / skirt up (0..1) uniform mat4 viewProj; uniform mat4 view; @@ -58,7 +60,7 @@ const float SELF_SHADOW_SKIP = 0.10; // meters // ---------- Body parts ---------- -const int MAX_PARTS = 27; +const int MAX_PARTS = 28; vec3 partA[MAX_PARTS], partB[MAX_PARTS]; float partR1[MAX_PARTS], partR2[MAX_PARTS]; float partBlend[MAX_PARTS]; // smooth-union radius with the rest of the body @@ -92,17 +94,34 @@ void buildBody() { addPart(waist, chest + spineDir * 0.03 - chestForward * 0.005, 0.135, 0.160, 0.04, 0.66, M_SHIRT); addPart(joints[J_SHOULDER_L], joints[J_SHOULDER_R], 0.050, 0.050, 0.05, 0.75, M_SHIRT); + // What's on the legs: trousers, shorts, a skirt or a dress (squatting to pee: + // trousers pulled down to the knees, a skirt or dress gathered up) + bool down = undress > 0.5; + int lower = garment == 3 ? M_SHIRT : M_PANTS; + int hips = (garment == 0 && down) ? M_SKIN : lower; + int thigh = (garment == 0 && !down) || garment == 1 ? M_PANTS : M_SKIN; + int shin = garment == 0 ? M_PANTS : M_SKIN; + // Pelvis spans the hips, so the thighs grow out of it addPart(joints[J_HIP_L] + spineDir * 0.04, joints[J_HIP_R] + spineDir * 0.04, - 0.100, 0.100, 0.05, 0.78, M_PANTS); + 0.100, 0.100, 0.05, 0.78, hips); + + // A skirt or dress: a cone from the waist down to the knees (wider as they part) + if (garment >= 2) { + vec3 knees = 0.5 * (joints[J_KNEE_L] + joints[J_KNEE_R]); + vec3 top = pelvis + spineDir * 0.07; + vec3 hem = mix(knees + vec3(0.0, -0.04, 0.0), top, 0.6 * undress); + float wide = 0.5 * length(joints[J_KNEE_L] - joints[J_KNEE_R]) + 0.075; + addPart(top, hem, 0.135, max(wide, 0.15), 0.03, 0.85, lower); + } // Legs and feet for (int s = 0; s < 2; s++) { int o = s * 4; vec3 knee = joints[J_KNEE_L + o], ankle = joints[J_ANKLE_L + o], toe = joints[J_TOE_L + o]; vec3 heel = ankle - normalize(toe - ankle) * 0.03 + normalize(ankle - knee) * 0.02; - addPart(joints[J_HIP_L + o], knee, 0.085, 0.058, 0.05, 1.0, M_PANTS); - addPart(knee, ankle, 0.055, 0.040, 0.02, 1.0, M_PANTS); + addPart(joints[J_HIP_L + o], knee, 0.085, 0.058, 0.05, 1.0, thigh); + addPart(knee, ankle, 0.055, 0.040, 0.02, 1.0, shin); addPart(ankle, toe, 0.045, 0.034, 0.02, 1.0, M_SHOES); addPart(heel, heel, 0.045, 0.045, 0.02, 1.0, M_SHOES); } diff --git a/entropie/commit_message.txt b/entropie/commit_message.txt index 4090a1b..8d7b7fb 100644 --- a/entropie/commit_message.txt +++ b/entropie/commit_message.txt @@ -1,8 +1,14 @@ -entropie 1.72.0: fix one foot left behind after turning away from something +entropie 1.73.0: clothes - trousers, shorts, skirt, dress -- Someone who started stepping over something and then walked off the - other way stayed "half over": one foot kept stepping, the other stayed - planted behind, sliding along (NPC audit: foot slides 3414 -> 346) +- People wear trousers, shorts (Jonas), a skirt (Ida) or a dress (Mila); + skirts and dresses are a cone from the waist to the knees that widens + as the knees part, bare legs under them +- Squatting to pee: trousers come down to the knees, a skirt or dress is + gathered up to the hips + +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 diff --git a/entropie/src/people/body_pose.c b/entropie/src/people/body_pose.c index 29cb798..f0c4fbf 100644 --- a/entropie/src/people/body_pose.c +++ b/entropie/src/people/body_pose.c @@ -931,6 +931,8 @@ static Vec3 arcAt(const StreamArc *a, float t) { static void solveStream(const Body *b, Vec3 facing, Skeleton *out, StreamArc *arc) { const float GRAVITY = 9.81f; out->stream_kind = STREAM_NONE; + /* squatting to pee: trousers down, skirt or dress gathered up (eased with the pee) */ + out->undress = b->squat_pee && b->pose == POSE_UP ? smoothstepf(0.0f, 0.5f, peeing(b)) * smoothstepf(0.4f, 0.8f, b->crouch) : 0.0f; if (b->pose != POSE_UP) return; const Vec3 *j = out->joints; float pee = peeing(b), heave = heaving(b); diff --git a/entropie/src/render/figure.h b/entropie/src/render/figure.h index b4e3319..062ef6e 100644 --- a/entropie/src/render/figure.h +++ b/entropie/src/render/figure.h @@ -26,8 +26,12 @@ typedef struct { float height; /* meters */ HairStyle hair_style; bool long_sleeves; + int garment; /* GARMENT_*: what's on the legs */ } FigureLook; +/* Trousers (pants colour), shorts (knee-length), a skirt (pants colour) or a dress (shirt colour). */ +enum { GARMENT_TROUSERS, GARMENT_SHORTS, GARMENT_SKIRT, GARMENT_DRESS }; + /* * Joints in figure space: meters, origin between the feet on the ground, * x = figure's right, y = up, z = figure's forward. @@ -62,6 +66,7 @@ typedef struct { Vec3 stream[4]; int stream_kind; /* STREAM_NONE / STREAM_PEE / STREAM_VOMIT */ float stream_width; /* meters */ + float undress; /* squatting to pee: trousers down / skirt up (0..1) */ } Skeleton; enum { STREAM_NONE, STREAM_PEE, STREAM_VOMIT, STREAM_WATER }; diff --git a/entropie/src/render/renderer.c b/entropie/src/render/renderer.c index 226c863..44b0557 100644 --- a/entropie/src/render/renderer.c +++ b/entropie/src/render/renderer.c @@ -95,6 +95,8 @@ static bool loadShaders(Renderer *r) { f->stream = glGetUniformLocation(f->program, "stream"); f->stream_kind = glGetUniformLocation(f->program, "streamKind"); f->stream_width = glGetUniformLocation(f->program, "streamWidth"); + f->garment = glGetUniformLocation(f->program, "garment"); + f->undress = glGetUniformLocation(f->program, "undress"); f->view_pos = glGetUniformLocation(f->program, "viewPos"); f->light_dir = glGetUniformLocation(f->program, "lightDirection"); f->light_color = glGetUniformLocation(f->program, "lightColor"); @@ -500,6 +502,8 @@ void Renderer_drawFigure(Renderer *r, const FigurePose *pose) { glUniform1i(f->stream_kind, sk->stream_kind); glUniform3fv(f->stream, 4, &sk->stream[0].x); glUniform1f(f->stream_width, sk->stream_width); + glUniform1i(f->garment, pose->look.garment); + glUniform1f(f->undress, sk->undress); glBindVertexArray(r->fullscreen_vao); /* no vertex data: the card is built from gl_VertexID */ glDrawArrays(GL_TRIANGLES, 0, 6); diff --git a/entropie/src/render/renderer.h b/entropie/src/render/renderer.h index f039985..f3eb46d 100644 --- a/entropie/src/render/renderer.h +++ b/entropie/src/render/renderer.h @@ -67,6 +67,7 @@ typedef struct { GLint skin, hair, shirt, pants, shoes, hair_style, long_sleeves; GLint head_forward, head_up, chest_forward, waist_bend, face, expression; GLint stream, stream_kind, stream_width; + GLint garment, undress; GLint view_pos, light_dir, light_color, shadow_color, sky_top, sky_horizon; GLint shadow_strength, shadow_map, fire_light; } FigureShader; diff --git a/entropie/src/world/scene.c b/entropie/src/world/scene.c index 2b06cc6..48f1059 100644 --- a/entropie/src/world/scene.c +++ b/entropie/src/world/scene.c @@ -84,6 +84,7 @@ static const int MAIN_HAND[] = { HAND_RIGHT, HAND_RIGHT, HAND_LEFT, HAND_RIGHT, /* Ida and Mila are women; Mila brought a Urinella (she pees standing). */ static const bool FEMALE[] = { false, false, true, true, false }; static const bool URINELLA[] = { false, false, false, true, false }; +static const int GARMENT[] = { GARMENT_TROUSERS, GARMENT_SHORTS, GARMENT_SKIRT, GARMENT_DRESS, GARMENT_TROUSERS }; /* How sporty each is (0..1): not a matter of build (Ida is light but not sporty, Jonas is heavy and fit). */ static const float FITNESS[] = { 0.5f, 0.75f, 0.35f, 0.85f, 0.15f }; /* How well each holds their drink (on top of body weight). */ @@ -129,6 +130,7 @@ Object *Scene_load(World *world) { obj->tolerance = TOLERANCE[characters % TEMPERAMENT_COUNT]; obj->fitness = FITNESS[characters % TEMPERAMENT_COUNT]; obj->look = Figure_wardrobe(characters); + obj->look.garment = GARMENT[characters % TEMPERAMENT_COUNT]; Object_setPerson(obj, NAMES[characters % TEMPERAMENT_COUNT], MAIN_HAND[characters % TEMPERAMENT_COUNT]); obj->ai.character = CHARACTERS[characters % TEMPERAMENT_COUNT]; obj->female = FEMALE[characters % TEMPERAMENT_COUNT];