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 2.32.0: saved while carrying together
- Saving while carrying something together: you load still holding it with your helpers, lifted as it was
commit_message.txt | 6 +++--- entropie/ARCHITECTURE.md | 2 +- entropie/Makefile | 2 +- entropie/README.md | 2 +- entropie/STATE.md | 10 +--------- entropie/commit_message.txt | 8 +++----- entropie/src/game/save.c | 31 +++++++++++++++++++++++++++++++ 7 files changed, 41 insertions(+), 20 deletions(-) diff --git a/commit_message.txt b/commit_message.txt index 3eff3d2..f736f70 100644 --- a/commit_message.txt +++ b/commit_message.txt @@ -1,4 +1,4 @@ -entropie 2.31.0: rolling over the edge +entropie 2.32.0: saved while carrying together -- Quite drunk, climbing something chest high ends belly first, then down - flat on the top and rolled over onto it, and up again +- Saving while carrying something together: you load still holding it + with your helpers, lifted as it was diff --git a/entropie/ARCHITECTURE.md b/entropie/ARCHITECTURE.md index ba2ba67..2c99e45 100644 --- a/entropie/ARCHITECTURE.md +++ b/entropie/ARCHITECTURE.md @@ -109,7 +109,7 @@ of view (objects, 8×8 terrain tiles). - A key renamed or its meaning changed: raise `SAVE_FORMAT` (save.h) and add a step to `migrate()` that rewrites the old lines. - A save from a newer format is refused, never guessed at. - A thing the scene no longer makes is dropped; one it newly makes keeps its fresh state. -- Not kept (comes back fresh): what anybody was in the middle of (AI plans, paths, poses), sparks and smoke. Kept specially: the hose's rope (`rope` line: every point, melted, taped), who sits where (`sit` line: sat down again, staying a while), who's up a ladder (`ladder` line: you back on it as high, `Ladder_mountAt`; the others at its foot), what's in each crate slot (`slots` line; older saves: their own bottles, so many full and empty). +- Not kept (comes back fresh): what anybody was in the middle of (AI plans, paths, poses), sparks and smoke. Kept specially: the hose's rope (`rope` line: every point, melted, taped), who sits where (`sit` line: sat down again, staying a while), who's up a ladder (`ladder` line: you back on it as high, `Ladder_mountAt`; the others at its foot), what's in each crate slot (`slots` line; older saves: their own bottles, so many full and empty), holding on to something together (`grab`, `help` lines). ## Versions diff --git a/entropie/Makefile b/entropie/Makefile index 7ad37cc..d65d20e 100644 --- a/entropie/Makefile +++ b/entropie/Makefile @@ -1,5 +1,5 @@ APP := entropie -VERSION := 2.33.0 +VERSION := 2.32.0 PREFIX ?= /usr BINDIR ?= $(PREFIX)/bin diff --git a/entropie/README.md b/entropie/README.md index 59681b5..3de3c42 100644 --- a/entropie/README.md +++ b/entropie/README.md @@ -124,5 +124,5 @@ Dependencies point downward: `main → game → world/people → render → core ## Version -`make version` prints e.g. `entropie 2.33.0 (build 52d3a90)`. The build id is +`make version` prints e.g. `entropie 2.32.0 (build 1571142)`. The build id is an md5 of all sources and assets. diff --git a/entropie/STATE.md b/entropie/STATE.md index 263a338..bce27f5 100644 --- a/entropie/STATE.md +++ b/entropie/STATE.md @@ -602,11 +602,6 @@ and satellite pictures (about 340 x 340 m). - Some are sporty, whatever their build: quicker, surer over things, fewer trips and scrapes. Running, the body rises and falls with each stride: the sporty glide, the others bounce and nod (Tab shows how sporty you are) -- Running for real: each foot stays down a moment, the leg bending like a - spring under the body, then pushing off into a flight with both feet up; - off the toes the heel folds up under the seat, the knee drives through in - front and the foot reaches out to come down; the arms pump, bent about - square; the body leans into it. Walking: longer steps, the arms swing more - Worn out, you can't run until you got your breath back a bit - The more tired the day makes you, the less energy you have: less to give, used up quicker, back slower, everything a bit weaker. Lively and sporty @@ -1193,9 +1188,6 @@ Round 2.31: Round 2.32: - Saves keep holding on together (`save.c`: a `grab` line - what, lifted, one end up, where both hands hold it on it - and a `help` line - whose helper; read back after everybody is in place: helping first, then the grip (`Hands_grabObject`, the grip points as saved, lifted as it was); you hold on again without F). Checked: you and Volkram with a 75 kg log lifted, saved and loaded: both holding it, still lifted 2 s on. -Round 2.33 (running and walking less stiff): -- Running (`body.c`, `body_pose.c`): a foot stays down STANCE_RUN 0.11 s at a full run (`Foot.planted`; it was gone again after a frame or two, both feet nearly always in the air); the wave follows the ground contact - down while a foot is on the ground, up past standing height in the flight (BOB_FLIGHT; it averaged two opposite feet to nothing: the hips moved 1 cm, now 7 cm), BOB_RUN deeper; the swing foot follows a curve with the body (cubic: from where it left, RUN_TUCK up behind the seat, RUN_DRIVE through in front, down where it lands; `Foot.swing_run` set as it leaves and easing off with SWING_RUN_EASE - slowing down mid-swing no jump); more lean (0.2 rad at a run); the elbows about square pumping. Walking: steps longer (stepLength 0.3 + 0.27 x speed, MAX_LEAD 0.48), arms swing more (ARM_SWING 1.25), the elbow bends more coming forward. Checked: side views of a sprint, a jog and a walk; the audit (sprint pops 247 -> 125, worst 15.7 -> 18.3 cm; the rest about as before - walking and turning fast the hands move that fast in the world anyway). - ## Open tasks Most important first. @@ -1231,4 +1223,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 2.33.0 (build 52d3a90)` +State of `entropie 2.32.0 (build 1571142)` diff --git a/entropie/commit_message.txt b/entropie/commit_message.txt index 07b592e..f736f70 100644 --- a/entropie/commit_message.txt +++ b/entropie/commit_message.txt @@ -1,6 +1,4 @@ -entropie 2.33.0: running and walking less stiff +entropie 2.32.0: saved while carrying together -- Running: a foot stays down a moment and the leg bends like a spring, then - a push off into a flight; the heel folds up under the seat and the knee - drives through; the body rises and falls clearly, leans into it, arms pump -- Walking: longer steps, more arm swing +- Saving while carrying something together: you load still holding it + with your helpers, lifted as it was diff --git a/entropie/src/game/save.c b/entropie/src/game/save.c index 4848232..27cb1c5 100644 --- a/entropie/src/game/save.c +++ b/entropie/src/game/save.c @@ -205,6 +205,13 @@ bool Save_write(const Game *game, const char *dir, const char *name, char *err, if (o->body.asleep) fprintf(f, "asleep 1\n"); if (o->on_ladder) /* (you up a ladder: back on it, as high; the others come back at its foot) */ fprintf(f, "ladder %d %.9g\n", idOf(&ids, o->on_ladder), (double)o->ladder_at); + if (o->hands.grabbed) { /* holding on to something (lifted together, maybe): what, where the hands are on it */ + const Object *g = o->hands.grabbed; + fprintf(f, "grab %d %d %d %.9g %.9g %.9g %.9g %.9g %.9g\n", idOf(&ids, g), g->lifted, g->end_up, + (double)o->hands.grab_point[0].x, (double)o->hands.grab_point[0].y, (double)o->hands.grab_point[0].z, + (double)o->hands.grab_point[1].x, (double)o->hands.grab_point[1].y, (double)o->hands.grab_point[1].z); + } + if (o->type != OBJ_PLAYER && o->ai.mode == AI_HELP && o->ai.leader) fprintf(f, "help %d\n", idOf(&ids, o->ai.leader)); if (o->sitting && !o->riding) /* (where they sit: on what, facing where) */ fprintf(f, "sit %d %.9g %.9g %.9g\n", idOf(&ids, o->seat), (double)o->sit_dir.x, (double)o->sit_dir.y, (double)o->sit_dir.z); for (int h = 0; h < 2; h++) @@ -644,6 +651,30 @@ bool Save_read(Game *game, const char *dir, const char *name, char *err, size_t else if (sits && Object_sit(o, seat, vec3_add(o->position, vec3_scale(sit_dir, 3.0f)))) /* (sat down again where they sat ... */ o->ai.timer = 20.0f + 0.37f * (float)(k % 41); /* ... and stay a while) */ } + for (int k = 0; k < p.recs; k++) { /* helping somebody, holding on to something together (once everybody's back) */ + Rec *r = &p.rec[k]; + Object *o = r->obj; + if (!o || !o->is_character) continue; + for (int pass = 0; pass < 2; pass++) /* (helping first: it lets go of things; then the grip) */ + for (int i = r->first; i < r->first + r->lines; i++) { + char buf[256], *s = buf; + snprintf(buf, sizeof buf, "%s", p.line[i]); + char *key = word(&s); + if (pass == 0 && !strcmp(key, "help")) { + Object *leader = byId(&p, numI(&s)); + if (leader && leader->is_character && o->type != OBJ_PLAYER) Ai_help(o, leader); + } else if (pass == 1 && !strcmp(key, "grab")) { + Object *g = byId(&p, numI(&s)); + bool lifted = numI(&s) != 0, end_up = numI(&s) != 0; + Vec3 g0 = numV(&s), g1 = numV(&s); + if (!g || g->broken || !Hands_grabObject(o, g)) continue; + o->hands.grab_point[0] = g0; + o->hands.grab_point[1] = g1; + if (lifted) { g->lifted = true; g->end_up = end_up; g->velocity = vec3_zero(); } + } + } + } + game->holding = game->player && game->player->hands.grabbed; /* (you hold on as before, no F needed) */ for (int k = 0; k < p.recs; k++) /* (pullovers last: they need their owners' look) */ if (p.rec[k].obj && p.rec[k].obj->type == OBJ_CLOTHES) Clothes_rebuild(p.rec[k].obj); if (game->arrival.car) Car_place(w, game->arrival.car, game->arrival.car->position, game->arrival.car->rotation.y);