25 Commits

Author SHA1 Message Date
Paul Bailey
47966e464d The trailer narrated by Old Tam: a line over every shot (welcome, survive, build, the wolves, winter, the cliffs, the Cove, play with friends), the game's sound dipping under him 2026-11-09 00:45:40 +00:00
Paul Bailey
e5e7c0e343 export.sh: keep build/ out of the game (a .gdignore): screenshots and voice samples there were being packed into it 2026-11-09 00:00:03 +00:00
Paul Bailey
73599401bf Old Tam in the trailer: three short lines, timed to the dawn flyover, the wolves and the Cove (same clip size) 2026-11-08 23:58:43 +00:00
Paul Bailey
a629ddba49 0.6.2: playtest fixes (animals off the cliffs, bigger and odd-shaped houses, real thunder, the tutorial's daylight, Old Tam's new script and voice); protocol 19 2026-11-08 23:40:34 +00:00
Paul Bailey
a3660f91cf Old Tam rewritten and re-voiced (Gitea #3): a new script in his own voice, an old West Country farmer (Qwen3-TTS cloning one recording, so he's the same man in every line), each line's best take chosen by checking its words with Whisper 2026-11-08 23:35:18 +00:00
Paul Bailey
4a691b72e1 Old Tam says "W, A, S and D", not "Wasad" (Gitea #3, first part); make_voice.py re-records a line when how it's spoken changes, not only its text 2026-11-08 20:32:09 +00:00
Paul Bailey
8f3c58c810 Real thunder (Gitea #4): six CC0 recordings, close cracks and distant rolls, in place of the synthesised rumble; a storm's flash is followed by a roll seconds later or a crack sooner, quieter indoors, and a strike on a tree cracks from the tree 2026-11-08 20:29:48 +00:00
Paul Bailey
07b8db1683 The tutorial's sun waits for you (Gitea #5): the afternoon goes no later than 16:30 until the torch step brings dusk 2026-11-08 20:19:15 +00:00
Paul Bailey
5672f0713d Odd-shaped houses (Gitea #7): roofs may run through other roofs (an L, a wing at an angle, roofs at different heights), but not inside an identical one, and nothing else goes through them; the guide explains growing a house 2026-11-08 20:19:15 +00:00
Paul Bailey
31f8e0d22c Bigger houses (Gitea #7): a second row of roof on a wider house, a Roof Ridge for a 6 m-wide one, and a Half Wall and Ridge Gable to close their taller ends; also no error when a piece is dismantled straight after it's placed 2026-11-08 19:56:16 +00:00
Paul Bailey
415e673b28 Animals stay off the cliffs (Gitea #6): nothing walks up or along ground steeper than 35 degrees, and a carcass on steep ground slides down to where it can be reached and butchered 2026-11-08 19:29:09 +00:00
Paul Bailey
da29308522 Roadmap: cloud saves, desktop and web both ways (a Cloudflare Worker, a name and password, the newer-copy check) 2026-11-07 16:48:52 +00:00
Paul Bailey
79061d8572 Roadmap: a single-player web version after the playtest (what the web renderer looks like, what's needed), and Android as a maybe 2026-11-07 16:31:20 +00:00
Paul Bailey
1f67d58b92 The Gitea repo is Admin/Cinderwild: the update feed, Report a bug, the site's links and publishing (0.6.0 and 0.6.1 games still reach it through Gitea's redirect from Admin/Emberwild) 2026-11-07 16:21:08 +00:00
Paul Bailey
c2c86b5f78 0.6.1: Emberwild is now Cinderwild (the old name's taken on Steam). Saves, identity and settings are copied across from the Emberwild folder on first start; the site moves to cinderwild.psbailey.uk; same protocol (18), so 0.6.0 and 0.6.1 play together 2026-11-07 16:14:11 +00:00
Paul Bailey
04b9d17826 A better download page: a hero over the Cove with the download for your computer, the trailer, what you'll do, what's new and how to report a bug, screenshots (tools/site/make_shots.sh), downloads, and playing with friends with the ports 2026-11-07 13:24:46 +00:00
Paul Bailey
3b611a6d34 0.6.0: the Cove's own, for a playtest (the wreck and a treasure for each player, the drowned crew, crabs and gulls, a rowing boat at the pier, Report a bug); protocol 18 2026-11-07 13:04:36 +00:00
Paul Bailey
27040d6805 Report a bug in the pause menu (a new Gitea issue filled in with the version, computer, mode, land and where you are; copy the details; the log file), the playtest guide (docs/PLAYTEST.md), and the Cove's 0.6.0 parts in the player guide 2026-11-07 12:45:37 +00:00
Paul Bailey
2004fe193c The rowing boat: seagrass at the tide line and resin from pines; rope, pitch, and a boat at the workbench (driftwood, rope, pitch, nails); tied up at a berth of its own at the end of the pier, one each, saved; Set sail needs the ship's compass and the Highlands aren't charted yet; online too 2026-11-07 11:16:15 +00:00
Paul Bailey
9709d2c424 The Cove's shore life: crabs up the beach from dusk till dawn (keep to the sand, pinch if you get close, crab meat to cook), gulls after food on the sand and fish on a smoking rack; online too 2026-11-07 10:23:49 +00:00
Paul Bailey
5bcfa23710 The pirate treasure: each player's own mound at their X, dug with a pickaxe; the drowned crew rise at night or when the chest comes up; the ship's compass, a spyglass, a cutlass and pirate gold; online too 2026-11-07 09:54:51 +00:00
Paul Bailey
74bd8f5898 The wreck in dark weathered oak; the map's key lists only this land's places 2026-11-07 02:04:48 +00:00
Paul Bailey
419c71e638 The Cove's wreck: driftwood and salt on the beach, the captain's sea chest (a treasure map, nails, salt; once each), each player's own X on the map; online too 2026-11-07 02:00:31 +00:00
Paul Bailey
ec8caa9ef4 Each land's set pieces from its data: the barrow, the standing stones and the bear are the Valley's alone, the Cove keeps its wolves; the Cove's 0.6.0 plan (treasure: one each, each in its own place) 2026-11-07 01:14:32 +00:00
Paul Bailey
1bf33935e0 Download page: forward UDP 24243 too for the Cove; test_net_lands can run against an exported build (EMBERWILD_SERVER_BIN) 2026-11-07 00:33:03 +00:00
178 changed files with 4953 additions and 432 deletions

4
.gitignore vendored
View File

@@ -22,5 +22,7 @@ Thumbs.db
# Cloudflare wrangler cache (tools/site deploys)
.wrangler/
# Kokoro TTS environment (tools/voice/make_voice.sh sets it up)
# Old Tam's voice environments (tools/voice/make_voice.sh sets one up; .venv was Kokoro, before 0.6.2)
tools/voice/.venv/
tools/voice/.venv-qwen/
tools/voice/__pycache__/

View File

@@ -16,8 +16,10 @@ addon SDK with guard rails.
## Status
See `docs/ROADMAP.md` for milestones and `docs/ARCHITECTURE.md` for the design.
**Emberwild 0.5.0** is released (download page and player guide:
https://emberwild-95k.pages.dev, builds on the Gitea releases). Built so far:
**Cinderwild 0.6.2** is released (download page and player guide:
https://cinderwild.psbailey.uk, builds on the Gitea releases). Up to 0.6.0 it
was called Emberwild (a name already taken on Steam); before that, Valheimlike.
Built so far:
- M0-M1: the island, survival, crafting, building, weather, wildlife, hunting, fishing.
- M2: self-hosted multiplayer (Host Game, dedicated servers, rules, chat, admin).
- P1-P5 (`docs/PROGRESSION_DESIGN.md`): iron, stone building, the wolf moon and
@@ -33,7 +35,12 @@ https://emberwild-95k.pages.dev, builds on the Gitea releases). Built so far:
with a save file per worldlet; on a server, a server per land (the Valley's
starts the Cove's on the next UDP port), with chat, the player list,
admin commands and sleep across lands, and one clock everywhere.
Next: J2 (each tunnel's own gate and supplies), then the Highlands (by sail).
- 0.6.0, the Cove's own (`docs/WORLDLETS_DESIGN.md` §5): the wreck, a
treasure map and a dig for each player, the drowned crew, crabs and gulls,
and a rowing boat to build and moor at the pier (sailing comes with the
Highlands). Report a bug in the pause menu; `docs/PLAYTEST.md` for testers.
Next: after the playtest, J2 (each tunnel's own gate and supplies), then the
Highlands (by sail).
Running from the source, `godot --path . -- --dev-worldlets` lets New World
start in any worldlet, to try one directly.
@@ -55,7 +62,7 @@ godot --headless --path . -- --server
## Packaged builds
```bash
tools/export.sh # build/Emberwild-<version>-macos.zip and -windows.zip
tools/export.sh # build/Cinderwild-<version>-macos.zip and -windows.zip
tools/export.sh macOS # or just one ("macOS" / "Windows")
```
Needs the Godot export templates for your Godot version (Editor > Manage
@@ -64,18 +71,19 @@ Export Templates). The version number is `application/short_version` in
- **Mac:** a universal .app, ad-hoc signed but not notarised. On another Mac,
the first launch needs right-click > Open (or System Settings > Privacy &
Security > Open Anyway).
- **Windows:** unzip and run `Emberwild.exe` (keep `Emberwild.pck` beside
- **Windows:** unzip and run `Cinderwild.exe` (keep `Cinderwild.pck` beside
it). It's unsigned, so SmartScreen says "Windows protected your PC":
More info > Run anyway.
- A packaged copy is also a dedicated server:
`Emberwild.app/Contents/MacOS/Emberwild --headless -- --server` (Mac) or
`Emberwild.exe --headless -- --server` (Windows). Saves and settings live in
`Cinderwild.app/Contents/MacOS/Cinderwild --headless -- --server` (Mac) or
`Cinderwild.exe --headless -- --server` (Windows). Saves and settings live in
the same user folder as a copy run from source.
## Trailer and download page
```bash
tools/trailer/make_trailer.sh # build/Emberwild-trailer.mp4: recorded in-game (Movie Maker), needs ffmpeg
tools/site/make_site.sh # build/site/: index.html + poster.jpg + trailer.mp4 for the current release
tools/trailer/make_trailer.sh # build/Cinderwild-trailer.mp4: recorded in-game (Movie Maker), needs ffmpeg
tools/site/make_shots.sh # build/shots/*.jpg: the page's screenshots, rendered in a window
tools/site/make_site.sh # build/site/: index.html, guide.html, the shots, poster and trailer for the current release
```
The page's download links point at the Gitea release named in
`build/version.json`, so rebuild it after each `tools/export.sh` release.

View File

@@ -39,14 +39,32 @@ Breviceps (https://freesound.org/people/Breviceps/sounds/465697/, License:
Creative Commons 0; the preview is in `tools/audio/sources/`), cut at 0.12 s
and 2.65 s (leaving out the short sound between them), then levelled. Thank you.
## Old Tam's voice
`voice/` is spoken by **Kokoro** (Kokoro-82M by hexgrad, Apache-2.0,
https://huggingface.co/hexgrad/Kokoro-82M) with its British "George" voice,
made a little older (deeper, slower, warmer) by `tools/voice/make_voice.py`.
The recordings are generated from our own text; rebuild them with
`tools/voice/make_voice.sh` after changing any line.
## Thunder (CC0)
`sfx/thunder/` is cut from six Freesound recordings, all License: Creative
Commons 0 (the previews are in `tools/audio/sources/thunder_*`), each round
its loudest strike, faded out and levelled by
`tools/audio/make_audio.py thunder`. Close cracks: "Thunder 08" by Emulius
(https://freesound.org/people/Emulius/sounds/744723/), "thunder11" by
saha213131 (https://freesound.org/people/saha213131/sounds/696550/) and
"Thunder strike" by AyaDrevis
(https://freesound.org/people/AyaDrevis/sounds/652690/). Distant rolls:
"Short_Thunder_Mid" by SholeColtis
(https://freesound.org/people/SholeColtis/sounds/683421/), "thunder7" by
nednednerb (https://freesound.org/people/nednednerb/sounds/38250/) and
"Thunder Clap OWB KY 441x16.wav" by Dave Welsh
(https://freesound.org/people/Dave%20Welsh/sounds/194364/). Thank you.
## Emberwild's own (CC0)
## Old Tam's voice
`voice/` is spoken by **Qwen3-TTS** (Qwen3-TTS-12Hz-1.7B by Alibaba's Qwen
team, Apache-2.0, https://huggingface.co/Qwen; run through mlx-audio, MIT).
His voice, a reedy old West Country farmer, was designed once from a written
description by Qwen3-TTS VoiceDesign (`tools/voice/old_tam/`), and every line
is spoken by cloning that recording. Each line's takes are checked against
the script by Whisper (OpenAI, MIT; mlx-whisper). The recordings are made from
our own text; rebuild them with `tools/voice/make_voice.sh` after changing any
line. (Up to 0.6.1 he was Kokoro-82M by hexgrad, Apache-2.0.)
## Cinderwild's own (CC0)
`music/`, `ambience/` and `sfx/synth/` are synthesised from scratch by
`tools/audio/make_audio.py` (no samples): the five music tracks (calm,
night, storm, danger, boss), the fire crackle, the creature voices, and the

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,43 +1,44 @@
{
"hint_cold": "91c5088e453fb0e6",
"hint_cove": "126f0b5e977fbef7",
"hint_died": "e865f8a63622b3c3",
"hint_diet": "3178b319c44e9fa0",
"hint_freezing": "48b1e505119a0fc9",
"hint_hard_winter": "5513aca1655bc278",
"hint_cold": "ac4139441b7a347a",
"hint_cove": "91eb0dcbc24afe5c",
"hint_crab": "3a88cd0772a7676d",
"hint_died": "7b60d478f6fdbcef",
"hint_diet": "b5e9600c2da38bdf",
"hint_freezing": "0a63a53be413d808",
"hint_hard_winter": "03e1316a475c3c43",
"hint_howl": "05792dda3f3f0b60",
"hint_hungry": "ad76f22cb8e034a0",
"hint_night": "2a07d9c0bfae4bf9",
"hint_rotten": "98b69de03dbee089",
"hint_seam": "b353f46816d329b7",
"hint_sheltered": "ba6d6ff8bc4a1c80",
"hint_sick": "ec07963c46638ffc",
"hint_snow": "8f0ac7d093f73840",
"hint_stamina": "82bf5b903db7a29f",
"hint_storm": "f06bb82d15d991c8",
"hint_wet": "6aef86b85d67d7ac",
"hint_wolf_moon": "723b3dbd5439980c",
"tutorial_animals": "e82eb7e35e866812",
"tutorial_axe": "4bb51d6ea8b42840",
"tutorial_bed": "34cf4c842db48c19",
"tutorial_berries": "a7cd3805f11c8898",
"tutorial_campfire": "0a26bd897d1d8a90",
"tutorial_cook": "7164a8ab27a7821d",
"tutorial_diet": "fd47408ab4f2b5de",
"tutorial_finish": "36c07fc5a64c9d65",
"tutorial_fish": "32f2f3228c036136",
"tutorial_flax": "a87ff75ed8864ca6",
"tutorial_hut": "a10bfa289939dfb2",
"tutorial_look": "27acdf33905cc1a3",
"tutorial_mushroom": "79edcfb1afe18c8c",
"tutorial_pickaxe": "177e0474e4d0fda6",
"tutorial_rabbit": "6d429ab2cbdc7b19",
"tutorial_rod": "d610281e722e8fd3",
"tutorial_sleep": "e202cbf133500c2a",
"tutorial_sticks": "e526e30ddf8756a7",
"tutorial_torch": "68808fca608352fc",
"tutorial_tree": "1dfb2ab0491d962f",
"tutorial_weapon": "a17d1fe6d5067b8d",
"tutorial_wolf": "feb6bdda64e28161",
"tutorial_workbench": "1b6108ab18f05de9"
"hint_hungry": "c99c9fbc83506c43",
"hint_night": "04fc83670a1fd9e9",
"hint_rotten": "ecb8aecde8c6c762",
"hint_seam": "05531946c57cb97d",
"hint_sheltered": "7d3ebd27c230bc79",
"hint_sick": "b039c2449304ac53",
"hint_snow": "90a2e7f6735e4c83",
"hint_stamina": "e3e6cad6202abcaa",
"hint_storm": "477b250b6a9c97cb",
"hint_wet": "ebf9b034487bf92e",
"hint_wolf_moon": "d66b43dc8a23b5ed",
"tutorial_animals": "20b2eabd8de50d58",
"tutorial_axe": "c9a632910c8eaf19",
"tutorial_bed": "46f0130e86504f5b",
"tutorial_berries": "31d4fd1560fcf46f",
"tutorial_campfire": "6a7790be69235e80",
"tutorial_cook": "180b4f1413608105",
"tutorial_diet": "d44066db5adc0f78",
"tutorial_finish": "a9960edb587c3176",
"tutorial_fish": "7945d260ceff912b",
"tutorial_flax": "7e4f439fc7079272",
"tutorial_hut": "57c364fcde4bbff9",
"tutorial_look": "4998d8b95ff4fa8e",
"tutorial_mushroom": "ae582e11c9214891",
"tutorial_pickaxe": "0697d3610e8a70c5",
"tutorial_rabbit": "62544c47f9813cc4",
"tutorial_rod": "0aeae228c3e1e2ed",
"tutorial_sleep": "51fc176c04af2683",
"tutorial_sticks": "5a350695e62a28ef",
"tutorial_torch": "4bdb8837ac441e6e",
"tutorial_tree": "efcbe43e71059ba1",
"tutorial_weapon": "4d04fcd046eae1e2",
"tutorial_wolf": "b0725af812cc8d90",
"tutorial_workbench": "dd05c80fb8b3c3b8"
}

View File

@@ -0,0 +1,45 @@
{
"_voice": "c55ffaa0e19b744b",
"hint_cold": "ac4139441b7a347a",
"hint_cove": "91eb0dcbc24afe5c",
"hint_crab": "3a88cd0772a7676d",
"hint_died": "7b60d478f6fdbcef",
"hint_diet": "b5e9600c2da38bdf",
"hint_freezing": "0a63a53be413d808",
"hint_hard_winter": "03e1316a475c3c43",
"hint_howl": "05792dda3f3f0b60",
"hint_hungry": "c99c9fbc83506c43",
"hint_night": "04fc83670a1fd9e9",
"hint_rotten": "ecb8aecde8c6c762",
"hint_seam": "05531946c57cb97d",
"hint_sheltered": "7d3ebd27c230bc79",
"hint_sick": "b039c2449304ac53",
"hint_snow": "90a2e7f6735e4c83",
"hint_stamina": "e3e6cad6202abcaa",
"hint_storm": "477b250b6a9c97cb",
"hint_wet": "ebf9b034487bf92e",
"hint_wolf_moon": "d66b43dc8a23b5ed",
"tutorial_animals": "20b2eabd8de50d58",
"tutorial_axe": "c9a632910c8eaf19",
"tutorial_bed": "46f0130e86504f5b",
"tutorial_berries": "31d4fd1560fcf46f",
"tutorial_campfire": "6a7790be69235e80",
"tutorial_cook": "180b4f1413608105",
"tutorial_diet": "d44066db5adc0f78",
"tutorial_finish": "a9960edb587c3176",
"tutorial_fish": "7945d260ceff912b",
"tutorial_flax": "7e4f439fc7079272",
"tutorial_hut": "57c364fcde4bbff9",
"tutorial_look": "2345ea0b154d4014",
"tutorial_mushroom": "ae582e11c9214891",
"tutorial_pickaxe": "0697d3610e8a70c5",
"tutorial_rabbit": "62544c47f9813cc4",
"tutorial_rod": "0aeae228c3e1e2ed",
"tutorial_sleep": "51fc176c04af2683",
"tutorial_sticks": "5a350695e62a28ef",
"tutorial_torch": "4bdb8837ac441e6e",
"tutorial_tree": "efcbe43e71059ba1",
"tutorial_weapon": "4d04fcd046eae1e2",
"tutorial_wolf": "b0725af812cc8d90",
"tutorial_workbench": "dd05c80fb8b3c3b8"
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,40 +3,42 @@
"_doc": "T4 (docs/TUTORIAL_DESIGN.md §5): one-off tips in normal worlds, each shown once per player (user://hints.json), in list order when several are due. 'when' is kind:value, with | for alternatives: status (a survival status, by prefix), weather (a state), has (an item in your bag), event (howl, died), worldlet (where you are on the journey), or a plain check (night, stamina_low, wolf_moon, hard_winter, seam: holding the antler pickaxe with the cliff tunnel's seam still to dig). 'hold' is how long it must stay true first (seconds, default 1).",
"hints": [
{"id": "died", "when": "event:died", "title": "Back on your feet",
"text": "Dying's not the end out here. Whatever you carried is waiting where you fell, so go back for it before anything else. Sleep in a bed once and that's where you'll wake."},
"text": "Dying's not the end out here, don't you fret. Whatever you were carrying is waiting where you fell, so go back for it first. Sleep in a bed once, and that's where you'll wake."},
{"id": "freezing", "when": "status:Freezing", "title": "Freezing",
"text": "You're freezing, and that eats at your health. Get to a fire or under a roof, now. A cloak helps too."},
"text": "You're freezing, and that'll eat away at your health! Get to a fire or under a roof, now. A cloak helps too."},
{"id": "cold", "when": "status:Cold", "hold": 3, "title": "Getting cold",
"text": "Feel that chill? A fire warms you, a roof and walls keep the wind off, and a hide cloak buys you time."},
"text": "Feel that chill? A fire warms you up, a roof and walls keep the wind off, and a hide cloak buys you a bit of time."},
{"id": "sick", "when": "status:Food poisoning", "title": "Bad food",
"text": "Raw meat or something past its best: your belly's turned. It passes. Rest, don't eat for a bit, and cook your meat next time."},
"text": "Ooh, your belly's turned. Raw meat, or something past its best, I'd wager. It'll pass. Rest a while, don't eat for a bit, and cook your meat next time."},
{"id": "rotten", "when": "has:rotten_food", "title": "Food goes off",
"text": "Food doesn't keep forever. Eat the fresh stuff first, smoke meat and fish on a rack, or salt it. Rotten food's no good to anyone: throw it out."},
"text": "Food doesn't keep forever, you know. Eat the fresh stuff first, smoke your meat and fish on a rack, or salt it. Rotten food's no good to anyone, so throw it out."},
{"id": "wet", "when": "status:Wet", "hold": 2, "title": "Soaked",
"text": "Wet clothes steal your warmth. Stand under a roof or by a fire and you'll dry off."},
"text": "You're soaked through! Wet clothes steal your warmth. Stand under a roof or by a fire and you'll dry off."},
{"id": "hungry", "when": "status:Hungry", "hold": 2, "title": "Hungry",
"text": "Your belly's empty. Berries and mushrooms tide you over, but cooked meat and fish fill you up for longer."},
"text": "Your belly's empty. Berries and mushrooms will tide you over, but cooked meat and fish fill you up for longer."},
{"id": "diet", "when": "status:Poor diet|Malnourished", "hold": 2, "title": "Mix it up",
"text": "Eat the same thing every day and your body notices. Watch the three diet bars: meat, fish and greens. Keep them all topped up and you'll be stronger for it."},
"text": "Eat the same thing every day and your body notices, it does. Watch them three diet bars: meat, fish and greens. Keep them all topped up and you'll be stronger for it."},
{"id": "howl", "when": "event:howl", "title": "Wolves",
"text": "Hear that? Wolves have moved into the hills. They'll come hunting soon after dark. Walls, a door and a fire are your friends."},
{"id": "wolf_moon", "when": "wolf_moon", "title": "The red moon",
"text": "A red moon. The pack's bolder tonight and the big one leads them. Stay behind a good door, or stand by a fire with a weapon ready."},
"text": "A red moon, look. The pack's bolder tonight, and the big one leads them. Stay behind a good door, or stand by a fire with a weapon ready."},
{"id": "night", "when": "night", "hold": 5, "title": "Nightfall",
"text": "Dark and cold till morning. Keep near a fire or carry a torch. A bed under a roof lets you sleep through it."},
"text": "Dark and cold till morning, now. Keep near a fire or carry a torch. A bed under a roof lets you sleep right through it."},
{"id": "hard_winter", "when": "hard_winter", "hold": 3, "title": "Hard winter",
"text": "A hard winter's come in: a few days of bitter cold, and blizzards that freeze you even by day. Stock wood and food, and stay close to home."},
"text": "A hard winter's come in. A few days of bitter cold, and blizzards that'll freeze you even by day. Stock up on wood and food, and stay close to home."},
{"id": "snow", "when": "weather:snow|blizzard", "hold": 3, "title": "Snow",
"text": "Snow's falling. It's colder out in it, and heavy snow piles up on roofs. Keep your fire fed."},
"text": "Snow's falling. It's colder out in it, and heavy snow piles up on your roofs. Keep your fire fed."},
{"id": "storm", "when": "weather:storm", "hold": 3, "title": "Storm",
"text": "A storm. Lightning goes for the trees, so don't shelter under one. Your buildings are safe enough."},
"text": "A storm's coming in. Lightning goes for the trees, so don't you go sheltering under one. Your buildings are safe enough."},
{"id": "stamina", "when": "stamina_low", "title": "Out of breath",
"text": "You're spent. Stop swinging and running a moment and your stamina comes back. Rested by a fire, it comes back faster."},
"text": "You're all puffed out. Stop swinging and running a moment, and your stamina comes back. Rested by a fire, it comes back faster."},
{"id": "sheltered", "when": "status:Sheltered", "hold": 3, "title": "A proper shelter",
"text": "Roof and walls: the weather can't touch you here. Sit by a fire in here a little while and you'll be Rested."},
"text": "Roof and walls, that's the way. The weather can't touch you in here. Sit by a fire inside a little while and you'll be Rested."},
{"id": "seam", "when": "seam", "hold": 3, "title": "The cracked seam",
"text": "That antler pick bites rock iron only scratches. Out on the clifftop, near the edge, there's a seam of cracked rock, and a way down to the sea behind it if you dig. Take wood to prop it as you go, and lights: it's black as pitch in there."},
"text": "That antler pick bites rock that iron only scratches. Out on the clifftop, near the edge, there's a seam of cracked rock, and a way down to the sea behind it if you dig. Take wood to prop it as you go, and lights. It's black as pitch down there."},
{"id": "cove", "when": "worldlet:cove", "hold": 3, "title": "The Cove",
"text": "You made it down. Sand, salt and sea fish. Fish off the end of the pier: mackerel bite close in, cod further out where it's deep. The sea cave takes you back up the tunnel, and home's waiting at the top."}
"text": "Well, you made it down! Sand, salt and sea fish. Fish off the end of the pier: mackerel bite close in, and cod further out where it's deep. The sea cave takes you back up the tunnel to home. Watch out for the gulls: they'll have any food you leave on the sand, and fish off a smoking rack. And at dusk the crabs come up the beach, so give them room, or they'll pinch."},
{"id": "crab", "when": "has:crab_meat", "hold": 2, "title": "Crab",
"text": "Two lots of crab meat cook up into a good crab supper at a campfire. Raw, it's as risky as raw fish."}
]
}

View File

@@ -280,13 +280,49 @@
"name": "Wood Gable",
"category": "building",
"stack": 20,
"description": "Triangle that closes the end of a roof. R to flip it.",
"description": "Triangle that closes the end of a roof. R to flip it. On a wider house, stand it on a half wall to close a taller roof's end.",
"mesh": "wood_gable",
"place": {
"piece": "build",
"kind": "gable"
}
},
{
"id": "wood_half_wall",
"name": "Wood Half Wall",
"category": "building",
"stack": 20,
"description": "2 x 1 m. A low wall or railing, or on top of a wall, under a gable, to close the end of a wider house's taller roof.",
"mesh": "wood_half_wall",
"place": {
"piece": "build",
"kind": "half_wall"
}
},
{
"id": "wood_roof_ridge",
"name": "Wood Roof Ridge",
"category": "building",
"stack": 20,
"description": "A 2 m ridge cap: on a 6 m-wide house, it bridges the gap between the two sides' roofs, at the top.",
"mesh": "wood_roof_ridge",
"place": {
"piece": "build",
"kind": "roof_ridge"
}
},
{
"id": "wood_ridge_gable",
"name": "Wood Ridge Gable",
"category": "building",
"stack": 20,
"description": "A small triangle that closes the end under a roof ridge. Stand it on a half wall.",
"mesh": "wood_ridge_gable",
"place": {
"piece": "build",
"kind": "ridge_gable"
}
},
{
"id": "bed",
"name": "Bed",
@@ -593,6 +629,39 @@
},
"keeps": 4
},
{
"id": "crab_meat",
"name": "Crab Meat",
"category": "food",
"stack": 20,
"description": "Sweet white meat from a crab off the Cove's beach. Cook it at a campfire. (Fish)",
"mesh": "crab_meat",
"food": {
"hunger": 4,
"health": -2,
"diet": {
"fish": 8
},
"risk": 0.2
},
"keeps": 2
},
{
"id": "cooked_crab",
"name": "Cooked Crab",
"category": "food",
"stack": 20,
"description": "Boiled pink in its shell. Worth the pinches. (Fish)",
"mesh": "cooked_crab",
"food": {
"hunger": 20,
"health": 10,
"diet": {
"fish": 32
}
},
"keeps": 3
},
{
"id": "grilled_cod",
"name": "Grilled Cod",
@@ -1073,6 +1142,119 @@
"description": "Crusted on the rocks above the sea cliffs. Cures meat and fish so they keep for weeks.",
"mesh": "salt"
},
{
"id": "driftwood",
"name": "Driftwood",
"category": "resource",
"stack": 30,
"description": "Sea-bleached wood washed up on the Cove's beach. It burns well, and it's light and tough: what a rowing boat is built from.",
"mesh": "driftwood",
"fuel": 48.0
},
{
"id": "seagrass",
"name": "Seagrass",
"category": "resource",
"stack": 50,
"description": "Long, tough ribbons of seagrass washed up in the Cove's shallows. Twisted together it makes a rope that won't rot in salt water.",
"mesh": "seagrass"
},
{
"id": "rope",
"name": "Seagrass Rope",
"category": "resource",
"stack": 30,
"description": "Twisted from seagrass: for rigging and lashing a boat.",
"mesh": "rope"
},
{
"id": "pine_resin",
"name": "Pine Resin",
"category": "resource",
"stack": 50,
"description": "Sticky amber resin from a felled pine. Boiled with salt it makes pitch.",
"mesh": "pine_resin"
},
{
"id": "pitch",
"name": "Pitch",
"category": "resource",
"stack": 30,
"description": "Black, tarry pitch from pine resin and salt, boiled over a fire. It keeps the sea out of a boat's seams.",
"mesh": "pitch"
},
{
"id": "rowing_boat",
"name": "Rowing Boat",
"category": "tool",
"stack": 1,
"description": "A small driftwood boat, seams pitched tight. Carry it to the mooring post at the end of the Cove's pier to tie it up. Where it'll take you, a ship's compass will tell.",
"mesh": "rowing_boat"
},
{
"id": "treasure_map",
"name": "Treasure Map",
"category": "tool",
"stack": 1,
"description": "A torn chart from a wrecked ship's sea chest, with an X inked in the hills above the Cove. Right-click to read it: the X goes on your map (N).",
"mesh": "treasure_map",
"read": {
"marks": "treasure"
}
},
{
"id": "ship_compass",
"name": "Ship's Compass",
"category": "tool",
"stack": 1,
"description": "A brass sea compass from the pirate chest, its needle still true. No boat leaves for the Highlands without one.",
"mesh": "ship_compass"
},
{
"id": "spyglass",
"name": "Spyglass",
"category": "tool",
"stack": 1,
"description": "A captain's brass telescope. Hold right-click to look through it.",
"mesh": "spyglass",
"zoom": 4.0
},
{
"id": "pirate_gold",
"name": "Pirate Gold",
"category": "placeable",
"stack": 20,
"description": "Old gold coins from the pirate chest. Nothing on the island takes coin (yet), but a heap of it looks fine in a hut.",
"mesh": "pirate_gold",
"place": {
"piece": "trophy",
"footprint": [
0.6,
0.6
]
}
},
{
"id": "cutlass",
"name": "Cutlass",
"category": "weapon",
"stack": 1,
"description": "A pirate's curved blade: quick, and it hits harder than the iron spear.",
"mesh": "cutlass",
"weapon": {
"damage": 30,
"reach": 2.3,
"stamina": 8,
"cooldown": 0.45
},
"durability": 220,
"repair": {
"inputs": {
"iron_bar": 1
},
"station": "forge"
}
},
{
"id": "smoking_rack",
"name": "Smoking Rack",

View File

@@ -138,6 +138,37 @@
"wood": 1
}
},
{
"id": "wood_half_wall",
"output": "wood_half_wall",
"count": 1,
"station": "workbench",
"category": "building",
"inputs": {
"wood": 1
}
},
{
"id": "wood_roof_ridge",
"output": "wood_roof_ridge",
"count": 1,
"station": "workbench",
"category": "building",
"inputs": {
"wood": 2,
"fiber": 1
}
},
{
"id": "wood_ridge_gable",
"output": "wood_ridge_gable",
"count": 1,
"station": "workbench",
"category": "building",
"inputs": {
"wood": 1
}
},
{
"id": "bed",
"output": "bed",
@@ -259,6 +290,16 @@
"mackerel": 1
}
},
{
"id": "cooked_crab",
"output": "cooked_crab",
"count": 1,
"station": "campfire",
"category": "cooking",
"inputs": {
"crab_meat": 2
}
},
{
"id": "grilled_cod",
"output": "grilled_cod",
@@ -723,6 +764,40 @@
"stick": 2,
"fiber": 2
}
},
{
"id": "rope",
"output": "rope",
"count": 1,
"station": "",
"category": "tools",
"inputs": {
"seagrass": 3
}
},
{
"id": "pitch",
"output": "pitch",
"count": 1,
"station": "campfire",
"category": "building",
"inputs": {
"pine_resin": 2,
"salt": 1
}
},
{
"id": "rowing_boat",
"output": "rowing_boat",
"count": 1,
"station": "workbench",
"category": "building",
"inputs": {
"driftwood": 12,
"rope": 4,
"pitch": 3,
"nails": 6
}
}
]
}

View File

@@ -30,7 +30,7 @@
"id": "look",
"chapter": "tools",
"title": "Look around",
"text": "Awake at last! Washed up on my island, have you. Stretch your legs: WASD to walk, the mouse to look. Shift if you're in a hurry.",
"text": "Ha! Awake at last! Washed up on my island, eh? Well, stretch your legs. Use WASD to move, the mouse to look around, and Shift to run.",
"goal": {
"walk": 10
}
@@ -39,7 +39,7 @@
"id": "sticks",
"chapter": "tools",
"title": "Gather sticks and stones",
"text": "Empty hands are no use here. Look at a stick or a stone on the ground and press E. Three of each, mind.",
"text": "Now then! Empty hands are no use to anyone out here. Look at a stick or a stone on the ground and press E to pick it up. Why don't you go ahead and grab three of each.",
"marker": {
"nearest": "pickup:stick|stone"
},
@@ -60,7 +60,7 @@
"id": "flax",
"chapter": "tools",
"title": "Pick wild flax",
"text": "See the pale, tall plants? Wild flax. Pick some. The fibre makes torches, bows and a decent bed.",
"text": "See them tall, pale plants? That's wild flax. Pick a few of those. The fibre makes bows, a decent bed, and torches. You'll need a torch before long. It gets pretty dark here.",
"marker": {
"nearest": "pickup:fiber"
},
@@ -73,7 +73,7 @@
"id": "axe",
"chapter": "tools",
"title": "Craft a stone axe",
"text": "Now an axe. Two sticks and two flint: flint lies about, more by the water. Tab opens your pack, and the recipe's in there.",
"text": "Right, now you'll be wanting an axe. That's made from two sticks and two flint. Flint can be found lying all over the place, slightly darker than a stone. You'll find more by the water. If you press Tab to open your pack, you'll find the recipe in there.",
"marker": {
"nearest": "pickup:flint",
"unless_have": {
@@ -88,7 +88,7 @@
"id": "tree",
"chapter": "tools",
"title": "Chop down a tree",
"text": "Axe in hand (the number keys), hold the left button at a trunk and keep at it. A tree gives wood, and sticks when it falls.",
"text": "Got your axe? Good. Pick it with the number keys so it's in your hand, then click the left mouse button at a tree trunk a few times. Down it comes, and you'll get wood, and a few sticks besides.",
"marker": {
"nearest": "tree"
},
@@ -100,7 +100,7 @@
"id": "pickaxe",
"chapter": "tools",
"title": "Craft a pickaxe and break a boulder",
"text": "Rocks are next. A pickaxe takes two sticks, three stone and a flint. Then go and break a boulder for stone and flint of your own.",
"text": "Now for the rocks. Make yourself a pickaxe, from two sticks, three stone and a flint. Then go and give one of them big boulders a good few whacks, and you'll have stone and flint of your own.",
"marker": {
"nearest": "rock"
},
@@ -119,7 +119,7 @@
"id": "campfire",
"chapter": "food",
"title": "Build a campfire",
"text": "Five stone and four sticks make a campfire. Pick it in your pack, then place it with the left button (R turns it). Fire gives light, warmth and somewhere to cook. Feed it wood with E.",
"text": "Now, a fire. Five stone and four sticks make a campfire. Pick it in your pack, then click the left mouse button to put it down. R turns it round, if you're fussy. A fire gives you light, warmth, and somewhere to cook. Keep it fed with wood: look at it and press E.",
"goal": {
"placed": "campfire"
}
@@ -128,7 +128,7 @@
"id": "berries",
"chapter": "food",
"title": "Pick berries and eat some",
"text": "Those red berries on the bushes are safe. Pick some with E, then hold them and press the right button to eat.",
"text": "Hungry? Them red berries on the bushes are safe enough. Pick some with E, then hold them with the number keys and click the right mouse button to eat. Go on, have a few.",
"goal": {
"all": [
{
@@ -147,7 +147,7 @@
"id": "mushroom",
"chapter": "food",
"title": "Roast a mushroom",
"text": "Mushrooms grow under the trees. Raw ones are all right; roasted at the fire, much better. Find one and roast it (stand by the fire and open your pack).",
"text": "Mushrooms grow in the shade, under the trees. Raw ones are all right, but roasted at the fire they're a sight better. Find one, then stand by your fire and open your pack to roast it.",
"goal": {
"all": [
{
@@ -169,7 +169,7 @@
"id": "diet",
"chapter": "food",
"title": "Mind your diet",
"text": "See the three Diet bars, bottom left? Meat, Fish, Greens. Each food fills one. Let one run low and you stop healing; let two, and you'll waste away on a full belly. Keep all three up and you heal faster. Press Enter when you've got that.",
"text": "Now, see them three Diet bars, bottom left? Meat, fish and greens. Each food fills one of them. Let one run low and you'll stop healing. Let two run low, and you'll waste away on a full belly. Keep all three topped up and you'll heal faster. Press Enter when you've got all that.",
"goal": {
"continue": true
}
@@ -178,7 +178,7 @@
"id": "workbench",
"chapter": "hunt",
"title": "Build a workbench",
"text": "Better tools want a workbench nearby. Ten wood and two flint. Chop a few more trees if you're short.",
"text": "Better tools want a workbench close by. That's ten wood and two flint. If you're short, go and chop down a few more trees. Then put it down near your fire.",
"goal": {
"placed": "workbench"
}
@@ -187,7 +187,7 @@
"id": "weapon",
"chapter": "hunt",
"title": "Make a weapon",
"text": "You'll not catch your supper with your bare hands. A club is four wood. A spear, at the bench, reaches further.",
"text": "You'll not catch your supper with your bare hands, will you? A club is four wood, and you can make that anywhere. A spear reaches further, but you'll need to be at the bench for that one.",
"goal": {
"any": [
{
@@ -203,7 +203,7 @@
"id": "rabbit",
"chapter": "hunt",
"title": "Hunt a rabbit",
"text": "There, rabbits! They bolt if you run at them. Walk up quiet, weapon in hand, and strike.",
"text": "There! Rabbits! Run at them and they'll bolt, so creep up quiet, weapon in hand, and give them a whack.",
"goal": {
"killed": "rabbit"
},
@@ -222,7 +222,7 @@
"id": "cook",
"chapter": "hunt",
"title": "Butcher it and cook the meat",
"text": "E on the carcass to butcher it. Raw meat turns your stomach; cooked at the fire it heals you and keeps you Well fed.",
"text": "Now look at it and press E to butcher it. Don't you go eating that meat raw, it'll turn your stomach. Cook it at the fire, and it'll heal you up and keep you Well fed.",
"goal": {
"all": [
{
@@ -241,7 +241,7 @@
"id": "animals",
"chapter": "hunt",
"title": "Know your animals",
"text": "Deer are quick: a bow's your friend there. Boars are calm until you hit one, then they come for you. Wolves you'll meet soon enough. Press Enter.",
"text": "Deer are quick, so a bow's your friend there. Boars are calm enough until you hit one, then they'll come right for you. And wolves? Well, you'll meet them soon enough. Press Enter when you're ready.",
"goal": {
"continue": true
}
@@ -250,7 +250,7 @@
"id": "rod",
"chapter": "fish",
"title": "Make a fishing rod",
"text": "Two sticks, three fibre and a flint, at the workbench.",
"text": "Fancy a bit of fish? Make yourself a rod at the workbench, from two sticks, three fibre and a flint.",
"goal": {
"crafted": "fishing_rod"
}
@@ -259,7 +259,7 @@
"id": "fish",
"chapter": "fish",
"title": "Catch a fish and grill it",
"text": "Down to the lake. Rod in hand, the left button casts. When the float dips, click quick, before it gets away. Grill what you catch at the fire.",
"text": "Down to the lake with you. Rod in hand, click the left mouse button to cast. When the float dips, click again, quick as you can, before it gets away. Then grill what you catch at the fire.",
"goal": {
"all": [
{
@@ -285,7 +285,7 @@
"id": "hut",
"chapter": "night",
"title": "Build a little hut",
"text": "Nights get cold, and things prowl. Build a hut: I've marked out a good spot by your fire, pale as a ghost. Floors, walls and a door, then the roof, all from the bench. Put a piece near its place in the outline and it'll go right in. Done when you can stand inside out of the weather.",
"text": "Nights get cold out here, and things prowl about. You'll want a hut. I've marked out a good spot by your fire, pale as a ghost. Floors, walls and a door, then the roof, all made at the bench. Put each piece near its place in the outline and it'll go right in. You're done when you can stand inside, out of the weather.",
"goal": {
"shelter": true
},
@@ -300,7 +300,7 @@
"id": "bed",
"chapter": "night",
"title": "Make a bed and sleep spot",
"text": "Eight wood and six fibre make a bed. Put it inside, then E on it: that's where you'll wake if anything happens to you.",
"text": "Now a bed. That's eight wood and six fibre. Put it inside your hut, then look at it and press E. That's where you'll wake up if anything happens to you.",
"goal": {
"all": [
{
@@ -316,7 +316,7 @@
"id": "torch",
"chapter": "night",
"title": "Night is coming: make a torch",
"text": "There, the sun's going down. It gets dark and cold. A torch (a stick and two fibre) lights the way and keeps you a little warm.",
"text": "There, the sun's going down. It gets dark and cold, mind. Make yourself a torch, from a stick and two fibre. It lights the way, and keeps you a little warm besides.",
"goal": {
"crafted": "torch"
},
@@ -328,7 +328,7 @@
"id": "wolf",
"chapter": "night",
"title": "Wolves",
"text": "Hush. See it, at the edge of the light? Wolves. From the fourth night they hunt. They won't come close to a lit fire, a torch makes them think twice, and they can't bite through walls. Just watch.",
"text": "Hush now. See it, there, at the edge of the light? A wolf. From the fourth night they hunt. They won't come near a lit fire, a torch makes them think twice, and they can't bite through walls. Just you watch.",
"goal": {
"demo_wolf": true
},
@@ -340,7 +340,7 @@
"id": "sleep",
"chapter": "night",
"title": "Sleep till morning",
"text": "Off to bed with you. You can only sleep at night, under a roof with walls round you, and not with wolves about.",
"text": "Off to bed with you. You can only sleep at night, under a roof with walls round you, and not with wolves about. Look at your bed and press E.",
"goal": {
"slept": true
},
@@ -351,6 +351,6 @@
],
"finish": {
"title": "You'll do",
"text": "That's the island, near enough: gather, craft, eat a bit of everything, keep warm and dry, and be indoors or by a fire when the wolves are about. E picks up and uses, Tab is your pack, X takes a thing down, R turns what you're placing, the right button eats or wears. Off you go, then."
"text": "Well, you'll do. That's the island, near enough. Gather, craft, eat a bit of everything, keep warm and dry, and be indoors or by a fire when the wolves are about. Remember: E picks up and uses, Tab is your pack, X takes a thing down, R turns what you're placing, and the right mouse button eats or wears. Off you go, then."
}
}

View File

@@ -15,7 +15,8 @@
{"type": "ocean_edge"}
],
"climate": {"snowline": 42.0},
"places": [{"type": "pier", "at": "beach"}],
"places": [{"type": "den"}, {"type": "pier", "at": "beach"}, {"type": "wreck"}],
"wildlife": ["crabs", "gulls"],
"next": [
{"to": "valley", "by": "tunnel", "where": "sea_cave"},
{"to": "highlands", "by": "sail", "where": "pier"}

View File

@@ -14,5 +14,6 @@
{"type": "ocean_edge"}
],
"climate": {"snowline": 40.0},
"places": [{"type": "den"}, {"type": "barrow"}, {"type": "stones"}, {"type": "bear"}],
"next": [{"to": "cove", "by": "tunnel", "where": "sea_cliff"}]
}

View File

@@ -25,8 +25,8 @@ elsewhere, use **Tailscale** (recommended) or port forwarding (below).
- **Leaving** (Disconnect, or quitting the game) saves the island and
stops the server. Next time, Host Game carries on with the same island
(the seed field is locked once it exists).
- Its files: `~/Library/Application Support/Godot/app_userdata/Emberwild/host/`
(macOS; `%APPDATA%\Godot\app_userdata\Emberwild\host\` on Windows):
- Its files: `~/Library/Application Support/Godot/app_userdata/Cinderwild/host/`
(macOS; `%APPDATA%\Godot\app_userdata\Cinderwild\host\` on Windows):
`server.json`, `server.log`, and the world in `worlds/server-world/`.
- macOS may ask once whether Godot may accept incoming network
connections: say **Allow**, or friends can't connect.
@@ -47,14 +47,14 @@ The first player to join a new server becomes its admin (so join it
yourself before telling friends the address). More admins: `/admin <name>`.
**As a service** (starts on boot, restarts if it stops):
- **macOS:** `server/com.emberwild.server.plist`: edit the paths in it,
then `cp server/com.emberwild.server.plist ~/Library/LaunchAgents/` and
`launchctl load -w ~/Library/LaunchAgents/com.emberwild.server.plist`.
- **macOS:** `server/com.cinderwild.server.plist`: edit the paths in it,
then `cp server/com.cinderwild.server.plist ~/Library/LaunchAgents/` and
`launchctl load -w ~/Library/LaunchAgents/com.cinderwild.server.plist`.
It runs while you're logged in (set the Mac to log in automatically for an
always-on server). Log: `~/Library/Logs/emberwild-server.log`.
- **Linux:** `server/emberwild-server.service`: the steps are in the file
(`sudo systemctl enable --now emberwild-server`; logs with
`journalctl -u emberwild-server -f`).
always-on server). Log: `~/Library/Logs/cinderwild-server.log`.
- **Linux:** `server/cinderwild-server.service`: the steps are in the file
(`sudo systemctl enable --now cinderwild-server`; logs with
`journalctl -u cinderwild-server -f`).
As a service there's no terminal to type commands into: use chat in game,
or edit `server.json` and restart.
@@ -76,7 +76,7 @@ the ones you'll want first:
| `difficulty` | normal | easy / normal / hard |
| `sleep` | all_online | or `half`, `anyone`, `off` |
| `backups_kept`, `backup_hours` | 10, 6 | see below |
| `check_updates` | true | at start-up, say in the log if a newer Emberwild is out (and whether its protocol differs, so new players couldn't join) |
| `check_updates` | true | at start-up, say in the log if a newer Cinderwild is out (and whether its protocol differs, so new players couldn't join) |
| `allowlist`, `banned`, `admins` | | player ids (use `/ban`, `/admin` rather than editing) |
## Backups

80
docs/PLAYTEST.md Normal file
View File

@@ -0,0 +1,80 @@
# Cinderwild 0.6.0 playtest
Thanks for playing. This build is the **Valley** and the **Cove**, and
we'd like to know what breaks, what's confusing, and what's no fun. The
game's player guide is on the download page: https://cinderwild.psbailey.uk
## Reporting a bug
Press **Esc** in the game, then **Report a bug**:
- **Open the bug report page** opens a new issue on the Cinderwild Gitea page
in your browser, already filled in with your version, computer, mode,
land, the in-game time and where you are. Say what happened, what you
expected, and how to make it happen again, then press **Create Issue**.
Posting needs a (free) account on the Gitea server, and you need to be
signed in. Nothing is sent from the game itself.
- **Copy the details** puts the same details on your clipboard, if you'd
rather send them by message.
- **Show the log file** opens the folder with `godot.log`. For a crash or an
error message, attach it to the issue (drag it into the comment box).
`godot.log` is the latest run; the last few runs before it are kept
beside it, named with the date and time.
Where the log is:
| | |
|---|---|
| Mac | `~/Library/Application Support/Godot/app_userdata/Cinderwild/logs/godot.log` |
| Windows | `%APPDATA%\Godot\app_userdata\Cinderwild\logs\godot.log` |
| Linux | `~/.local/share/godot/app_userdata/Cinderwild/logs/godot.log` |
A screenshot helps for anything that looks wrong (Cmd+Shift+4 on a Mac,
Win+Shift+S on Windows).
One problem per issue, please; a second issue is better than a long one.
## What to try
Play however you like; these are the parts that are new or that we'd most
like tried.
**The Valley**
- The tutorial with Old Tam (New World, Tutorial), or start a normal world
and listen for his tips.
- Make a camp, survive a few nights, a winter, a wolf moon.
- Iron, stone building, the barrow, the standing stones and the Old Stag.
- Out on the clifftop, the cracked seam: dig the cliff tunnel down to the
Cove (an antler pickaxe, wood to prop it, lights).
**The Cove (new in 0.6.0)**
- The wreck at the far end of the beach: the captain's sea chest has a
treasure map for each player. Right-click the map, find your X (N for the
map), and dig it up with a pickaxe. Don't dig at night, or do.
- The pier: mackerel close in, cod from the far end.
- Gulls, after food on the sand and fish on a smoking rack.
- Crabs on the beach from dusk till dawn.
- Build a rowing boat (seagrass rope, pitch from pine resin and salt,
driftwood and nails, at a workbench) and tie it up at the end of the pier.
**Online**
- Host Game from the title screen, and have a friend join. Over the
internet, forward UDP ports **24242** and **24243** (the Cove has its own
server on the next port).
- Go between the lands together and apart, chat, sleep (everyone in every
land has to be in bed), and leave and come back.
## Not in this build (these aren't bugs)
- **Setting sail.** The boat ties up but can't leave yet: the Highlands are
the next part of the journey.
- **Pirate gold** has no use yet beyond being a trophy: there's no trader.
- **The ship's compass** does nothing yet; it's what the boat will need.
## Things we'd especially like to hear
- Anywhere you got stuck, or didn't know what to do next.
- Anything that felt too hard, too easy, or too slow (night, hunger, cold,
the drowned crew, the crabs).
- Frame-rate drops, and on what computer.
- Anything online that went out of step between players.

View File

@@ -93,11 +93,17 @@ phases M2.0-M2.7).
*Done (0.4.0):* W0-W3 and J1, the Cove reached down the cliff tunnel
(single-player). *(0.5.0):* J3, the journey on a server: a server per
land, players in different lands at once, chat, the player list, admin
and sleep across lands. Next J2, then J4 (the Highlands by sail).
and sleep across lands. *(0.6.0, a playtest):* the Cove's own: the wreck,
a treasure dig for each player and its drowned crew, crabs, gulls, and a
rowing boat moored at the pier; Report a bug in the pause menu. *(0.6.1)*
the new name, Cinderwild. *(0.6.2)* playtest fixes: animals off the cliffs,
wider and odd-shaped houses, real thunder, the tutorial's daylight, and Old
Tam rewritten in a new voice. Next J2,
then J4 (the Highlands by sail).
- Audio, music, weather. *Done (0.2.0-0.2.1):* mood music (calm, night,
storm, danger, boss) that crossfades with what's happening, ambience (CC0
birdsong, crickets, owls, fire), sound effects for every action (Kenney
CC0 plus synthesised), creature voices, Old Tam's spoken lines (Kokoro).
CC0 plus synthesised), creature voices, Old Tam's spoken lines (Kokoro, then Qwen3-TTS from 0.6.2).
Sources and licences: `assets/audio/CREDITS.md`; tools in `tools/audio/`
and `tools/voice/`.
- Help: the player guide on the download site (`tools/site/`), written
@@ -111,6 +117,66 @@ phases M2.0-M2.7).
game icon on the .exe (rcedit), Linux, and the update check below.
- **Updates**: the game (and a dedicated server) needs to notice when a new
version is out, download what's needed and install it. See below.
- **A single-player web version** (Paul, Nov 2026: after the playtest):
play straight from the download page, with "Download for the full game
and multiplayer" beside it. Godot's web export, single-threaded, on the
Compatibility renderer (WebGL 2). What we found (0.6.1):
- *The look:* rendered with that renderer (`build/web_look/`, from
`tools/site/shots.gd` run with `--rendering-method gl_compatibility`),
it's still clearly the game, but harsher: no volumetric fog or haze,
no SSAO/SSIL (darker, sharper shadows), deeper greens. Night and fire
light hold up. **The sea renders flat white**: `shaders/water.gdshader`
needs a Compatibility path. Ordinary distance fog would bring some
atmosphere back; grass density and tree counts likely need a lower
setting for browsers (speed not measured yet).
- *Single-player only:* browsers can't use ENet (UDP), and can't start
the Host Game or per-land server processes. Joining from a browser
would mean a WebSocket transport on the server, served over wss://
(a certificate per server): a separate, bigger job, if ever.
- *Saves* go in the browser's storage (IndexedDB): kept, but per browser
and lost if site data is cleared. Maybe an export/import button.
- *Input:* the pointer lock needs a click, and Esc releases it in the
browser, so the pause menu needs another key too (P).
- *Size and hosting:* the engine (godot.wasm, 39.5 MB) plus the game data
(about 22 MB) download first, then cache. Cloudflare Pages refuses files
over 25 MiB, so the .wasm has to live elsewhere (the Gitea release, or
another host) or be split.
- *Size of the job:* one step to build it and see how it runs, another to
fix the water, tune the graphics and controls, and put it on the page.
- **Cloud saves** (Paul, Nov 2026: with the web version, and useful before
it, desktop to desktop): carry a single-player world between the desktop
game and the browser, **both ways**.
- *In the game:* pause menu **Save to cloud** (a cloud name and a password
the first time; after that it can upload on each save: autosave, sleep,
quit); title screen **Load from cloud** (name and password, pick a
world, it downloads and you carry on). What travels: the world folder
(`meta.json`, `world.json`), its explored map (`maps/`), and which of
Old Tam's tips you've seen. Not online worlds (they live on their server).
- *Size:* a world is 8-32 KB on disk, a few KB compressed: uploads are
instant and storage is next to free.
- *Where:* a Cloudflare Worker beside the site (`/api/...`), saves in R2
(or D1). Free tier is plenty. (Paul's own server would do, but is one
more service to keep running.)
- *Safety:* passwords never stored, only a salted hash (PBKDF2, WebCrypto
in the Worker); HTTPS only; wrong guesses lock a name out for a while;
a size cap and a world count per name. Option: encrypt the save with
the password in the game before upload, so the server holds only
ciphertext (but a forgotten password loses the cloud copy; the local
copy is unaffected).
- *Playing in two places:* each upload carries a counter. If the cloud's
copy is newer than the one you last downloaded, the game asks ("The
cloud has a newer save (from the web, 20 minutes ago): use that, or
keep this one?") instead of overwriting it.
- *Versions:* the same save format on desktop and web; a save from a
newer version than the game says so rather than loading it badly.
- *Size of the job:* one step for the Worker and storage (with tests), one
for the game side (name and password, the buttons, the newer-copy
question). Paul creates the Worker and its storage in his Cloudflare
account; the code and setup steps come with it.
- **Later, maybe:** Android tablets (Nov 2026: left for now). Most input is
already named actions, so a touch layer (stick, look, contextual buttons)
is possible; the Mobile renderer has the same lost effects as the web, and
a tablet can join but not host (no server processes).
### Updates (to design with the packaged builds)
Needed because every network change bumps the protocol (12 as of P5), and
@@ -118,7 +184,7 @@ an out-of-date game can't join an up-to-date server: today that means
`git pull` and a restart on every machine.
*Built so far (the check):* `scripts/core/updates.gd` asks the feed in
Project Settings (`emberwild/updates/feed`, now the git server's
Project Settings (`cinderwild/updates/feed`, now the git server's
`releases/latest` API; Gitea, Forgejo and GitHub answer alike) once at
start-up. It reads the release's `version.json` asset (written by
`tools/export.sh`: version, protocol, per-platform file, sha256 and size).

View File

@@ -40,7 +40,7 @@ server/run_server.sh --server-name "Paul's island" --password secret --port 2424
It checks the Godot version, imports a fresh copy, then starts the server on
UDP 24242 with no window. Settings live in `server.json` (its path is printed
at start-up; on macOS it's under
`~/Library/Application Support/Godot/app_userdata/Emberwild/server/`).
`~/Library/Application Support/Godot/app_userdata/Cinderwild/server/`).
The shared island is saved in `worlds/server-world/` in that same folder,
within 10 seconds of any change (and when someone leaves). Stop it with
Ctrl+C. Players join with **Join Game** on the title screen. Over
@@ -82,13 +82,13 @@ godot --headless --path . --script res://tests/test_survival_stats.gd
## Save files
Worlds are per machine, under
`~/Library/Application Support/Godot/app_userdata/Emberwild/worlds/` on
macOS (`%APPDATA%\Godot\app_userdata\Emberwild\worlds\` on Windows). Copy a
`~/Library/Application Support/Godot/app_userdata/Cinderwild/worlds/` on
macOS (`%APPDATA%\Godot\app_userdata\Cinderwild\worlds\` on Windows). Copy a
world's folder across to move it to another machine.
The game used to be called Valheimlike, and its data lived in
`app_userdata/Valheimlike/`. The first time Emberwild starts it copies worlds,
your identity and server settings across to `app_userdata/Emberwild/`
`app_userdata/Valheimlike/`. The first time Cinderwild starts it copies worlds,
your identity and server settings across to `app_userdata/Cinderwild/`
(`scripts/core/boot.gd`). The old folder is left alone as a backup, and you
can delete it once you're happy.

View File

@@ -275,7 +275,7 @@ small Diet bars, and a low group blinks.
- **Autosave** every 2 minutes, on Save & Quit (to the title or desktop) and
when the window is closed.
- Saves live in `user://worlds/<id>/` (on macOS:
`~/Library/Application Support/Godot/app_userdata/Emberwild/worlds/`) as
`~/Library/Application Support/Godot/app_userdata/Cinderwild/worlds/`) as
`meta.json` + `world.json`. Writes are atomic, and the previous save is
kept as `world.json.bak`.
- A save stores only what the player changed: player position and look,

View File

@@ -283,6 +283,68 @@ The steps:
- Later: tides (sea level shifting slowly), a raft or rowing boat, and
driftwood on the beach.
### The Cove's own dangers and the pirate treasure (Paul, Nov 2026, for 0.6.0)
Paused at the Cove for a playtest before the Highlands. The Cove gets its
own set pieces instead of copies of the Valley's:
- **Set pieces per land**, listed in each worldlet's data (`"places"`). The
Valley keeps the wolf den, the barrow, the standing stones (the Old Stag)
and the bear; the Cove keeps the wolves only, and gets the wreck and the
treasure.
- **The wreck:** a beached ship on the rocks at the far end of the bay, its
timbers along the sand (driftwood). Its captain's sea chest: some nails,
rope, coins and a **torn treasure map**.
- **The map:** reading it puts an X on your N map: a mound of loose earth
by a marker stone in the Cove's hills (your own spot: see below).
- **The dig:** a pickaxe, many blows, turns up the **pirate chest**: a
**ship's compass** (what the boat will need to sail to the Highlands: the
next crossing's gate, J2), a **spyglass** (zooms your view while held),
**pirate gold**, and a **cutlass** (quick, harder-hitting than the iron
spear).
- **One treasure each, each in its own place** (online too): the wreck's
chest gives each player their own map, once, and each map's X is
somewhere different: picked from the world's seed and the player's id
(so it's fixed for them), among dry, gentle spots in the Cove's hills
away from the other places. You only see your own mound; the server knows
every player's spot and what each has found, and checks the right one
when you dig.
- **Gold** is a **trophy you can place** in your hut (a heap of coins) for
now; what else it's for waits until there's a trader.
- **The drowned crew:** the treasure's guards (the Cove's barrow guards).
Two or three rise from the shallows round the dig at night, or as the
chest comes up, for whoever's digging. Slow, hit hard, unafraid of fire,
they drag at you in the water.
- **Crabs** on the beach at dusk (pinch if trodden on; food), and **gulls**,
thieves like the crows (fish off drying racks, things dropped on sand).
- **The boat** (J2's first part): driftwood, seagrass rope and pitch (pine
resin and salt), at a workbench, placed at the pier. One each, moored,
yours and your friends'. Setting sail says the Highlands are uncharted
for now.
- **Report a bug** in the pause menu, and a short playtest guide.
- Order: set pieces per land, the wreck and map, the dig and the drowned
crew, crabs and gulls, the boat, report a bug; then 0.6.0 (protocol 18).
**Built (Nov 2026), and where it differs from the plan above:**
- Places: `"places"` in `data/worldlets/*.json` (`world.has_place()`); the
Cove's extra wildlife in `"wildlife"` (`world.has_wildlife()`).
- The wreck (`scripts/world/wreck.gd`): the sea chest gives a map, 4 nails
and 2 salt (no rope or coins: gold comes from the dig). Each X is one of
12 hiding spots picked from the seed (`world.treasure_spots()`), chosen
per player by their id.
- The dig (`treasure.gd`, `treasure_mound.gd`, `crew_site.gd`): 18 HP, any
pickaxe; three drowned rise round the mound itself (not from the
shallows), at the first blow by night or as the chest comes up by day.
- Crabs (`crab.gd`, `shore.gd`): up to 5 per player on the sand from 17:30
to 06:30, pinch for 5 within about 2 m, let you go past 6 m; crab meat.
Gulls (`gull.gd`, `thieves.gd`): food on the sand, and fish on a smoking
rack; they take one and fly off (only food, not tools left on the sand).
- The boat (`moorings.gd`, `boat.gd`, `mooring_post.gd`): a rowing boat
item (12 driftwood, 4 rope, 3 pitch, 6 nails), tied up at the post at the
end of the pier rather than placed freely: 6 berths, one boat each, saved
with the Cove. Pine resin drops from felled pines in every land.
- Report a bug (`scripts/core/bug_report.gd`): opens the repo's new-issue
page filled in (the tester posts it, signed in); no token in the game.
Testers' notes: `docs/PLAYTEST.md`.
## 6. Done already (groundwork)
- `world.water_at(x, z)` returns `{type, surface, depth}` for the lake and
the sea, and fishing uses it instead of `terrain.water_level`.

View File

@@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources"
include_filter="data/*.json, data/worldlets/*.json"
exclude_filter="tests/*, docs/*, tools/*, server/*"
export_path="build/macos/Emberwild.zip"
export_path="build/macos/Cinderwild.zip"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
@@ -26,11 +26,11 @@ custom_template/release=""
debug/export_console_wrapper=0
application/icon=""
application/icon_interpolation=4
application/bundle_identifier="com.pbailey.emberwild"
application/bundle_identifier="com.pbailey.cinderwild"
application/signature=""
application/app_category="Games"
application/short_version="0.5.0"
application/version="0.5.0"
application/short_version="0.6.2"
application/version="0.6.2"
application/copyright=""
display/high_res=true
codesign/codesign=1
@@ -66,7 +66,7 @@ custom_features=""
export_filter="all_resources"
include_filter="data/*.json, data/worldlets/*.json"
exclude_filter="tests/*, docs/*, tools/*, server/*"
export_path="build/windows/Emberwild/Emberwild.exe"
export_path="build/windows/Cinderwild/Cinderwild.exe"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
@@ -89,11 +89,11 @@ application/modify_resources=false
application/icon=""
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version="0.5.0"
application/product_version="0.5.0"
application/file_version="0.6.2"
application/product_version="0.6.2"
application/company_name=""
application/product_name="Emberwild"
application/file_description="Emberwild"
application/product_name="Cinderwild"
application/file_description="Cinderwild"
application/copyright=""
application/trademarks=""
application/export_angle=0

View File

@@ -1,5 +1,5 @@
#!/bin/sh
# Starts Emberwild (the game, with its window and title screen).
# Starts Cinderwild (the game, with its window and title screen).
#
# ./play.sh
#

View File

@@ -14,12 +14,12 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
[application]
config/name="Emberwild"
config/name="Cinderwild"
config/description="Low-poly survival game — Valheim look, Rust depth, self-hosted, moddable."
run/main_scene="res://scenes/title.tscn"
config/features=PackedStringArray("4.7", "Forward Plus")
config/icon="res://icon.svg"
config/version="0.5.0"
config/version="0.6.2"
[autoload]
@@ -93,9 +93,9 @@ weather_wind={
"value": 1.0
}
[emberwild]
[cinderwild]
updates/feed="https://git.psbailey.uk/api/v1/repos/Admin/Emberwild/releases/latest"
updates/feed="https://git.psbailey.uk/api/v1/repos/Admin/Cinderwild/releases/latest"
[rendering]

View File

@@ -61,6 +61,15 @@ static func _define() -> Dictionary:
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0), Vector3(1, 1, 0)],
"center": Vector3(0.33, 0.33, 0),
}
# Half wall: 2 m wide, 1 m tall (0.6.2, Gitea #7). On a wall's top, under
# a gable, it closes the end of a taller roof (a wider house, with a
# second row of roof panels); on a floor, it's a low wall or a railing.
k["half_wall"] = {
"shapes": [_box(Vector3(0, 0.5, 0), Vector3(2, 1, 0.2))],
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0),
Vector3(-1, 1, 0), Vector3(0, 1, 0), Vector3(1, 1, 0)],
"center": Vector3(0, 0.5, 0),
}
# --- P2 (docs/PROGRESSION_DESIGN.md §3) ---
# Pillar: a 0.4 m post standing on a floor corner or edge, carrying what's
# on top (a floor's corner meets its top).
@@ -95,6 +104,29 @@ static func _define() -> Dictionary:
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0)],
"center": Vector3(0, 1.5, 0),
}
# Roof ridge (0.6.2, Gitea #7): a 2 m cap, an upside-down V at the roof's
# slope, for houses whose width leaves a 2 m gap between the two sides'
# top rows (6 m, 10 m). Origin = centre at the level of the rows' top
# edges (local z = +-1), rising 0.5 m to the peak along z = 0.
var ns := Vector3(0, cos(ROOF_ANGLE), sin(ROOF_ANGLE))
var nn := Vector3(0, cos(ROOF_ANGLE), -sin(ROOF_ANGLE))
var half := sqrt(1.25)
k["roof_ridge"] = {
"shapes": [
{"type": "box", "center": Vector3(0, 0.25, 0.5) + ns * ROOF_T * 0.5, "size": Vector3(2, ROOF_T, half), "basis": Basis(Vector3.RIGHT, ROOF_ANGLE)},
{"type": "box", "center": Vector3(0, 0.25, -0.5) + nn * ROOF_T * 0.5, "size": Vector3(2, ROOF_T, half), "basis": Basis(Vector3.RIGHT, -ROOF_ANGLE)},
_box(Vector3(0, 0.55, 0), Vector3(2, 0.08, 0.3))], # (the ridge board: no gap at the peak for rain, or the shelter test)
"snaps": [Vector3(-1, 0, 1), Vector3(0, 0, 1), Vector3(1, 0, 1),
Vector3(-1, 0, -1), Vector3(0, 0, -1), Vector3(1, 0, -1)],
"center": Vector3(0, 0.25, 0),
}
# Ridge gable: the small triangle (2 m wide, 0.5 m tall, peak in the
# middle) that closes the end under a roof ridge, on a half wall or a wall.
k["ridge_gable"] = {
"shapes": [_prism([Vector2(-1, 0), Vector2(1, 0), Vector2(0, 0.5)], 0.2)],
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0), Vector3(0, 0.5, 0)],
"center": Vector3(0, 0.17, 0),
}
var n := Vector3(0, cos(ROOF_ANGLE), sin(ROOF_ANGLE)) # panel normal (up and out)
# (Ends exactly at the ridge. The seam where two roofs meet is handled by
# build_system.roofed_at sampling several rays.)

View File

@@ -162,6 +162,23 @@ func recompute() -> Array:
# --- placement --------------------------------------------------------------
## Roof pieces: these may pass through one another.
const ROOF_KINDS := ["roof", "roof_ridge"]
## A roof piece of `kind` already sitting at `xf` (the same place, facing
## the same way), so a second one isn't put inside the first.
func _same_roof_at(kind: String, xf: Transform3D, exclude: Node) -> bool:
for p in build_pieces():
if p == exclude or p.kind != kind:
continue
var pxf: Transform3D = p.global_transform
var facing: float = pxf.basis.z.normalized().dot(xf.basis.z.normalized())
if kind == "roof_ridge":
facing = absf(facing) # (it's the same both ways round)
if pxf.origin.distance_to(xf.origin) < 0.15 and facing > 0.99:
return true
return false
## Why a building piece can't go at `xf` ("" = it can).
func check(def: Dictionary, xf: Transform3D, exclude: Node = null) -> String:
var kind: String = def.place.kind
@@ -172,6 +189,9 @@ func check(def: Dictionary, xf: Transform3D, exclude: Node = null) -> String:
if c.y < terrain.water_level + 0.1:
return "Can't build in water"
var space := world.get_world_3d().direct_space_state
var roofy: bool = kind in ROOF_KINDS
if roofy and _same_roof_at(kind, xf, exclude):
return "There's already a roof there"
for s in info.shapes:
var made := BuildPiece.make_shape(s, OVERLAP_MARGIN)
var q := PhysicsShapeQueryParameters3D.new()
@@ -182,9 +202,13 @@ func check(def: Dictionary, xf: Transform3D, exclude: Node = null) -> String:
if exclude != null:
ex.append(exclude.get_rid())
q.exclude = ex
var hits := space.intersect_shape(q, 1)
if not hits.is_empty():
last_blocker = hits[0].collider
var hits := space.intersect_shape(q, 8)
for h in hits:
# Roofs can run through other roofs (Gitea #7: an L, a wing at an
# angle, roofs at odd heights), but nothing else.
if roofy and h.collider != null and String(h.collider.get("kind")) in ROOF_KINDS:
continue
last_blocker = h.collider
return "Something's in the way"
var mat := BuildPiece.material_of(def)
if support_for(kind, xf, exclude, mat) < MIN_SUPPORT:

View File

@@ -2,16 +2,17 @@ extends Node
## Autoload "Boot", first in the list: one-off start-up housekeeping that has
## to happen before anything reads user://.
##
## The game was called "Valheimlike" until it became "Emberwild". Godot names
## the user-data folder after the project, so the rename moved it from
## .../app_userdata/Valheimlike to .../app_userdata/Emberwild. The first time
## Emberwild starts, this copies saved worlds, your identity (key, name, look)
## and server settings across. It copies rather than moves, so the old folder
## stays as a backup, and it never overwrites anything already in the new
## folder. Test folders (test_*) and logs are skipped.
## The game has been renamed twice: "Valheimlike", then "Emberwild" (0.1.0 to
## 0.6.0), now "Cinderwild". Godot names the user-data folder after the
## project, so each rename moved it (.../app_userdata/<name>). The first time
## Cinderwild starts, this copies saved worlds, your identity (key, name,
## look), settings and server settings across from the newest old folder there
## is (it already holds what came from the one before). It copies rather than moves, so the old folders stay
## as a backup, and it never overwrites anything already in the new folder.
## Test folders (test_*) and logs are skipped.
const OLD_NAME := "Valheimlike"
const MARKER := "migrated_from_valheimlike.txt"
const OLD_NAMES := ["Emberwild", "Valheimlike"] ## newest first
const MARKER := "migrated_from_%s.txt"
const SKIP := ["logs", "shader_cache", "vulkan", "test_worlds", "test_net"]
var copied := 0
@@ -22,14 +23,25 @@ func _enter_tree() -> void:
## Returns the number of files copied (0 if there was nothing to do).
func migrate_user_data() -> int:
var new_dir := OS.get_user_data_dir()
var old_dir := new_dir.get_base_dir().path_join(OLD_NAME)
for old_name in OLD_NAMES:
var old_dir := new_dir.get_base_dir().path_join(old_name)
if DirAccess.dir_exists_absolute(old_dir) and old_dir != new_dir:
# Only the newest: it already holds whatever came across from the
# one before (a world deleted since shouldn't come back).
return migrate_from(old_dir, new_dir, old_name)
return 0
## Copies `old_dir` into `new_dir` once (a marker file in `new_dir` says it's
## been done). Returns the number of files copied.
func migrate_from(old_dir: String, new_dir: String, old_name: String) -> int:
if new_dir == old_dir or not DirAccess.dir_exists_absolute(old_dir):
return 0
if FileAccess.file_exists(new_dir.path_join(MARKER)):
var marker := new_dir.path_join(MARKER % old_name.to_lower())
if FileAccess.file_exists(marker):
return 0
copied = 0
_copy_tree(old_dir, new_dir)
var f := FileAccess.open(new_dir.path_join(MARKER), FileAccess.WRITE)
var f := FileAccess.open(marker, FileAccess.WRITE)
if f != null:
f.store_string("Copied %d files from %s on %s. The old folder was left as it was.\n" % [
copied, old_dir, Time.get_datetime_string_from_system()])
@@ -43,6 +55,8 @@ func _copy_tree(from: String, to: String) -> void:
if da == null:
return
for f in da.get_files():
if f.begins_with("migrated_from_"):
continue # (the old folder's own markers)
var dst := to.path_join(f)
if not FileAccess.file_exists(dst) and DirAccess.copy_absolute(from.path_join(f), dst) == OK:
copied += 1

View File

@@ -0,0 +1,88 @@
extends RefCounted
## Report a bug (0.6.0, the playtest; pause menu): opens a new issue on the
## Cinderwild repo in your browser, already filled in with a title to edit,
## a few questions to answer, and the details we'd ask for anyway (version,
## computer, single-player or online, which land, the day and time, where you
## are). You read it, add what happened, and press Create Issue: nothing is
## sent from the game itself. Posting needs an account on the Gitea server.
##
## The game's log (Godot writes it to user://logs/godot.log) helps with a
## crash or an error: the pause menu shows where it is and opens its folder,
## to attach the file to the issue.
const REPO := "https://git.psbailey.uk/Admin/Cinderwild"
## An autoload (Net, Updates), looked up at run time: this script is also
## loaded by tests that start before the autoloads are compiled in.
static func _al(n: String) -> Node:
return (Engine.get_main_loop() as SceneTree).root.get_node_or_null(n)
## Where this game's log is, on disk.
static func log_path() -> String:
return ProjectSettings.globalize_path("user://logs/godot.log")
## The same, with your home folder as "~" (so your user name isn't in an
## issue anyone can read).
static func log_path_short() -> String:
var home := OS.get_environment("HOME") if OS.get_name() != "Windows" else OS.get_environment("USERPROFILE")
var p := log_path()
if not home.is_empty() and p.begins_with(home):
p = "~" + p.substr(home.length())
return p
static func log_dir() -> String:
return ProjectSettings.globalize_path("user://logs")
## How you're playing: "single-player", or online with the server's rules.
static func mode(world: Node) -> String:
if world == null or not world.has_method("is_online") or not world.is_online():
return "single-player"
var net := _al("Net")
var rules := "PvP" if bool(net.server_info.get("pvp", false)) else "co-op"
if bool(net.server_info.get("raiding", false)):
rules += ", raiding"
return "online (%s%s)" % [rules, ", hosting" if net.hosting else ""]
## The details, one per line (what's in the issue, and what "Copy" copies).
static func details(world: Node) -> Dictionary:
var d := {
"Version": "Cinderwild %s (protocol %d)" % [String(ProjectSettings.get_setting("application/config/version", "?")), int(_al("Net").PROTOCOL)],
"Computer": "%s %s" % [OS.get_name(), OS.get_version()],
"Graphics": "%s (%s)" % [RenderingServer.get_video_adapter_name(), RenderingServer.get_current_rendering_method()],
"Mode": mode(world),
}
if world != null and is_instance_valid(world) and world.has_method("worldlet_id"):
d["Land"] = preload("res://scripts/world/terrain.gd").worldlet_name(String(world.worldlet_id()))
if world.get("day_night") != null:
var h: float = world.day_night.hours()
d["Time"] = "day %d, %02d:%02d" % [int(world.day_night.day), int(h), int(fmod(h, 1.0) * 60.0)]
if world.get("player") != null and is_instance_valid(world.player):
var p: Vector3 = world.player.global_position
d["Where"] = "%.0f, %.0f, %.0f" % [p.x, p.y, p.z]
if world.get("terrain") != null:
d["Seed"] = str(world.terrain.noise_seed)
return d
static func details_text(world: Node) -> String:
var d := details(world)
var lines: Array[String] = []
for k in d:
lines.append("- %s: %s" % [k, d[k]])
return "\n".join(lines)
static func body(world: Node) -> String:
return "\n".join([
"**What happened?**", "", "",
"**What did you expect to happen?**", "", "",
"**How can we make it happen again?** (what you did just before)", "1. ", "",
"**Screenshot or log** (optional: drag a screenshot here, or the log file from %s)" % log_path_short(), "",
"---", details_text(world)])
## The new-issue page, filled in.
static func issue_url(world: Node, title: String = "") -> String:
var t := title if not title.is_empty() else "Bug: "
return "%s/issues/new?title=%s&body=%s" % [REPO, t.uri_encode(), body(world).uri_encode()]
## Opens it in the browser. Returns false when the browser couldn't be opened.
static func open(world: Node) -> bool:
return OS.shell_open(issue_url(world)) == OK

View File

@@ -0,0 +1 @@
uid://tnlssmningwq

View File

@@ -324,12 +324,34 @@ func _process(delta: float) -> void:
if d > 0.01 and d < 5.0: # (not a teleport or a respawn)
_count("walk", d)
_last_pos = p
hold_daylight()
_marker_t -= delta
if _marker_t <= 0.0:
_marker_t = 0.5
_marker = find_marker()
poll()
## The sun waits for you (Gitea #5): until a step that sets the clock comes
## up (the torch step, at dusk), the afternoon goes no later than
## DAYLIGHT_UNTIL, however long the earlier steps take. Then dusk comes on
## when the tutorial means it to.
const DAYLIGHT_UNTIL := 16.5
func hold_daylight() -> void:
if not active or world == null or not is_instance_valid(world) or world.day_night == null:
return
if _clock_step_reached():
return
var latest := DAYLIGHT_UNTIL / 24.0
if world.day_night.time > latest:
world.day_night.time = latest
## Whether the current step, or one before it, moves the clock on.
func _clock_step_reached() -> bool:
for i in range(mini(index + 1, steps.size())):
if Dictionary(steps[i].get("setup", {})).has("time"):
return true
return false
## Goals that are states, not events: checked twice a second.
func poll() -> void:
if not active or world == null or not is_instance_valid(world):

View File

@@ -19,6 +19,7 @@ extends Node
const K := "res://assets/audio/sfx/kenney/"
const S := "res://assets/audio/sfx/synth/"
const C := "res://assets/audio/sfx/creatures/"
const T := "res://assets/audio/sfx/thunder/"
const EARSHOT := 45.0 ## a server sends a sound to players this close
## id -> files (or a [prefix, count] pair), volume (dB), pitch range, reach (m),
@@ -28,6 +29,10 @@ const SOUNDS := {
"tree_fall": {"set": [K + "wood_heavy_%d.ogg", 5], "db": 0.0, "pitch": [0.6, 0.7], "reach": 60.0, "with": "creak"},
"creak": {"set": [K + "creak_%d.ogg", 3], "db": -2.0, "pitch": [0.8, 0.95], "reach": 50.0},
"mine": {"set": [K + "mine_%d.ogg", 5], "db": -1.0, "pitch": [0.9, 1.1]},
# Thunder (0.6.2, CC0 recordings: assets/audio/CREDITS.md). The weather
# plays the storm's own (weather_fx.gd); a strike on a tree cracks from it.
"thunder_near": {"set": [T + "thunder_near_%d.ogg", 3], "db": 0.0, "pitch": [0.92, 1.05], "reach": 400.0},
"thunder_far": {"set": [T + "thunder_far_%d.ogg", 3], "db": -5.0, "pitch": [0.9, 1.05], "reach": 400.0},
"rock_break": {"set": [K + "mine_%d.ogg", 5], "db": 1.0, "pitch": [0.6, 0.7], "reach": 50.0},
"rustle": {"set": [K + "cloth_%d.ogg", 4], "db": -4.0, "pitch": [0.7, 0.9]},
"pickup": {"set": [K + "leather_%d.ogg", 3], "db": -6.0, "pitch": [0.95, 1.15], "reach": 15.0},
@@ -87,6 +92,8 @@ const SOUNDS := {
"guard_rattle": {"set": [C + "guard_rattle_%d.ogg", 2], "db": -2.0, "pitch": [0.85, 1.1], "reach": 25.0},
"crow_caw": {"set": [C + "crow_caw_%d.ogg", 2], "db": -4.0, "pitch": [0.92, 1.1], "reach": 40.0},
"fox_yip": {"set": [C + "fox_yip_%d.ogg", 2], "db": -4.0, "pitch": [0.92, 1.12], "reach": 30.0},
"gull_cry": {"set": [C + "gull_cry_%d.ogg", 2], "db": -5.0, "pitch": [0.9, 1.12], "reach": 50.0},
"crab_click": {"set": [C + "crab_click_%d.ogg", 2], "db": -6.0, "pitch": [0.85, 1.15], "reach": 14.0},
}
const BUSES := ["Music", "SFX", "Ambience", "Voice"]
const DEFAULT_VOLUMES := {"Master": 0.85, "Music": 0.6, "SFX": 0.9, "Ambience": 0.7, "Voice": 1.0}
@@ -194,6 +201,17 @@ func me(id: String) -> void:
_log(id, null)
_play2(id)
## A random one of sound `id`'s files, and its volume: for a player of your
## own (the weather's thunder). Not logged: call log_heard() when it plays.
func stream_for(id: String) -> AudioStream:
return _pick(id) if SOUNDS.has(id) else null
func db_for(id: String) -> float:
return float(SOUNDS.get(id, {}).get("db", 0.0))
func log_heard(id: String) -> void:
_log(id, null)
## Menus and the HUD.
func ui(id: String) -> void:
_log(id, null)

View File

@@ -1,13 +1,13 @@
extends Node
## The update check (docs/ROADMAP.md, M4 "Updates", first step): is there a
## newer Emberwild than this one? Asked once at start-up, of the feed in
## Project Settings (`emberwild/updates/feed`). The feed is either
## newer Cinderwild than this one? Asked once at start-up, of the feed in
## Project Settings (`cinderwild/updates/feed`). The feed is either
## - a release API answer (Gitea, Forgejo or GitHub `releases/latest`): its
## `version.json` asset is fetched next, and its other assets are the
## downloads, by file name; or
## - a `version.json` itself:
## {"version": "0.2.0", "protocol": 13, "notes": "...", "page": "https://...",
## "downloads": {"macos": {"file": "Emberwild-0.2.0-macos.zip", "sha256": "...",
## "downloads": {"macos": {"file": "Cinderwild-0.2.0-macos.zip", "sha256": "...",
## "size": 61164958, "url": "(optional; else the asset)"},
## "windows": {...}}}
## tools/export.sh writes that file next to the zips, for the release.
@@ -22,7 +22,7 @@ signal checked(state: String)
const TIMEOUT := 10.0
var version: String = String(ProjectSettings.get_setting("application/config/version", "0.0.0"))
var feed: String = String(ProjectSettings.get_setting("emberwild/updates/feed", ""))
var feed: String = String(ProjectSettings.get_setting("cinderwild/updates/feed", ""))
var prefs_path := "user://updates.json"
var enabled := true
## idle | off | checking | current | available | failed
@@ -101,7 +101,7 @@ func _finish(s: String) -> void:
if s == "failed":
print("[updates] couldn't check for updates: ", error)
elif s == "available":
print("[updates] Emberwild %s is out (this is %s)" % [latest_version(), version])
print("[updates] Cinderwild %s is out (this is %s)" % [latest_version(), version])
checked.emit(s)
func _get_json(url: String) -> Variant:
@@ -112,7 +112,7 @@ func _get_json(url: String) -> Variant:
var http := HTTPRequest.new()
http.timeout = TIMEOUT
add_child(http)
var err := http.request(url, ["Accept: application/json", "User-Agent: Emberwild/" + version])
var err := http.request(url, ["Accept: application/json", "User-Agent: Cinderwild/" + version])
if err != OK:
http.queue_free()
error = "couldn't ask %s (%d)" % [url, err]

113
scripts/creatures/crab.gd Normal file
View File

@@ -0,0 +1,113 @@
extends "res://scripts/creatures/creature.gd"
## A crab (0.6.0, the Cove only): shore.gd brings them up out of the sea
## onto the beach at dusk. They scuttle about the sand sideways and keep to
## it. Walk within NIP of one and it comes at you, claws up, and pinches
## (not much, but it adds up with three of them about). Leave it NIP_GIVE_UP
## behind and it forgets you. Hit one hard enough and it runs for it. At
## dawn they all go back into the sea. A dead one gives crab meat.
const NIP := 2.2 ## this close and it comes for you
const NIP_GIVE_UP := 6.0 ## this far and it lets you go
const HOME_FOR := 40.0 ## at dawn: this long to reach the water before it simply goes
func interact_prompt(p: Node) -> String:
if is_dead():
return "Crab [E] Crack it open"
match state:
"charge": return "Crab (claws up!)"
"home": return "Crab (heading back to the sea)"
return "Crab (keep your distance, or it'll pinch)"
## Daytime: back to the sea.
func _daytime() -> bool:
var h: float = world.day_night.hours()
return h >= 6.5 and h < 17.5
## Which way the sea is: straight out from the middle of the bay.
func _seaward() -> Vector3:
var a := deg_to_rad(float(terrain.beach_angle_deg))
return Vector3(cos(a), 0.0, sin(a))
func _think(dt: float) -> void:
if state != "home" and state != "flee" and _daytime():
state = "home"
_state_t = HOME_FOR
var pp: Vector3 = player.global_position
var d := global_position.distance_to(pp)
match state:
"home":
var to := _seaward()
steer(atan2(-to.x, -to.z))
_state_t -= dt
if _state_t <= 0.0 or global_position.y < terrain.water_level - 0.25:
queue_free() # (into the waves)
return
"idle", "wander":
if d < NIP:
state = "charge"
_aggro = def.aggro
_attack_cd = 0.5 # (a moment to see it coming)
return
"charge":
if d < NIP_GIVE_UP:
_aggro = def.aggro # (it keeps on at you while you're close)
else:
_aggro = 0.0
super._think(dt)
func _desired_speed() -> float:
if state == "home":
return def.walk * 1.6
return super._desired_speed()
## Keeps to the sand (and out of the water) until it's going home.
func _blocked(dir: Vector3) -> bool:
var probe := global_position + dir * (0.8 + speed * 0.15)
if not terrain.inside_boundary(probe.x, probe.z, 4.0):
return true
if state == "home":
return false # (straight down the beach and into the sea)
if not terrain.on_sand(probe.x, probe.z):
return true
return super._blocked(dir)
## Hit: it fights back while it can, then runs.
func _react(from: Vector3) -> void:
if hp > def.hp * 0.35:
state = "charge"
_aggro = def.aggro
_attack_cd = 0.3
else:
_start_flee(from)
_state_t = 5.0
## Sideways, legs a-flicker; the claws come up when it's after you.
func _animate(dt: float) -> void:
_visual.rotation.y = PI * 0.5 # (it walks sideways)
if is_dead():
return
var k := clampf(speed / maxf(def.run, 0.01), 0.0, 1.0)
_phase += dt * (6.0 + speed * 14.0)
for i in range(_legs.size()):
var l: Node3D = _legs[i]
var s := -1.0 if l.position.x < 0.0 else 1.0
l.rotation.z = s * (1.0 + sin(_phase + i * 1.9) * (0.08 + 0.3 * k))
l.rotation.x = cos(_phase + i * 1.9) * 0.25 * k
var up := 0.12 if state == "charge" or (puppet and speed > 1.5) else 0.0
_visual.rotation.x = lerpf(_visual.rotation.x, -up, minf(dt * 6.0, 1.0))
_visual.position.y = absf(sin(_phase * 0.5)) * 0.01 * k
## A crab doesn't topple onto its side: it ends up on its back.
func _die(_from: Vector3) -> void:
state = "dead"
speed = 0.0
hp = 0.0
_flash = 0.0
_set_material(_mat)
remove_from_group("creature")
add_to_group("carcass")
collision_layer = 2
_visual.rotation = Vector3(0.0, PI * 0.5, PI)
_visual.position.y = 0.1
if not puppet:
died.emit(self)

View File

@@ -0,0 +1 @@
uid://kqumi2x6lfai

View File

@@ -54,12 +54,28 @@ const KINDS := {
"fox": {"name": "Fox", "hp": 25.0, "walk": 1.5, "run": 7.6, "turn": 7.0,
"notice": 0.0, "notice_loud": 0.0, "calm": 30.0,
"drops": {"raw_meat": [1, 1], "hide": [1, 1]}},
# 0.6.0, the Cove only: crabs come up the beach at dusk and pinch anyone
# who walks too close (crab.gd, shore.gd); gulls are the Cove's crows,
# after food left on the sand and fish on a smoking rack (gull.gd).
"crab": {"name": "Crab", "hp": 14.0, "walk": 0.9, "run": 2.6, "turn": 7.0,
"notice": 0.0, "notice_loud": 0.0, "calm": 20.0,
"damage": 5.0, "attack_range": 1.7, "attack_cd": 1.3, "aggro": 5.0,
"drops": {"crab_meat": [1, 2]}},
"gull": {"name": "Gull", "hp": 8.0, "walk": 1.0, "run": 11.0, "turn": 8.0,
"notice": 0.0, "notice_loud": 0.0, "calm": 30.0,
"drops": {"feather": [1, 3]}},
# The barrow's skeletal guards (guard.gd, barrow.gd). Slow (you can walk
# away from one) but they hit hard; bone, so blunt weapons do +50%.
"guard": {"name": "Barrow Guard", "hp": 80.0, "walk": 1.4, "run": 3.4, "turn": 4.0,
"notice": 0.0, "notice_loud": 0.0, "calm": 30.0,
"damage": 20.0, "attack_range": 2.0, "attack_cd": 2.0, "bone": true,
"drops": {"iron_nugget": [1, 2]}},
# 0.6.0: the drowned crew (guard.gd, at a treasure dig: treasure.gd). The
# Cove's barrow guards: slow, hard-hitting, unafraid of fire.
"drowned": {"name": "Drowned Sailor", "hp": 70.0, "walk": 1.3, "run": 3.1, "turn": 4.0,
"notice": 0.0, "notice_loud": 0.0, "calm": 30.0,
"damage": 16.0, "attack_range": 2.0, "attack_cd": 1.8, "bone": true,
"drops": {"salt": [0, 1]}},
# P5: the Old Stag (old_stag.gd), called by the standing stones, and the
# spirit wolves it summons (they just run at you: the base "charge").
"old_stag": {"name": "Old Stag", "hp": 900.0, "walk": 2.0, "run": 13.0, "turn": 3.0,
@@ -76,6 +92,13 @@ const KINDS := {
"drops": {"raw_meat": [5, 7], "bear_hide": [1, 1], "bear_fat": [2, 3]}},
}
const CARCASS_SECONDS := 300.0
## The steepest ground an animal walks up: 35 degrees (the ground's normal
## at least this upright). The player's limit is about 45.
const MAX_CLIMB_NY := 0.82
const MAX_CLIMB_RISE := 0.7 ## (tan 35 degrees: metres up per metre along)
## A carcass on ground steeper than this slides down to where it's flatter,
## so it can be reached and butchered (Gitea #6).
const CARCASS_REST_NY := 0.8
var kind := "deer"
var def: Dictionary
@@ -140,7 +163,7 @@ func setup(k: String, w: Node3D, pos: Vector3, seed: int) -> void:
var eyes := MeshInstance3D.new()
eyes.mesh = parts.eyes
var em := StandardMaterial3D.new()
var eye: Color = {"alpha": Color(1.0, 0.18, 0.1), "guard": Color(0.45, 0.8, 1.0), "old_stag": Color(0.55, 0.95, 1.0),
var eye: Color = {"alpha": Color(1.0, 0.18, 0.1), "guard": Color(0.45, 0.8, 1.0), "drowned": Color(0.5, 1.0, 0.6), "old_stag": Color(0.55, 0.95, 1.0),
"spirit_wolf": Color(0.55, 0.95, 1.0)}.get(k, Color(1.0, 0.75, 0.3))
em.albedo_color = eye.lerp(Color.WHITE, 0.2)
em.emission_enabled = true
@@ -164,9 +187,9 @@ func setup(k: String, w: Node3D, pos: Vector3, seed: int) -> void:
cap.height = maxf(parts.height, parts.radius * 2.0 + 0.01)
cs.shape = cap
cs.position = Vector3(0, parts.height * 0.5, 0)
if k != "rabbit" and k != "guard": # (rabbits are round, guards stand upright)
if not k in ["rabbit", "guard", "drowned"]: # (rabbits are round, guards stand upright)
# Long bodies: lay the capsule along the spine.
cap.height = {"deer": 1.5, "boar": 1.4, "wolf": 1.25, "alpha": 1.65, "bear": 2.0, "fox": 0.8, "crow": 0.3, "old_stag": 3.3, "spirit_wolf": 1.25}.get(k, 1.4)
cap.height = {"deer": 1.5, "boar": 1.4, "wolf": 1.25, "alpha": 1.65, "bear": 2.0, "fox": 0.8, "crow": 0.3, "gull": 0.4, "crab": 0.45, "old_stag": 3.3, "spirit_wolf": 1.25}.get(k, 1.4)
cs.rotation.x = PI * 0.5
cs.position = Vector3(0, parts.height * 0.55, 0)
add_child(cs)
@@ -368,6 +391,18 @@ func _blocked(dir: Vector3) -> bool:
return true
if absf(h - global_position.y) > 1.1:
return true
# Nothing climbs steep ground, or walks along it (the mountain rim: Gitea
# #6). Going down it is fine, so one that's somehow up there can always
# come back.
if h > global_position.y - 0.3:
var run := Vector2(probe.x - global_position.x, probe.z - global_position.z).length()
if (h - global_position.y) > run * MAX_CLIMB_RISE:
return true
# The slope along the way: just ahead, halfway, and at the probe.
for f in [0.2, 0.5, 1.0]:
var s: Vector3 = global_position.lerp(probe, f)
if terrain.sample_normal(s.x, s.z).y < MAX_CLIMB_NY and terrain.sample_height(s.x, s.z) > global_position.y - 0.3 * f:
return true
# Trees, rocks and buildings at chest height (the terrain isn't on this test).
var from := global_position + Vector3(0, 0.45, 0)
var q := PhysicsRayQueryParameters3D.create(from, Vector3(probe.x, h + 0.45, probe.z), 1)
@@ -452,6 +487,7 @@ func _die(from: Vector3) -> void:
if puppet:
_visual.rotation.z = -PI * 0.5
return
_settle()
# Topple onto its side, away from the blow.
var side := 1.0 if (global_position - from).dot(global_basis.x) > 0.0 else -1.0
if is_inside_tree() and DisplayServer.get_name() != "headless":
@@ -461,6 +497,28 @@ func _die(from: Vector3) -> void:
_visual.rotation.z = -side * PI * 0.5
died.emit(self)
## A carcass on steep ground (half into a cliff face, out of reach) slides
## downhill, half a metre at a time, until the ground's flatter: up to 20 m,
## and never out past the edge of the play area. Online the server does this
## and players see it where it ends up.
func _settle() -> void:
if terrain == null:
return
var p := global_position
for _i in range(40):
var n: Vector3 = terrain.sample_normal(p.x, p.z)
if n.y >= CARCASS_REST_NY:
break
var down := Vector3(n.x, 0.0, n.z) # (a slope's normal leans downhill)
if down.length() < 0.001:
break
var q := p + down.normalized() * 0.5
if not terrain.inside_boundary(q.x, q.z, 1.0):
break
p = Vector3(q.x, terrain.sample_height(q.x, q.z), q.z)
if p.distance_to(global_position) > 0.01:
global_position = p
## What butchering gives (rolled once).
func butcher_drops() -> Dictionary:
var out := {}
@@ -516,8 +574,11 @@ const VOICES := {
"boar": {"alert": "boar_grunt", "angry": "boar_grunt", "attack": "boar_grunt", "hurt": "boar_squeal", "idle": "boar_grunt"},
"old_stag": {"alert": "stag_bellow", "angry": "stag_bellow", "attack": "stag_snort", "hurt": "stag_snort"},
"guard": {"alert": "guard_rattle", "angry": "guard_rattle", "attack": "guard_rattle"},
"drowned": {"alert": "guard_rattle", "angry": "guard_rattle", "attack": "guard_rattle"},
"crow": {"alert": "crow_caw", "hurt": "crow_caw", "idle": "crow_caw"},
"fox": {"alert": "fox_yip", "hurt": "fox_yip"},
"gull": {"alert": "gull_cry", "hurt": "gull_cry", "idle": "gull_cry"},
"crab": {"alert": "crab_click", "attack": "crab_click"},
}
## States a creature is in when it's after someone (music.gd's list too).
const ANGRY := ["charge", "stalk", "lunge", "bash", "stomp", "telegraph", "warn", "raid", "summon"]

View File

@@ -22,7 +22,10 @@ static func build(kind: String) -> Dictionary:
"bear": d = _bear()
"fox": d = _scaled(_wolf_parts(Color(0.78, 0.4, 0.15), Color(0.92, 0.88, 0.8), 281), 0.6)
"crow": d = _crow()
"gull": d = _gull()
"crab": d = _crab()
"guard": d = _guard()
"drowned": d = _drowned()
"old_stag": d = _scaled(_stag(), 2.1)
"spirit_wolf": d = _wolf_parts(Color(0.62, 0.72, 0.78), Color(0.85, 0.92, 0.95), 351)
_: d = _boar()
@@ -207,6 +210,61 @@ static func _crow() -> Dictionary:
"hips": [Vector3(-0.06, 0.19, -0.01), Vector3(0.06, 0.19, -0.01)],
"radius": 0.12, "height": 0.3}
## Gull: a crow's build, bigger, white with grey wings and a yellow beak.
static func _gull() -> Dictionary:
var white := Color(0.93, 0.93, 0.9)
var grey := Color(0.6, 0.63, 0.67)
var tip := Color(0.12, 0.12, 0.13)
var beak := Color(0.95, 0.75, 0.2)
var st := P._begin()
var r := _rng(295)
var n := _noise(295, 2.0)
P._blob(st, Vector3(0, 0.2, 0), Vector3(0.09, 0.085, 0.18), n, 0.08, white, r, 1)
P._blob(st, Vector3(0, 0.25, 0.04), Vector3(0.075, 0.05, 0.14), n, 0.06, grey, r, 1)
P._blob(st, Vector3(0, 0.28, -0.16), Vector3(0.06, 0.06, 0.065), n, 0.08, white, r, 1)
P._cylinder(st, Vector3(0, 0.275, -0.21), Vector3(0, 0.255, -0.3), 0.017, 0.004, 4, beak, r)
P._cylinder(st, Vector3(0, 0.22, 0.15), Vector3(0, 0.2, 0.3), 0.035, 0.05, 4, tip, r)
for s in [-1.0, 1.0]:
P._cylinder(st, Vector3(s * 0.03, 0.13, 0.0), Vector3(s * 0.035, 0.0, 0.02), 0.008, 0.007, 3, beak, r)
P._blob(st, Vector3(s * 0.04, 0.295, -0.19), Vector3.ONE * 0.009, n, 0.0, Color(0.1, 0.1, 0.1), r, 0)
var wst := P._begin()
P._blob(wst, Vector3(0, -0.2, 0.03), Vector3(0.014, 0.21, 0.09), n, 0.04, grey, r, 0)
P._blob(wst, Vector3(0, -0.38, 0.05), Vector3(0.012, 0.05, 0.06), n, 0.0, tip, r, 0)
return {"body": P._commit(st), "leg": P._commit(wst),
"hips": [Vector3(-0.08, 0.25, -0.01), Vector3(0.08, 0.25, -0.01)],
"radius": 0.15, "height": 0.38}
## Crab: a wide, flat red-brown shell facing -Z, two big claws in front and
## eyes on stalks; six thin legs splayed out to the sides (crab.gd turns the
## whole crab side-on to walk, and flickers the legs).
static func _crab() -> Dictionary:
var shell := Color(0.66, 0.22, 0.12)
var dark := Color(0.42, 0.13, 0.08)
var pale := Color(0.9, 0.72, 0.55)
var st := P._begin()
var r := _rng(297)
var n := _noise(297, 2.4)
P._blob(st, Vector3(0, 0.11, 0), Vector3(0.2, 0.06, 0.14), n, 0.1, shell, r, 1)
P._blob(st, Vector3(0, 0.08, 0.01), Vector3(0.17, 0.035, 0.12), n, 0.05, pale, r, 1)
for s in [-1.0, 1.0]:
# Arm, then the claw: a fat pincer and a thin finger.
P._cylinder(st, Vector3(s * 0.12, 0.1, -0.09), Vector3(s * 0.17, 0.13, -0.2), 0.025, 0.02, 4, shell, r)
P._blob(st, Vector3(s * 0.17, 0.14, -0.26), Vector3(0.05, 0.04, 0.07), n, 0.1, shell, r, 1)
P._cylinder(st, Vector3(s * 0.17, 0.15, -0.31), Vector3(s * 0.15, 0.16, -0.37), 0.02, 0.006, 4, dark, r)
P._cylinder(st, Vector3(s * 0.19, 0.12, -0.31), Vector3(s * 0.18, 0.12, -0.36), 0.014, 0.004, 4, dark, r)
# Eyes on stalks.
P._cylinder(st, Vector3(s * 0.04, 0.15, -0.11), Vector3(s * 0.05, 0.21, -0.13), 0.008, 0.006, 3, shell, r)
P._blob(st, Vector3(s * 0.05, 0.22, -0.13), Vector3.ONE * 0.014, n, 0.0, Color(0.05, 0.05, 0.05), r, 0)
var lst := P._begin()
P._cylinder(lst, Vector3(0, 0, 0), Vector3(0, -0.11, 0.0), 0.014, 0.01, 3, shell, r)
P._cylinder(lst, Vector3(0, -0.11, 0.0), Vector3(0, -0.2, 0.0), 0.01, 0.003, 3, dark, r)
var hips: Array = []
for s in [-1.0, 1.0]:
for z in [-0.05, 0.03, 0.1]:
hips.append(Vector3(s * 0.17, 0.1, z))
return {"body": P._commit(st), "leg": P._commit(lst), "hips": hips,
"radius": 0.2, "height": 0.25}
## Barrow guard: an upright skeleton facing -Z, in a rusted helm, an old
## sword in its right hand and a round shield on its left arm. Two legs
## (creature.gd walks them like a pair of a quadruped's).
@@ -253,6 +311,53 @@ static func _guard() -> Dictionary:
"hips": [Vector3(-0.1, 0.93, 0), Vector3(0.1, 0.93, 0)],
"radius": 0.3, "height": 1.85}
## A drowned sailor (0.6.0): the barrow guard's bones, sea-greyed and hung
## with weed, a rag of a shirt, a bandana, and a cutlass; no shield or helm.
static func _drowned() -> Dictionary:
var bone := Color(0.62, 0.66, 0.58)
var old := Color(0.44, 0.5, 0.42)
var weed := Color(0.16, 0.32, 0.18)
var rag := Color(0.36, 0.33, 0.27)
var red := Color(0.45, 0.12, 0.1)
var steel := Color(0.5, 0.52, 0.55)
var dark := Color(0.05, 0.07, 0.06)
var st := P._begin()
var r := _rng(331)
var n := _noise(331, 2.2)
P._blob(st, Vector3(0, 0.95, 0), Vector3(0.17, 0.07, 0.1), n, 0.2, old, r, 0) # pelvis
P._cylinder(st, Vector3(0, 0.97, 0.02), Vector3(0, 1.45, 0.0), 0.035, 0.03, 5, bone, r) # spine
for i in range(4): # ribs
var y := 1.18 + 0.075 * i
P._cylinder(st, Vector3(-0.15 + 0.01 * i, y, -0.02), Vector3(0.15 - 0.01 * i, y, -0.02), 0.018, 0.018, 4, bone, r)
P._blob(st, Vector3(0.02, 1.3, 0.0), Vector3(0.19, 0.17, 0.12), n, 0.45, rag, r, 0) # shirt, in tatters
P._cylinder(st, Vector3(-0.22, 1.47, 0), Vector3(0.22, 1.47, 0), 0.025, 0.025, 4, bone, r) # shoulders
P._blob(st, Vector3(0, 1.66, -0.02), Vector3(0.11, 0.13, 0.12), n, 0.12, bone, r, 1) # skull
P._blob(st, Vector3(0, 1.56, -0.08), Vector3(0.07, 0.04, 0.06), n, 0.1, old, r, 0) # jaw
P._blob(st, Vector3(0, 1.75, 0.0), Vector3(0.12, 0.05, 0.13), n, 0.15, red, r, 0) # bandana
for s in [-1.0, 1.0]:
P._blob(st, Vector3(s * 0.045, 1.67, -0.115), Vector3(0.03, 0.025, 0.012), n, 0.0, dark, r, 0) # sockets
for i in range(5): # weed hanging off
var x := -0.16 + i * 0.08
P._cylinder(st, Vector3(x, 1.45, -0.04), Vector3(x + 0.02, 1.05 - 0.05 * (i % 2), -0.06), 0.012, 0.004, 3, weed, r)
# Right arm forward with the cutlass, left hanging.
P._cylinder(st, Vector3(0.22, 1.47, 0), Vector3(0.28, 1.2, -0.12), 0.025, 0.022, 4, bone, r)
P._cylinder(st, Vector3(0.28, 1.2, -0.12), Vector3(0.27, 1.08, -0.38), 0.022, 0.02, 4, bone, r)
P._cylinder(st, Vector3(0.27, 1.08, -0.4), Vector3(0.33, 1.42, -0.85), 0.035, 0.008, 4, steel, r) # curved blade
P._cylinder(st, Vector3(0.21, 1.06, -0.38), Vector3(0.33, 1.1, -0.4), 0.02, 0.02, 4, steel, r) # guard
P._cylinder(st, Vector3(-0.22, 1.47, 0), Vector3(-0.27, 1.15, 0.02), 0.025, 0.022, 4, bone, r)
P._cylinder(st, Vector3(-0.27, 1.15, 0.02), Vector3(-0.26, 0.9, -0.02), 0.022, 0.02, 4, bone, r)
var est := P._begin()
for s in [-1.0, 1.0]:
P._blob(est, Vector3(s * 0.045, 1.67, -0.125), Vector3.ONE * 0.012, n, 0.0, Color(0.5, 1.0, 0.6), r, 0)
var lst := P._begin()
P._cylinder(lst, Vector3(0, 0, 0), Vector3(0, -0.45, 0.02), 0.03, 0.025, 4, bone, r)
P._cylinder(lst, Vector3(0, -0.45, 0.02), Vector3(0, -0.9, 0), 0.025, 0.022, 4, bone, r)
P._blob(lst, Vector3(0, -0.2, 0), Vector3(0.07, 0.18, 0.07), n, 0.4, rag, r, 0) # breeches
P._blob(lst, Vector3(0, -0.9, -0.05), Vector3(0.04, 0.025, 0.08), n, 0.1, old, r, 0)
return {"body": P._commit(st), "eyes": P._commit(est), "leg": P._commit(lst),
"hips": [Vector3(-0.1, 0.93, 0), Vector3(0.1, 0.93, 0)],
"radius": 0.3, "height": 1.85}
## The Old Stag (before scaling up): a pale, moss-hung spirit deer with a
## huge crown of antlers.
static func _stag() -> Dictionary:

View File

@@ -18,11 +18,12 @@ func display_name() -> String:
func interact_prompt(p: Node) -> String:
if is_dead():
return "Bones [E] Search"
var s := "Barrow guard"
# (A barrow guard, or a drowned sailor at a treasure dig: treasure.gd.)
var s: String = def.name
match state:
"rest": s = "Barrow guard (still... for now)"
"charge": s = "Barrow guard (coming for you!)"
"home": s = "Barrow guard (going back to its post)"
"rest": s += " (still... for now)"
"charge": s += " (coming for you!)"
"home": s += " (going back to its post)"
if not Actions.melee_stats(p).armed and not ItemDB.get_item(p.held_item_id()).has("bow"):
s += " (you need a weapon: a club cracks bone)"
return s
@@ -46,7 +47,7 @@ func _think(dt: float) -> void:
_goal_d = d
if d < def.attack_range and _attack_cd <= 0.0 and _can_reach(player):
_attack_cd = def.attack_cd
player.survival.damage(def.damage * world.difficulty_mult("damage"), global_position, "a barrow guard")
player.survival.damage(def.damage * world.difficulty_mult("damage"), global_position, "a %s" % String(def.name).to_lower())
"home":
if barrow.wakes_for(player) and barrow.center().distance_to(pp) < barrow.LEASH:
state = "charge"

56
scripts/creatures/gull.gd Normal file
View File

@@ -0,0 +1,56 @@
extends "res://scripts/creatures/crow.gd"
## A gull (0.6.0, the Cove only): the Cove's crow, sent by thieves.gd by
## day. It comes for food left on the sand and for fish on a smoking rack
## that nobody's watching. Bolder and quicker than a crow: it lands, snatches
## one and is off with it, and another soon follows. Shoot it down while
## it's carrying and it drops what it took. Feathers.
const SNATCH_AFTER := 1.2 ## seconds on the ground before it grabs one
const GULL_SCARE := 6.0 ## (bolder than a crow)
var carry: Dictionary = {} ## {id, count, extra} once it has something
func display_name() -> String:
return "Gull"
func interact_prompt(_p: Node) -> String:
if is_dead():
return "Gull [E] Pluck"
if not carry.is_empty():
return "Gull (off with your %s!)" % ItemDB.item_name(String(carry.id)).to_lower()
return {"peck": "Gull (after your food!)", "fly": "Gull (circling your food)"}.get(state, "Gull")
func _think(dt: float) -> void:
match state:
"fly":
if not thieves.gull_still_there(food) or thieves.watched(thieves.spot(food), GULL_SCARE):
_leave()
return
_goal = thieves.spot(food)
var ground: float = terrain.sample_height(global_position.x, global_position.z)
if Vector2(_goal.x - global_position.x, _goal.z - global_position.z).length() < 0.35 and global_position.y - ground < 0.15:
state = "peck"
_state_t = SNATCH_AFTER
thieves.gull_landed(self, food)
"peck":
if not thieves.gull_still_there(food) or thieves.watched(global_position, GULL_SCARE):
_leave()
return
_state_t -= dt
if _state_t <= 0.0:
_peck_anim = 0.4
carry = thieves.snatch(self, food)
_leave()
"fly_off":
if thieves.out_of_sight(global_position):
thieves.gone(self)
_:
_leave()
## Shot down with something in its beak: it drops it where it falls.
func _die(from: Vector3) -> void:
super._die(from)
if not carry.is_empty() and not puppet:
var at := global_position + Vector3(0, 0.3, 0)
world.drop_item(String(carry.id), int(carry.count), Transform3D(Basis(), at), carry.get("extra", {}))
carry = {}

View File

@@ -0,0 +1 @@
uid://draw1wvqi3cif

106
scripts/creatures/shore.gd Normal file
View File

@@ -0,0 +1,106 @@
extends Node3D
## The shore's own wildlife (0.6.0, a land whose worldlet lists "crabs" in
## its "wildlife": the Cove). From dusk till dawn crabs come up out of the
## sea onto the beach, a few around each player who's down on the sand, at
## the waterline and out of the way. At dawn they go back in (crab.gd).
## Not saved: like the other wildlife they simply carry on around you.
##
## On a server this runs for everyone, and players see the crabs through
## creature_net.gd.
const CrabScript = preload("res://scripts/creatures/crab.gd")
const BUDGET := 5 ## per player on the beach, up to twice it
const CHECK_EVERY := 2.0
const RING_MIN := 14.0
const RING_MAX := 45.0
const NOT_WITHIN := 10.0 ## never comes up right beside anyone
const DESPAWN := 80.0
const BEACH_NEAR := 40.0 ## a player this close to the sand counts as on the beach
var world: Node3D
var terrain: Node3D
var enabled := true
var _rng := RandomNumberGenerator.new()
var _acc := 0.0
var _serial := 0
func setup(w: Node3D) -> void:
world = w
terrain = w.terrain
_rng.seed = terrain.noise_seed + 1201
func _physics_process(delta: float) -> void:
step(delta)
## Dusk till dawn.
func night() -> bool:
var h: float = world.day_night.hours()
return h >= 17.5 or h < 6.5
## Living crabs.
func alive() -> Array:
return get_children().filter(func(c): return is_instance_valid(c) and not c.is_queued_for_deletion() and not c.is_dead())
func step(dt: float) -> void:
if not enabled or world.creatures == null or not world.creatures.enabled:
return
_acc += dt
if _acc < CHECK_EVERY:
return
_acc = 0.0
var everyone: Array = world.players()
for c in get_children():
if not everyone.any(func(p): return p.global_position.distance_to(c.global_position) <= DESPAWN):
c.queue_free()
if not night() or everyone.is_empty():
return
var on_beach := everyone.filter(func(p): return _near_sand(p.global_position))
if on_beach.is_empty():
return
if alive().size() < BUDGET * clampi(on_beach.size(), 1, 2):
var who: Node3D = on_beach[_rng.randi() % on_beach.size()]
spawn_near(who.global_position) # (one at a time: they trickle up out of the sea)
func _near_sand(p: Vector3) -> bool:
for a in [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]:
var q := p + Vector3(cos(a), 0.0, sin(a)) * BEACH_NEAR * 0.5
if terrain.on_sand(p.x, p.z) or terrain.on_sand(q.x, q.z):
return true
return false
## A spot on the sand at the waterline, RING_MIN..RING_MAX from `around`
## and not right beside anyone, or Vector3.INF.
func find_spot(around: Vector3) -> Vector3:
for _try in range(40):
var a := _rng.randf() * TAU
var r := _rng.randf_range(RING_MIN, RING_MAX)
var x := around.x + cos(a) * r
var z := around.z + sin(a) * r
if not terrain.inside_boundary(x, z, 6.0) or terrain.beach_weight(x, z) < 0.75:
continue
var h: float = terrain.sample_height(x, z)
if h < terrain.water_level + 0.25 or h > terrain.water_level + 0.9:
continue
var p := Vector3(x, h, z)
if world.players().any(func(pl): return pl.global_position.distance_to(p) < NOT_WITHIN):
continue
return p
return Vector3.INF
func spawn_near(around: Vector3) -> Node3D:
var p := find_spot(around)
if p == Vector3.INF:
return null
return spawn(p)
func spawn(pos: Vector3) -> Node3D:
var c: AnimatableBody3D = CrabScript.new()
_serial += 1
c.setup("crab", world, pos, _rng.randi() + _serial)
add_child(c)
c.global_position = Vector3(pos.x, terrain.sample_height(pos.x, pos.z), pos.z)
c.state = "wander"
c.yaw = _rng.randf() * TAU
c.target_yaw = c.yaw
return c

View File

@@ -0,0 +1 @@
uid://b6eeco4cs028q

View File

@@ -9,10 +9,16 @@ extends Node3D
## fox.gd). Food in a chest is never touched (that's what chests are for);
## the bear (bear_range.gd) is another matter.
##
## In a land with gulls (the Cove, 0.6.0: its worldlet's "wildlife"), food
## left on the sand draws a gull by day instead of a crow (gull.gd), and so
## does fish on a smoking rack that nobody's watching: a gull snatches one
## and flies off with it.
##
## On a server this runs for everyone (thieves are wildlife: creature_net.gd).
const CrowScript = preload("res://scripts/creatures/crow.gd")
const FoxScript = preload("res://scripts/creatures/fox.gd")
const GullScript = preload("res://scripts/creatures/gull.gd")
const CHECK_EVERY := 5.0
const UNWATCHED := 10.0
@@ -25,6 +31,7 @@ signal stolen(thief: Node, id: String, count: int)
var world: Node3D
var enabled := true
var gulls := false ## this land has gulls (the Cove)
var _acc := 0.0
var _unwatched: Dictionary = {} ## pickup instance id -> seconds left alone
var _rng := RandomNumberGenerator.new()
@@ -32,6 +39,7 @@ var _rng := RandomNumberGenerator.new()
func setup(w: Node3D) -> void:
world = w
_rng.seed = w.terrain.noise_seed + 997
gulls = w.has_wildlife("gulls")
func _physics_process(delta: float) -> void:
if enabled:
@@ -85,14 +93,28 @@ func step(dt: float) -> void:
_unwatched[k] = float(_unwatched.get(k, 0.0)) + since
if float(_unwatched[k]) >= NOTICE_AFTER and not _targeted(d) and alive().size() < MAX_THIEVES:
send(d)
if gulls and not night():
for r in racks():
if not gull_still_there(r):
continue
var k: int = r.get_instance_id()
seen[k] = true
if watched(r.global_position, UNWATCHED):
_unwatched.erase(k)
continue
_unwatched[k] = float(_unwatched.get(k, 0.0)) + since
if float(_unwatched[k]) >= NOTICE_AFTER and not _targeted(r) and alive().size() < MAX_THIEVES:
send(r)
for k in _unwatched.keys():
if not seen.has(k):
_unwatched.erase(k)
## Sends a thief after `food`: a fox at dusk and night, otherwise a crow.
## Sends a thief after `food`: a fox at dusk and night, otherwise a crow (a
## gull on the sand, or at a smoking rack, where there are gulls).
func send(food: Node3D) -> Node3D:
var fox := night()
var fp: Vector3 = food.global_position
var gull := not fox and gulls and (food.is_in_group("processor") or on_sand(food.global_position))
var fp: Vector3 = spot(food)
var from := Vector3.INF
for _i in range(12):
var a := _rng.randf() * TAU
@@ -104,8 +126,8 @@ func send(food: Node3D) -> Node3D:
break
if from == Vector3.INF:
return null
var t: AnimatableBody3D = (FoxScript if fox else CrowScript).new()
t.setup("fox" if fox else "crow", world, from, _rng.randi())
var t: AnimatableBody3D = (FoxScript if fox else (GullScript if gull else CrowScript)).new()
t.setup("fox" if fox else ("gull" if gull else "crow"), world, from, _rng.randi())
t.thieves = self
t.food = food
t.state = "sneak" if fox else "fly"
@@ -148,3 +170,63 @@ func grab(fox: Node, food: Node3D) -> Dictionary:
## A thief left with what it took (or empty-handed).
func gone(t: Node) -> void:
t.queue_free()
# --- gulls (the Cove) ----------------------------------------------------------------
func on_sand(pos: Vector3) -> bool:
return world.terrain.on_sand(pos.x, pos.z)
static func is_fish(id: String) -> bool:
return Dictionary(ItemDB.get_item(id).get("food", {})).get("diet", {}).has("fish")
## This land's smoking racks.
func racks() -> Array:
return get_tree().get_nodes_in_group("processor").filter(func(r): return is_instance_valid(r) and not r.is_queued_for_deletion() \
and String(r.item_id) == "smoking_rack" and world.is_ancestor_of(r))
## Fish on a rack: the first id there is, or "".
func _rack_fish(r: Node3D) -> String:
for st in r.inventory.slots:
if st != null and is_fish(String(st.id)):
return String(st.id)
return ""
## Whether a gull's target is still worth it: food on the ground, or a rack
## with fish on it.
func gull_still_there(t: Node3D) -> bool:
if t == null or not is_instance_valid(t) or t.is_queued_for_deletion():
return false
if t.is_in_group("processor"):
return not _rack_fish(t).is_empty()
return still_there(t)
## Where a thief lands for `t`: on food, or on the ground beside a rack.
func spot(t: Node3D) -> Vector3:
if t.is_in_group("processor"):
var p: Vector3 = t.global_position + t.global_basis.z * 0.8
return Vector3(p.x, world.terrain.sample_height(p.x, p.z), p.z)
return t.global_position
func gull_landed(_gull: Node, t: Node3D) -> void:
if t.is_in_group("processor"):
_tell(t.global_position, "A gull's at the fish on your smoking rack!")
else:
_tell(t.global_position, "A gull's landed by your %s!" % ItemDB.item_name(t.item_id).to_lower())
## A gull takes one and flies off with it. Returns what it's carrying.
func snatch(gull: Node, t: Node3D) -> Dictionary:
if not gull_still_there(t):
return {}
var c := {}
if t.is_in_group("processor"):
var id := _rack_fish(t)
t.inventory.remove(id, 1)
c = {"id": id, "count": 1, "extra": {}}
else:
c = {"id": String(t.item_id), "count": 1, "extra": t.extra.duplicate()}
t.amount = int(t.amount) - 1
if int(t.amount) <= 0:
world.take_dropped(t)
_tell(t.global_position, "A gull has snatched your %s!" % ItemDB.item_name(String(c.id)).to_lower())
stolen.emit(gull, String(c.id), 1)
return c

View File

@@ -36,6 +36,17 @@ static func build(key: String) -> ArrayMesh:
var m: ArrayMesh
match key:
"stick": m = _stick()
"driftwood": m = _driftwood()
"seagrass": m = _seagrass()
"rope": m = _rope()
"pine_resin": m = _pine_resin()
"pitch": m = _pitch()
"rowing_boat": m = _rowing_boat()
"treasure_map": m = _treasure_map()
"ship_compass": m = _ship_compass()
"spyglass": m = _spyglass()
"pirate_gold": m = _pirate_gold()
"cutlass": m = _cutlass()
"stone": m = _pebble(11, STONE, Vector3(0.14, 0.10, 0.12))
"flint": m = _pebble(23, FLINT, Vector3(0.12, 0.07, 0.15), 0.5)
"wood": m = _wood()
@@ -58,6 +69,9 @@ static func build(key: String) -> ArrayMesh:
"wood_door_panel": m = _door_panel()
"wood_roof": m = _roof()
"wood_gable": m = _gable()
"wood_half_wall": m = _half_wall()
"wood_roof_ridge": m = _roof_ridge()
"wood_ridge_gable": m = _ridge_gable()
"bed": m = _bed()
"raw_meat": m = _meat(MEAT_RAW)
"cooked_meat": m = _meat(MEAT_COOKED)
@@ -78,6 +92,8 @@ static func build(key: String) -> ArrayMesh:
"mackerel": m = _fish(MACKEREL, 0.2, false)
"cod": m = _fish(COD, 0.3, false)
"grilled_mackerel": m = _fish(MACKEREL, 0.2, true)
"crab_meat": m = _crab_meat()
"cooked_crab": m = _cooked_crab()
"grilled_cod": m = _fish(COD, 0.3, true)
"fiber_plant": m = _fiber_plant()
"iron_nugget": m = _pebble(61, RUST, Vector3(0.07, 0.05, 0.06), 0.6)
@@ -184,6 +200,147 @@ static func _stick() -> ArrayMesh:
P._cylinder(st, Vector3(0.05, 0.03, 0.0), Vector3(0.2, 0.05, 0.1), 0.012, 0.006, 4, HANDLE, r)
return P._commit(st)
## A sea-bleached branch, twisted, with a stub of a side branch.
static func _driftwood() -> ArrayMesh:
var st := P._begin()
var r := _rng(41)
const BLEACHED := Color(0.72, 0.68, 0.6)
const GREY := Color(0.58, 0.55, 0.5)
P._cylinder(st, Vector3(-0.5, 0.06, -0.04), Vector3(0.05, 0.08, 0.05), 0.07, 0.06, 6, BLEACHED, r, -1.0, GREY)
P._cylinder(st, Vector3(0.05, 0.08, 0.05), Vector3(0.48, 0.05, -0.02), 0.06, 0.035, 6, BLEACHED, r, -1.0, GREY)
P._cylinder(st, Vector3(0.1, 0.09, 0.05), Vector3(0.22, 0.12, 0.24), 0.03, 0.015, 5, GREY, r)
return P._commit(st)
## A tangle of long, flat ribbons of seagrass.
static func _seagrass() -> ArrayMesh:
var st := P._begin()
var r := _rng(45)
for i in range(6):
var a := r.randf() * TAU
var col := Color(0.28, 0.42, 0.2).lerp(Color(0.5, 0.48, 0.25), r.randf())
_box(st, Vector3(r.randf_range(-0.03, 0.03), 0.01 + i * 0.006, r.randf_range(-0.03, 0.03)), Vector3(0.03, 0.006, 0.38),
col, Basis(Vector3.UP, a))
return P._commit(st)
## A coil of seagrass rope.
static func _rope() -> ArrayMesh:
var st := P._begin()
var r := _rng(47)
const ROPE := Color(0.6, 0.55, 0.36)
var n := 12
for k in range(2):
for i in range(n):
var a0 := TAU * i / n
var a1 := TAU * (i + 1) / n
var rr := 0.1 - k * 0.035
P._cylinder(st, Vector3(cos(a0) * rr, 0.025 + k * 0.03, sin(a0) * rr), Vector3(cos(a1) * rr, 0.025 + k * 0.03, sin(a1) * rr),
0.02, 0.02, 5, ROPE.darkened(r.randf() * 0.12), r)
return P._commit(st)
## A few lumps of sticky amber resin.
static func _pine_resin() -> ArrayMesh:
var st := P._begin()
var r := _rng(49)
var n := FastNoiseLite.new()
n.seed = 49
n.frequency = 3.0
for i in range(4):
var c := Vector3(r.randf_range(-0.05, 0.05), 0.03, r.randf_range(-0.05, 0.05))
P._blob(st, c, Vector3.ONE * r.randf_range(0.025, 0.045), n, 0.25, Color(0.8, 0.5, 0.12).darkened(r.randf() * 0.25), r, 1)
return P._commit(st)
## A small clay pot of black pitch, a stick stood in it.
static func _pitch() -> ArrayMesh:
var st := P._begin()
var r := _rng(51)
P._cylinder(st, Vector3(0, 0, 0), Vector3(0, 0.12, 0), 0.07, 0.085, 8, Color(0.55, 0.36, 0.24), r, 0.0)
P._cylinder(st, Vector3(0, 0.115, 0), Vector3(0, 0.125, 0), 0.078, 0.078, 8, Color(0.06, 0.05, 0.05), r, -1.0, Color(0.06, 0.05, 0.05))
P._cylinder(st, Vector3(0.01, 0.06, 0.0), Vector3(0.05, 0.24, 0.02), 0.008, 0.007, 4, HANDLE, r)
return P._commit(st)
## A rowing boat, bow to -Z: a model 0.55 m long (moorings.gd shows it eight
## times over at the pier). Driftwood planks, pitch-black seams, two thwarts
## and a pair of oars.
static func _rowing_boat() -> ArrayMesh:
var st := P._begin()
var r := _rng(53)
const WOOD := Color(0.66, 0.6, 0.5)
const SEAM := Color(0.1, 0.08, 0.07)
const OAR := Color(0.55, 0.42, 0.28)
var hw := 0.085 # half the beam amidships
# Bottom: a wide plank aft, narrowing to the bow.
_box(st, Vector3(0, 0.01, 0.07), Vector3(hw * 1.7, 0.012, 0.36), WOOD)
_box(st, Vector3(0, 0.014, -0.16), Vector3(hw * 1.1, 0.012, 0.12), WOOD)
for side in [-1.0, 1.0]:
# Sides amidships and aft, two strakes with a dark seam between.
_box(st, Vector3(side * hw, 0.03, 0.06), Vector3(0.008, 0.03, 0.38), WOOD.darkened(0.05))
_box(st, Vector3(side * hw, 0.047, 0.06), Vector3(0.0085, 0.004, 0.38), SEAM)
_box(st, Vector3(side * hw, 0.062, 0.06), Vector3(0.008, 0.028, 0.38), WOOD)
# Bow: the sides swept in to meet at the stem.
var bow := Basis(Vector3.UP, side * 0.53)
_box(st, Vector3(side * hw * 0.5, 0.048, -0.193), Vector3(0.008, 0.07, 0.17), WOOD, bow)
_box(st, Vector3(0, 0.055, -0.265), Vector3(0.014, 0.085, 0.014), WOOD.darkened(0.15)) # stem
_box(st, Vector3(0, 0.045, 0.25), Vector3(hw * 2.0, 0.06, 0.008), WOOD.darkened(0.08)) # transom
for z in [-0.02, 0.15]:
_box(st, Vector3(0, 0.055, z), Vector3(hw * 2.0, 0.008, 0.035), WOOD.darkened(0.12)) # thwarts
for side in [-1.0, 1.0]:
P._cylinder(st, Vector3(side * 0.04, 0.07, 0.17), Vector3(side * 0.05, 0.075, -0.13), 0.004, 0.004, 4, OAR, r)
_box(st, Vector3(side * 0.05, 0.075, -0.15), Vector3(0.022, 0.003, 0.05), OAR)
return P._commit(st)
## A rolled-up, torn sheet of old parchment tied with string.
static func _treasure_map() -> ArrayMesh:
var st := P._begin()
var r := _rng(43)
const PARCH := Color(0.82, 0.74, 0.55)
P._cylinder(st, Vector3(-0.16, 0.04, 0), Vector3(0.16, 0.04, 0), 0.04, 0.04, 8, PARCH, r, -1.0, PARCH.darkened(0.15))
P._cylinder(st, Vector3(-0.01, 0.04, 0), Vector3(0.01, 0.04, 0), 0.043, 0.043, 8, Color(0.45, 0.12, 0.08), r)
return P._commit(st)
const BRASS := Color(0.78, 0.6, 0.25)
const GOLD := Color(0.95, 0.75, 0.2)
## A brass sea compass: a flat round case, a glass face, a red needle.
static func _ship_compass() -> ArrayMesh:
var st := P._begin()
var r := _rng(47)
P._cylinder(st, Vector3(0, 0.0, 0), Vector3(0, 0.05, 0), 0.11, 0.11, 12, BRASS, r, -1.0, BRASS)
P._cylinder(st, Vector3(0, 0.05, 0), Vector3(0, 0.056, 0), 0.095, 0.095, 12, Color(0.9, 0.88, 0.8), r, -1.0, Color(0.9, 0.88, 0.8))
P._cylinder(st, Vector3(0, 0.06, 0.07), Vector3(0, 0.06, -0.07), 0.012, 0.004, 4, Color(0.75, 0.1, 0.08), r)
return P._commit(st)
## A brass telescope, drawn out: three tubes, the big end forward.
static func _spyglass() -> ArrayMesh:
var st := P._begin()
var r := _rng(49)
P._cylinder(st, Vector3(0, 0.04, 0.22), Vector3(0, 0.04, 0.06), 0.03, 0.03, 8, BRASS, r, -1.0, BRASS)
P._cylinder(st, Vector3(0, 0.04, 0.06), Vector3(0, 0.04, -0.1), 0.036, 0.036, 8, Color(0.3, 0.2, 0.12), r, -1.0, BRASS)
P._cylinder(st, Vector3(0, 0.04, -0.1), Vector3(0, 0.04, -0.26), 0.044, 0.048, 8, BRASS, r, -1.0, Color(0.6, 0.7, 0.8))
return P._commit(st)
## A heap of old gold coins, and a few spilled.
static func _pirate_gold() -> ArrayMesh:
var st := P._begin()
var r := _rng(53)
var n := FastNoiseLite.new()
n.seed = 53
P._blob(st, Vector3(0, 0.06, 0), Vector3(0.2, 0.09, 0.18), n, 0.25, GOLD, r, 1)
for i in range(7):
var a := i * 0.9
var c := Vector3(cos(a) * (0.16 + 0.05 * (i % 3)), 0.01, sin(a) * (0.16 + 0.05 * (i % 3)))
P._cylinder(st, c, c + Vector3(0, 0.012, 0), 0.03, 0.03, 8, GOLD.darkened(0.1 * (i % 3)), r, -1.0, GOLD)
return P._commit(st)
## A cutlass: a curved, broad blade, a brass basket guard, a dark grip.
static func _cutlass() -> ArrayMesh:
var st := P._begin()
var r := _rng(59)
_handle(st, 0.14, r)
P._cylinder(st, Vector3(-0.06, 0.15, 0), Vector3(0.06, 0.15, 0), 0.025, 0.025, 5, BRASS, r)
P._cylinder(st, Vector3(0, 0.16, 0), Vector3(0.02, 0.45, 0), 0.03, 0.028, 4, Color(0.72, 0.74, 0.78), r)
P._cylinder(st, Vector3(0.02, 0.45, 0), Vector3(0.08, 0.72, 0), 0.028, 0.006, 4, Color(0.72, 0.74, 0.78), r)
return P._commit(st)
static func _wood() -> ArrayMesh:
var st := P._begin()
var r := _rng(9)
@@ -392,6 +549,17 @@ static func _wall() -> ArrayMesh:
_box(st, Vector3(0, y, 0), Vector3(1.68, 0.12, 0.2), BEAM)
return P._commit(st)
## Half wall: the wall's boards and frame, 2 x 1 m.
static func _half_wall() -> ArrayMesh:
var st := P._begin()
var r := _rng(75)
_wall_body(st, r, -0.84, 0.84, 0.1, 0.9)
for x in [-0.92, 0.92]:
_box(st, Vector3(x, 0.5, 0), Vector3(0.16, 1.0, 0.2), BEAM)
for y in [0.06, 0.94]:
_box(st, Vector3(0, y, 0), Vector3(1.68, 0.12, 0.2), BEAM)
return P._commit(st)
## Door frame (1.1 x 1.9 m opening); `with_panel` adds the closed door, for the
## inventory icon and the placement ghost.
static func _door(with_panel: bool) -> ArrayMesh:
@@ -443,6 +611,37 @@ static func _roof() -> ArrayMesh:
_box(st, along * s + n * 0.085, Vector3(2.04, 0.05, (length + 0.3) / rows + 0.1), _board(r, SHINGLE), tilt)
return P._commit(st)
## Roof ridge: two short shingled panels meeting at a peak 0.5 m up (an
## upside-down V across local Z), origin at the centre of the low edges'
## level. Bridges the gap between two roof rows on a 6 m-wide house.
static func _roof_ridge() -> ArrayMesh:
var st := P._begin()
var r := _rng(91)
var a := 0.4636476
var half := sqrt(1.25)
for side in [1.0, -1.0]:
var b := Basis(Vector3.RIGHT, a * side)
var n := Vector3(0, cos(a), sin(a) * side)
var mid := Vector3(0, 0.25, 0.5 * side)
_box(st, mid + n * 0.03, Vector3(2.0, 0.06, half + 0.06), _board(r, BEAM), b)
for i in range(2):
var along := Vector3(0, -sin(a), cos(a) * side) * (half * (0.25 - 0.5 * i))
_box(st, mid + along + n * 0.085, Vector3(2.04, 0.05, half * 0.5 + 0.1), _board(r, SHINGLE), Basis(Vector3.RIGHT, (a + 0.06) * side))
_box(st, Vector3(0, 0.55, 0), Vector3(2.06, 0.08, 0.16), BEAM) # (the ridge board)
return P._commit(st)
## Ridge gable: a small triangle, 2 m wide and 0.5 m tall, peak in the middle.
static func _ridge_gable() -> ArrayMesh:
var st := P._begin()
var r := _rng(98)
for i in range(2):
var y0 := 0.25 * i
var hw := 0.92 * (1.0 - y0 / 0.5) - 0.06
_box(st, Vector3(0, y0 + 0.125, 0), Vector3(hw * 2.0, 0.25 - 0.015, 0.12), _board(r))
_box(st, Vector3(0, 0.06, 0), Vector3(2.0, 0.12, 0.2), BEAM)
_box(st, Vector3(0, 0.25, 0), Vector3(0.14, 0.5, 0.2), BEAM)
return P._commit(st)
## Triangular gable end: 0 m tall at -X, 1 m tall at +X.
static func _gable() -> ArrayMesh:
var st := P._begin()
@@ -1109,6 +1308,34 @@ static func _barrow_key() -> ArrayMesh:
# --- P4 food keeping ---------------------------------------------------------------------
## A crust of white salt crystals.
## A few chunks of white crab meat in a cracked bit of shell.
static func _crab_meat() -> ArrayMesh:
var st := P._begin()
var r := _rng(341)
var n := FastNoiseLite.new()
n.seed = 341
n.frequency = 2.6
P._blob(st, Vector3(0, 0.03, 0), Vector3(0.11, 0.03, 0.08), n, 0.2, Color(0.62, 0.22, 0.12), r, 1)
for i in range(4):
var c := Vector3(r.randf_range(-0.05, 0.05), 0.06, r.randf_range(-0.035, 0.035))
P._blob(st, c, Vector3(0.035, 0.022, 0.025), n, 0.25, Color(0.95, 0.9, 0.84).lerp(Color(0.95, 0.7, 0.62), r.randf() * 0.4), r, 0)
return P._commit(st)
## A whole crab, boiled pink-red, legs tucked.
static func _cooked_crab() -> ArrayMesh:
var st := P._begin()
var r := _rng(343)
var n := FastNoiseLite.new()
n.seed = 343
n.frequency = 2.4
var shell := Color(0.9, 0.35, 0.22)
P._blob(st, Vector3(0, 0.05, 0), Vector3(0.12, 0.04, 0.09), n, 0.1, shell, r, 1)
for sx in [-1.0, 1.0]:
P._blob(st, Vector3(sx * 0.1, 0.04, -0.1), Vector3(0.03, 0.025, 0.045), n, 0.1, shell, r, 0)
for z in [-0.03, 0.01, 0.05]:
P._cylinder(st, Vector3(sx * 0.1, 0.03, z), Vector3(sx * 0.15, 0.01, z + 0.02), 0.008, 0.004, 3, P._mul(shell, 0.85), r)
return P._commit(st)
static func _salt() -> ArrayMesh:
var st := P._begin()
var r := _rng(331)

View File

@@ -21,6 +21,8 @@ const Creature = preload("res://scripts/creatures/creature.gd")
const BearScript = preload("res://scripts/creatures/bear.gd")
const CrowScript = preload("res://scripts/creatures/crow.gd")
const GuardScript = preload("res://scripts/creatures/guard.gd")
const GullScript = preload("res://scripts/creatures/gull.gd")
const CrabScript = preload("res://scripts/creatures/crab.gd")
const StagScript = preload("res://scripts/creatures/old_stag.gd") # (rears and lowers its antlers) # (falls apart in its own way)
const Bobber = preload("res://scripts/fishing/bobber.gd")
const Projectile = preload("res://scripts/creatures/projectile.gd")
@@ -99,7 +101,7 @@ func _server_tick(w: Node3D, delta: float) -> void:
const PER_PACKET := 40
const ENTRY := 23
const KIND_IDS := ["rabbit", "deer", "boar", "wolf", "alpha", "bear", "crow", "fox", "guard", "old_stag", "spirit_wolf"]
const KIND_IDS := ["rabbit", "deer", "boar", "wolf", "alpha", "bear", "crow", "fox", "guard", "old_stag", "spirit_wolf", "drowned", "crab", "gull"]
const STATE_IDS := ["idle", "wander", "flee", "charge", "dead", "rest", "alert", "stalk", "lunge", "retreat", "home", "defend", "bash",
"warn", "raid", "eat", "fly", "fly_off", "peck", "sneak", "carry", "circle", "telegraph", "stunned", "summon", "stomp"]
@@ -198,7 +200,8 @@ func _s2c_life(packed: PackedByteArray, fl: Array) -> void:
var c: Node3D = got if is_instance_valid(got) else null
if c == null:
# (Kinds with their own look: the bear rears up, a crow flaps.)
var script: Script = {"bear": BearScript, "crow": CrowScript, "guard": GuardScript, "old_stag": StagScript}.get(kind, Creature)
var script: Script = {"bear": BearScript, "crow": CrowScript, "guard": GuardScript, "drowned": GuardScript, "old_stag": StagScript,
"gull": GullScript, "crab": CrabScript}.get(kind, Creature)
c = script.new()
c.puppet = true
c.setup(kind, world, e[2], cid)

View File

@@ -32,7 +32,7 @@ signal clock(day: int, time: float) ## the server's time of day
const Identity = preload("res://scripts/net/identity.gd")
const ServerConfig = preload("res://scripts/net/server_config.gd")
const PROTOCOL := 17 ## 17: lands on a server (crossings, the tunnel online, the roster); 16: worldlets (the Cove), sea fish (mackerel, cod); 3: shared world; 4: the server decides; 5: wildlife; 6: rules and chat (M2.6); 7: the alpha, broken doors; 8: the bear; 9: crows and foxes; 10: the barrow (P3); 11: food spoilage, lightning (P4); 12: the standing stones and the Old Stag (P5); 13: sounds sent to players nearby (sfx.gd); 14: dropping items, any bag row in hand, new items (jar, bedroll, necklace, bear cloak, rug, pemmican); 15: placed lights (candle, torch stand)
const PROTOCOL := 19 ## 19: bigger houses (half wall, roof ridge, ridge gable; roofs through roofs); 18: the Cove's own (the wreck and treasure, the drowned crew, crabs and gulls, boats at the pier); 17: lands on a server (crossings, the tunnel online, the roster); 16: worldlets (the Cove), sea fish (mackerel, cod); 3: shared world; 4: the server decides; 5: wildlife; 6: rules and chat (M2.6); 7: the alpha, broken doors; 8: the bear; 9: crows and foxes; 10: the barrow (P3); 11: food spoilage, lightning (P4); 12: the standing stones and the Old Stag (P5); 13: sounds sent to players nearby (sfx.gd); 14: dropping items, any bag row in hand, new items (jar, bedroll, necklace, bear cloak, rug, pemmican); 15: placed lights (candle, torch stand)
const DEFAULT_PORT := 24242
const HANDSHAKE_TIMEOUT := 10.0
const JOIN_TIMEOUT := 20.0 ## includes the server building its terrain on first join
@@ -176,7 +176,7 @@ func _start_dedicated() -> void:
func _on_update_checked(s: String) -> void:
if s == "available":
print("[server] Emberwild %s is out (protocol %d); this server runs %s (protocol %d). %s" % [
print("[server] Cinderwild %s is out (protocol %d); this server runs %s (protocol %d). %s" % [
Updates.latest_version(), Updates.latest_protocol(), Updates.version, PROTOCOL,
"Players with the new version can't join until it's updated." if Updates.latest_protocol() != PROTOCOL else ""])
@@ -673,7 +673,7 @@ func _wall_hit(space: PhysicsDirectSpaceState3D, a: Vector3, b: Vector3) -> bool
var piece: Node = c as Node
while piece != null and piece.get("kind") == null:
piece = piece.get_parent()
if piece != null and String(piece.kind) in ["wall", "door", "gable", "window", "palisade", "pillar"]:
if piece != null and String(piece.kind) in ["wall", "half_wall", "door", "gable", "ridge_gable", "window", "palisade", "pillar"]:
return true
ex.append(hit.rid) # a floor or roof edge: look past it
return false
@@ -694,7 +694,7 @@ func _c2s_hello(d: Dictionary) -> void:
return
if int(d.get("protocol", 0)) != PROTOCOL:
var theirs := int(d.get("protocol", 0))
_reject(peer, "Different game version: this server runs Emberwild %s (protocol %d), you have protocol %d. %s" % [
_reject(peer, "Different game version: this server runs Cinderwild %s (protocol %d), you have protocol %d. %s" % [
Updates.version, PROTOCOL, theirs, "Update the game to join." if theirs < PROTOCOL else "The server needs updating."])
return
# (A crossing to another land comes with a one-time pass instead, checked

View File

@@ -354,7 +354,11 @@ func _run(p: Node3D, what: String, a: Array) -> void:
"hit":
var n: Node3D = w.props.resource_nodes.get(_s(a, 0))
var at: Vector3 = _v(a, 1)
if n == null and w.tunnel != null:
if n == null and _s(a, 0) == "treasure:" + String(p.player_id) and w.treasure != null:
var m: Node3D = w.treasure.mound_for(String(p.player_id)) # (your own X: treasure.gd)
if m != null and at.is_finite() and at.distance_to(m.global_position) < 2.5:
Actions.harvest_hit(p, m, at)
elif n == null and w.tunnel != null:
var f: Node3D = w.tunnel.face_by_uid(_s(a, 0)) # (the cliff tunnel's seam or face)
if f != null and at.is_finite():
Actions.harvest_hit(p, f, at) # (the tunnel tells everyone: tunnel.gd)
@@ -363,6 +367,16 @@ func _run(p: Node3D, what: String, a: Array) -> void:
"tunnel_prop":
if w.tunnel != null:
w.tunnel.set_prop(p, _i(a, 0))
"wreck_chest":
# The wreck's sea chest: each player's share, once.
if w.wreck != null and p.global_position.distance_to(w.wreck.chest.global_position) < 4.0:
if w.wreck.open_for(p, String(p.player_id)):
WorldNet.wreck_state(w.wreck.to_data())
"moor":
# The mooring post at the end of the pier: tie up your boat.
if w.moorings != null and p.global_position.distance_to(w.moorings.post.global_position) < 4.0:
if w.moorings.moor(p, String(p.player_id)):
WorldNet.boats_state(w.moorings.to_data())
"tunnel_go":
# Down into the cliff tunnel, or back out at the top: a teleport
# the server makes (the tunnel's under the island), from nearby.
@@ -524,7 +538,7 @@ func _run(p: Node3D, what: String, a: Array) -> void:
for m in w.get_tree().get_nodes_in_group("processor"):
m.step(float(a[0]) if a.size() > 0 and (a[0] is float or a[0] is int) else 60.0)
"debug_spawn":
if cheats and Creature.KINDS.has(_s(a, 0)) and not (_s(a, 0) in ["wolf", "alpha", "bear", "crow", "fox", "guard", "old_stag", "spirit_wolf"]) and _v(a, 1).is_finite():
if cheats and Creature.KINDS.has(_s(a, 0)) and not (_s(a, 0) in ["wolf", "alpha", "bear", "crow", "fox", "guard", "old_stag", "spirit_wolf", "drowned", "crab", "gull"]) and _v(a, 1).is_finite():
w.creatures.spawn(_s(a, 0), _v(a, 1))
"debug_boss":
# Tests: ["hold", secs] stands the Old Stag still (stunned);

View File

@@ -6,7 +6,7 @@ extends RefCounted
const DEFAULT_PATH := "user://server/server.json"
const DEFAULTS := {
"server_name": "Emberwild server",
"server_name": "Cinderwild server",
"motd": "Welcome!",
"port": 24242,
"max_players": 8,

View File

@@ -377,6 +377,41 @@ func tunnel_state(d: Dictionary) -> void:
if Lands.hub:
Lands.push_tunnel(int(d.get("dug", 0)))
## Whose treasure's been dug (and how far): everyone here sees their own
## mound go down, or go.
func treasure_state(d: Dictionary) -> void:
_all("_s2c_treasure", [d])
mark_changed()
@rpc("authority", "call_remote", "reliable")
func _s2c_treasure(d: Dictionary) -> void:
if not is_client() or world.treasure == null:
return
world.treasure.load_data(d)
## Someone tied up a boat at the pier: everyone here sees it.
func boats_state(d: Dictionary) -> void:
_all("_s2c_boats", [d])
mark_changed()
@rpc("authority", "call_remote", "reliable")
func _s2c_boats(d: Dictionary) -> void:
if not is_client() or world.moorings == null:
return
world.moorings.load_data(d)
## Who's had their share of the wreck's sea chest changed: everyone here
## sees whether it's empty for them.
func wreck_state(d: Dictionary) -> void:
_all("_s2c_wreck", [d])
mark_changed()
@rpc("authority", "call_remote", "reliable")
func _s2c_wreck(d: Dictionary) -> void:
if not is_client() or world.wreck == null:
return
world.wreck.load_data(d)
@rpc("authority", "call_remote", "reliable")
func _s2c_tunnel(d: Dictionary) -> void:
if not is_client() or world.tunnel == null:

View File

@@ -145,6 +145,7 @@ func _target() -> Object:
func _physics_process(delta: float) -> void:
_swing_cd = maxf(_swing_cd - delta, 0.0)
_zoom(delta)
if player.ui_open:
_ghost.visible = false
_set_prompt("")
@@ -174,6 +175,10 @@ func _physics_process(delta: float) -> void:
_set_prompt("[RMB] Eat %s" % def.name)
elif def.has("wear"):
_set_prompt("[RMB] Wear %s" % def.name)
elif def.has("read"):
_set_prompt("[RMB] Read the %s" % String(def.name).to_lower())
elif def.has("zoom"):
_set_prompt("[hold RMB] Look through the %s" % String(def.name).to_lower())
elif def.has("bow"):
var n: int = Actions.ammo_count(player, def.bow)
_set_prompt("Drawing %d%%" % roundi(draw_power() * 100.0) if _drawing else "[hold LMB] Draw (%d arrows)" % n)
@@ -232,6 +237,21 @@ func _update_ghost(def: Dictionary) -> void:
_ghost.material_override = _ghost_ok_mat if _place_ok else _ghost_bad_mat
_ghost.visible = true
## The spyglass (0.6.0): holding right-click with it narrows the view by its
## "zoom", eased in and out.
var _base_fov := 0.0
func _zoom(delta: float) -> void:
var cam := get_parent() as Camera3D
if cam == null:
return
if _base_fov <= 0.0:
_base_fov = cam.fov
var z := float(_held_def().get("zoom", 0.0))
var looking: bool = z > 1.0 and not player.ui_open and Input.is_action_pressed("use_item") \
and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED
var want: float = _base_fov / z if looking else _base_fov
cam.fov = move_toward(cam.fov, want, delta * 160.0)
func _unhandled_input(event: InputEvent) -> void:
if player.ui_open:
return
@@ -262,6 +282,8 @@ func _unhandled_input(event: InputEvent) -> void:
Actions.eat(player, player.selected)
elif d.has("wear"):
Actions.wear(player, player.selected)
elif d.has("read"):
player.get_parent().read_map(player) # (the treasure map: your X, on your map)
elif d.get("weapon", {}).has("throw"):
_throw()
elif event.is_action_pressed("rotate_piece"):

View File

@@ -23,6 +23,8 @@ const MARKS := {
"build": [Color(0.62, 0.45, 0.28), "Your buildings"],
"camp": [Color(1.00, 0.80, 0.35), "Camp"],
"grave": [Color(0.85, 0.85, 0.85), "Your things"],
"wreck": [Color(0.55, 0.38, 0.22), "The wreck"],
"treasure": [Color(0.9, 0.12, 0.1), "X: your treasure"],
}
var world: Node3D
@@ -32,6 +34,7 @@ var _marks: Control
var _title: Label
var _facing: Label
var _others_key: Label
var _key: Dictionary = {} ## mark kind -> its line in the key
func setup(w: Node3D, p: Node3D) -> void:
world = w
@@ -83,6 +86,7 @@ func setup(w: Node3D, p: Node3D) -> void:
var l := UITheme.label("■ %s" % MARKS[k][1], 14)
l.add_theme_color_override("font_color", MARKS[k][0])
legend.add_child(l)
_key[k] = l
_facing = UITheme.label("", 15, UITheme.TEXT_DIM)
_facing.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
box.add_child(_facing)
@@ -97,6 +101,13 @@ func open() -> void:
_tex.texture = ImageTexture.create_from_image(render(world))
_title.text = "The %s" % preload("res://scripts/world/terrain.gd").worldlet_name(world.worldlet_id())
_others_key.visible = world.is_online() and not bool(Net.server_info.get("pvp", true))
# The key lists this land's places only (the Cove has no barrow...).
var here := {"den": world.den != null and world.den.found, "barrow": world.barrow != null,
"stones": world.stones != null, "seam": world.tunnel != null, "pier": world.pier != null,
"cave": world.sea_cave != null, "wreck": world.wreck != null,
"treasure": world.wreck != null and player.inventory.count("treasure_map") > 0}
for k in _key:
_key[k].visible = bool(here.get(k, true))
visible = true
player.ui_open = true
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
@@ -132,10 +143,16 @@ func _draw_marks() -> void:
for m in world.map_marks():
var at := _to_map(m.pos)
var col: Color = MARKS.get(m.kind, [Color.WHITE])[0]
if m.kind == "treasure":
# An inked X, as on the old chart.
for d in [Vector2(1, 1), Vector2(1, -1)]:
_marks.draw_line(at - d * 8.0, at + d * 8.0, Color(0, 0, 0, 0.8), 5.0)
_marks.draw_line(at - d * 8.0, at + d * 8.0, col, 3.0)
continue
var r := 3.0 if m.kind == "build" else 6.0
_marks.draw_rect(Rect2(at - Vector2(r, r), Vector2(r, r) * 2.0), col)
_marks.draw_rect(Rect2(at - Vector2(r, r), Vector2(r, r) * 2.0), Color(0, 0, 0, 0.7), false, 1.0)
if m.kind in ["den", "barrow", "stones", "seam", "pier", "cave"]:
if m.kind in ["den", "barrow", "stones", "seam", "pier", "cave", "wreck"]:
_marks.draw_string(font, at + Vector2(9, 5), String(m.label), HORIZONTAL_ALIGNMENT_LEFT, -1, 13, col)
# Other players in this land: only on a co-op server (with PvP on, the
# map never gives anyone away). Green dots with their names.

View File

@@ -1,9 +1,11 @@
extends Control
## Pause menu (ESC): resume, controls, fullscreen, mouse sensitivity, quit.
## Pause menu (ESC): resume, controls, report a bug, fullscreen, mouse
## sensitivity, volumes, quit.
## Pauses the scene tree while open; runs with PROCESS_MODE_ALWAYS so it still
## gets input.
const UITheme = preload("res://scripts/ui/theme.gd")
const BugReport = preload("res://scripts/core/bug_report.gd")
const CONTROLS := [
["W A S D", "Move"], ["Shift", "Sprint"], ["Space", "Jump / swim up"],
@@ -23,6 +25,8 @@ const CONTROLS := [
var player: CharacterBody3D
var _main: VBoxContainer
var _controls: VBoxContainer
var _report: VBoxContainer
var _report_note: Label
var _quit_btn: Button
var _quit_armed := false
var _online := false ## on a server: no pausing, no saving here
@@ -60,6 +64,7 @@ func bind(p: CharacterBody3D) -> void:
_main.add_child(title)
_main.add_child(_button("Resume", close))
_main.add_child(_button("Controls", _show_controls.bind(true)))
_main.add_child(_button("Report a bug", _show_report.bind(true)))
var fs := CheckButton.new()
fs.text = "Fullscreen"
@@ -122,7 +127,7 @@ func bind(p: CharacterBody3D) -> void:
_main.add_child(tips_row)
var upd := CheckButton.new()
upd.text = "Check for updates at start (Emberwild %s)" % Updates.version
upd.text = "Check for updates at start (Cinderwild %s)" % Updates.version
upd.focus_mode = Control.FOCUS_NONE
upd.button_pressed = Updates.enabled
upd.add_theme_font_size_override("font_size", 16)
@@ -174,6 +179,31 @@ func bind(p: CharacterBody3D) -> void:
_controls.add_child(grid)
_controls.add_child(_button("Back", _show_controls.bind(false)))
# Report a bug page (0.6.0, the playtest: bug_report.gd).
_report = VBoxContainer.new()
_report.add_theme_constant_override("separation", 10)
_report.visible = false
stack.add_child(_report)
var rt := UITheme.label("Report a bug", 26)
rt.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
_report.add_child(rt)
var how := UITheme.label("This opens a new issue on Cinderwild's Gitea page in your browser, filled in with your version, computer and where you are in the game. Say what happened, then press Create Issue. (You'll need to be signed in there.) Nothing is sent from the game itself.", 15)
how.autowrap_mode = TextServer.AUTOWRAP_WORD
how.custom_minimum_size = Vector2(380, 0)
_report.add_child(how)
_report.add_child(_button("Open the bug report page", _on_report_open))
_report.add_child(_button("Copy the details", _on_report_copy))
_report.add_child(_button("Show the log file", _on_report_log))
var lp := UITheme.label("For a crash or an error, attach the log:\n%s" % BugReport.log_path(), 13, UITheme.TEXT_DIM)
lp.autowrap_mode = TextServer.AUTOWRAP_ARBITRARY
lp.custom_minimum_size = Vector2(380, 0)
_report.add_child(lp)
_report_note = UITheme.label("", 14, UITheme.SELECTED)
_report_note.autowrap_mode = TextServer.AUTOWRAP_WORD
_report_note.custom_minimum_size = Vector2(380, 0)
_report.add_child(_report_note)
_report.add_child(_button("Back", _show_report.bind(false)))
func _button(text: String, cb: Callable) -> Button:
var b := Button.new()
b.text = text
@@ -189,6 +219,7 @@ func is_open() -> bool:
func open() -> void:
visible = true
_show_controls(false)
_show_report(false)
_disarm_quit()
player.ui_open = true
get_tree().paused = not _online # a shared world can't be paused by one player
@@ -215,10 +246,12 @@ func close() -> void:
get_tree().paused = false
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
## ESC on the controls page goes back; on the main page it resumes.
## ESC on the controls or bug report page goes back; on the main page it resumes.
func back() -> void:
if _controls.visible:
_show_controls(false)
elif _report.visible:
_show_report(false)
else:
close()
@@ -226,6 +259,31 @@ func _show_controls(on: bool) -> void:
_controls.visible = on
_main.visible = not on
func _show_report(on: bool) -> void:
_report.visible = on
_main.visible = not on
_report_note.text = ""
func _world() -> Node:
return player.get_parent() if player != null else null
func _on_report_open() -> void:
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) # (so the browser isn't hidden behind the game)
if BugReport.open(_world()):
_report_note.text = "Opened in your browser. (Can't post there? Copy the details and send them to whoever gave you the game.)"
else:
DisplayServer.clipboard_set(BugReport.issue_url(_world()))
_report_note.text = "Couldn't open a browser: the link's on your clipboard to paste into one."
func _on_report_copy() -> void:
DisplayServer.clipboard_set(BugReport.details_text(_world()))
_report_note.text = "Copied: paste them into your message."
func _on_report_log() -> void:
OS.shell_open(BugReport.log_dir())
_report_note.text = "The log is godot.log in that folder."
func _on_fullscreen(on: bool) -> void:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN if on else DisplayServer.WINDOW_MODE_WINDOWED)

View File

@@ -80,7 +80,7 @@ func _ready() -> void:
col.offset_right = 520
col.add_theme_constant_override("separation", 14)
root.add_child(col)
col.add_child(UITheme.label("EMBERWILD", 54))
col.add_child(UITheme.label("CINDERWILD", 54))
col.add_child(UITheme.label("Survive the island. Build a home.", 18, UITheme.TEXT_DIM))
var spacer := Control.new()
spacer.custom_minimum_size = Vector2(0, 24)
@@ -413,7 +413,7 @@ func _host_page() -> Control:
func _fill_host() -> void:
var c: RefCounted = load("res://scripts/net/server_config.gd").open(Net.host_config)
var n: String = c.data.server_name
_host_name.text = "%s's island" % Net.get_identity().name if n == "Emberwild server" else n
_host_name.text = "%s's island" % Net.get_identity().name if n in ["Cinderwild server", "Emberwild server"] else n
_host_port.text = str(int(c.data.port))
_host_pw.text = String(c.data.password)
var preset := "co-op"
@@ -801,7 +801,7 @@ var version_label: Label
## The version, bottom left; and a card bottom right when a newer one is out.
func _build_update_banner(root: Control) -> void:
# (bottom right: the menu column runs down the left and would cover it)
version_label = UITheme.label("Emberwild %s" % Updates.version, 13, UITheme.TEXT_DIM)
version_label = UITheme.label("Cinderwild %s" % Updates.version, 13, UITheme.TEXT_DIM)
version_label.set_anchors_and_offsets_preset(Control.PRESET_BOTTOM_RIGHT)
version_label.grow_horizontal = Control.GROW_DIRECTION_BEGIN
version_label.grow_vertical = Control.GROW_DIRECTION_BEGIN
@@ -842,7 +842,7 @@ func _on_update_checked(s: String) -> void:
return
var notes := String(Updates.latest.get("notes", ""))
var how := "" if Updates.packaged() else "\nRunning from the source: git pull in the game folder, then restart."
_update_text.text = "Emberwild %s is out (you have %s).%s%s" % [Updates.latest_version(), Updates.version,
_update_text.text = "Cinderwild %s is out (you have %s).%s%s" % [Updates.latest_version(), Updates.version,
("\n" + notes) if not notes.is_empty() else "", how]
_update_btn.text = "Download" if Updates.packaged() and not String(Updates.download().get("url", "")).is_empty() else "Release page"
_update_btn.disabled = Updates.download_url().is_empty()
@@ -858,7 +858,7 @@ static func version_advice(reason: String) -> String:
if not reason.begins_with("Different game version"):
return ""
if Updates.state == "available":
return "\nEmberwild %s is out: Download is on the title page." % Updates.latest_version()
return "\nCinderwild %s is out: Download is on the title page." % Updates.latest_version()
if reason.ends_with("Update the game to join."):
return "\nThere's no newer release yet: the server may be running a newer copy from the source."
return ""

Some files were not shown because too many files have changed in this diff Show More