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.19.1: menus tested for real, shorter save labels
- Save labels shorter ("13:04 - saved Oct 20, 18:01"), menus wider, so
the load list and Continue no longer cut them off
- All menus run in the real game: new game, save as, quick save/load,
load list, quit with autosave, continuecommit_message.txt | 10 +++++----- entropie/Makefile | 2 +- entropie/STATE.md | 8 ++++++-- entropie/src/game/save.c | 4 ++-- entropie/src/main.c | 6 +++--- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/commit_message.txt b/commit_message.txt index ee54708..da2065b 100644 --- a/commit_message.txt +++ b/commit_message.txt @@ -1,6 +1,6 @@ -entropie 2.19.0: saves keep the hose and sitting; felling hint +entropie 2.19.1: menus tested for real, shorter save labels -- Saves keep the hose (where the rope lies, melted and taped bits) and - who sits where (they sit down again after loading) -- Felling yourself: the hint line says where the tree comes down and what - it would hit; nearly through, people in the way step aside +- Save labels shorter ("13:04 - saved Oct 20, 18:01"), menus wider, so + the load list and Continue no longer cut them off +- All menus run in the real game: new game, save as, quick save/load, + load list, quit with autosave, continue diff --git a/entropie/Makefile b/entropie/Makefile index 197ffe1..7e1a32b 100644 --- a/entropie/Makefile +++ b/entropie/Makefile @@ -1,5 +1,5 @@ APP := entropie -VERSION := 2.19.0 +VERSION := 2.19.1 PREFIX ?= /usr BINDIR ?= $(PREFIX)/bin diff --git a/entropie/STATE.md b/entropie/STATE.md index 22cd0f8..e7a94bf 100644 --- a/entropie/STATE.md +++ b/entropie/STATE.md @@ -270,12 +270,16 @@ Round 2.18: - Saves (`game/save.c`, `save.h`, SAVE_FORMAT 1; see ARCHITECTURE.md "Saves"): `Save_write` / `Save_read` / `Save_list` / `Save_blocked` (not while driving in, or in the car). Text `.sav` (field tables THING / PERSON by offsetof, references as save ids) + binary `.ground` (`Terrain_writeWear` / `readWear`, `Wetness_write` / `read`). Objects carry `palette`, `make_arg` (Object_create), `scene_id`, `spawn`, `spawn_type` (Game_initWorld), `cloth_gap`. Rebuild helpers: `Object_rebuildTree`, `Tent_refresh`, `Gear_refresh`, `Clothes_rebuild`, `Clothes_whereText`, `Ladder_setExtend`, `Object_fillBag`, `Object_setDrink`, `Object_shatter`. Held things come back in the hand (`Hands_receive`; too big for one hand: at their feet), sleepers asleep, people in tents / the car back in. - `Game_initWorld(game, arrive)`; Game_init = with the drive in. `World_init` / `World_destroy` forget the people list (Object_seePeople) - loading used the old world's freed array. - Menus (`main.c`): a start menu over the waiting world (Continue: the autosave, New game, Load a save, Quit); Esc: Resume, Save as (`Platform_typing`, `Input.text` / `erase`: letters, digits, - _), Quick save, Load a save, Keys, Quit (autosaves). F5 quick save, F9 quick load. Autosave every AUTOSAVE_EVERY 300 s of play and on quit / closing the window. Folder: `Platform_saveDir` (SDL_GetPrefPath + "saves"). -- Tested in the harness: a save written and read back (the same process, and another one): people, pockets, a tent half taken down, crates, rain, the wet ground, a pullover put down, a felled tree with fewer branches; under AddressSanitizer. The menus themselves aren't run here (no SDL library to link): compiled with all warnings only. +- Tested in the harness: a save written and read back (the same process, and another one): people, pockets, a tent half taken down, crates, rain, the wet ground, a pullover put down, a felled tree with fewer branches; under AddressSanitizer. (The menus: run for real in 2.19.1.) Round 2.19: - Saves: the hose's rope (`rope` length + every node: where, melted, taped; was laid out fresh from the tap) and the nozzle where it was (OBJ_HOSE no longer "fixed"); people sitting (`sit` seat + facing) sit down again on loading and stay 20-35 s (they stood up and walked off at once). - Felling, you (`game_actions.c` fellingHint, before the ladder hint): an axe or the chainsaw at a standing tree: the hint line says it falls away from you, or "Careful: it would come down on the car - fell it from another side" (`Ai_fallsOnto`: the felling-room rays, the first thing hit). Over 0.6 through and somebody where it'll come down: "Timber! ..." and they step aside (`Ai_warnFellingRoom`, now with the way it falls; NPC fellers use their plan). +Round 2.19.1: +- The menus run for real now (SDL3 built locally, the game offscreen with scripted keys): start menu, New game, Esc, Save as while driving in ("Not while you're driving in"), Save as with a typed name, quick save (F5), quick load (F9), the load list, loading, Quit (autosaved), and the next start: Continue loads the autosave. All fine. +- Save labels shorter ("13:04 - saved Oct 20, 18:01"; the version is still in the file), the menus wider (600): the load list cut them off. + Unfinished building (Shell_build, at SHELL_AT in the frame's frame): brick shell 6.4 x 4.7, walls 2.9, open front (2 m) to the frame (now only the front half: pillars at z -13.8 / -9.2), window holes, bare floor, tiled roof with slabs. Barn: brick courses on BUILDING_BRICK walls (`addBrickCourses`: mortar a shade lighter, so the ink doesn't trace it), ivy (`Shapes_ivy`, OBJ_STRUCTUREs) on both long sides; the woodpile (OBJ_WOODPILE "Woodpile", WOODPILE_A/B) left of the toilet, everybody's woodpile from the start (`scene.c` Scene_finish). Fireplace tripod: wooden poles, feet TRIPOD_OUT 0.9 m outside the stones, TRIPOD_PAST 0.4 m past the top, a lashing; each pole an OBJ_WALL along it ("Tripod pole"). Gates (FURN_GATE, green boards): in your garages' doorways (GATES: hinge, end), `gate_open` / `gate_t`, `hinge`, `gate_shut` / `gate_out`; Object_swingGate (1.2 s), driven by showProps; a click within 1.2 m opens / shuts both leaves. Props that show (1.89, `world.c` showProps every frame): the tin's mesh is built again when its butts change (`Shapes_ashtray`: up to 12 show, the ash rises, a heap from 14; `shown` = what's built). @@ -435,4 +439,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.19.0 (build 04c05e7)` +State of `entropie 2.19.1 (build af7a78f)` diff --git a/entropie/src/game/save.c b/entropie/src/game/save.c index be17474..b51ff02 100644 --- a/entropie/src/game/save.c +++ b/entropie/src/game/save.c @@ -168,10 +168,10 @@ bool Save_write(const Game *game, const char *dir, const char *name, char *err, clock[5] = '\0'; /* (HH:MM) */ time_t now = time(NULL); char date[32]; - strftime(date, sizeof date, "%Y-%m-%d %H:%M", localtime(&now)); + strftime(date, sizeof date, "%b %d, %H:%M", localtime(&now)); fprintf(f, "entropie-save %d\n", SAVE_FORMAT); fprintf(f, "version %s\n", APP_VERSION); - fprintf(f, "label %s in the game - saved %s - %s\n", clock, date, APP_VERSION); + fprintf(f, "label %s - saved %s\n", clock, date); fprintf(f, "[game]\n"); fprintf(f, "time %.9g\nscale %.9g\nthird %d\n", (double)game->daycycle.seconds, (double)game->daycycle.time_scale, game->third_person); diff --git a/entropie/src/main.c b/entropie/src/main.c index 3dcb529..34412cc 100644 --- a/entropie/src/main.c +++ b/entropie/src/main.c @@ -137,7 +137,7 @@ typedef enum { SCREEN_NONE, SCREEN_START, SCREEN_PAUSE, SCREEN_LOAD, SCREEN_NAME typedef enum { ACT_NONE, ACT_NEW, ACT_CONTINUE, ACT_LOAD_LIST, ACT_QUIT, ACT_RESUME, ACT_SAVE_AS, ACT_QUICK_SAVE, ACT_KEYS, ACT_LOAD, ACT_BACK, ACT_NAME, ACT_SAVE_NAMED } Action; #define MENU_ITEMS 14 -#define MENU_W 520.0f +#define MENU_W 600.0f #define MENU_BH 44.0f /* button height */ #define MENU_GAP 10.0f #define AUTOSAVE_EVERY 300.0f /* s of play between autosaves */ @@ -177,7 +177,7 @@ static void menuOpen(Menu *m, Screen screen) { int autosave = -1; for (int i = 0; i < m->save_count; i++) if (!strcmp(m->saves[i].name, SAVE_AUTO)) autosave = i; if (autosave >= 0) { - snprintf(line, sizeof line, "Continue (%.60s)", m->saves[autosave].label); + snprintf(line, sizeof line, "Continue %.40s", m->saves[autosave].label); menuAdd(m, ACT_CONTINUE, autosave, line); } menuAdd(m, ACT_NEW, 0, "New game"); @@ -198,7 +198,7 @@ static void menuOpen(Menu *m, Screen screen) { m->title = "Load a save"; m->save_count = Save_list(m->dir, m->saves, SAVE_LIST_MAX); for (int i = 0; i < m->save_count && m->count < MENU_ITEMS - 1; i++) { - snprintf(line, sizeof line, "%.24s - %.60s", m->saves[i].name, m->saves[i].label); + snprintf(line, sizeof line, "%.20s %.40s", m->saves[i].name, m->saves[i].label); menuAdd(m, ACT_LOAD, i, line); } menuAdd(m, ACT_BACK, 0, "Back");