Skip to content
TinyBitAdventuresPublic

About

A guinea pig survival forage in the big green woods. Three.js and Blender models, no build step. Part of Tiny Bit Adventures.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wheek!

A guinea pig survival forage in the big green woods. Pick your guinea pig, munch grass, forage the forest for rare treats, find the hidden burrows, explore the warren of tunnels beneath the woods and charm the humans for pets. Keep your tummy full and your vitamin C up, watch the sky for hawks and don't linger in the woods after dark. Guinea pigs are happiest in a herd, so befriend the other piggies you meet and bring them along.

Built with Three.js. Every model is generated by a Blender script. No build step.

Play it: tinybitadventures.com · What's new: CHANGELOG.md

Controls

Action Keys
Scurry around WASD
Sprint (costs energy) Shift
Eat, enter a tunnel, gnaw a twig E (hold to nibble grass; while gnawing, press E when the marker is in the green)
Forage Hold F
Sniff out treats and tunnels R
Wheek at a human for a veggie Q
Popcorn (when happy) Space
Chat and befriend a piggy Hold C
Map: this place, then the world M (press again for the world map, again to close)
Forager's journal J
Pause, save, settings, quit to the title P or Esc
Look around, zoom Drag the mouse, mouse wheel

Touch screens: put a thumb down on the left of the screen and slide to scurry; drag on the right to look around and pinch to zoom. Round buttons wheek, sniff, hop (popcorn) and scurry, and the map, journal and pause buttons sit at the top. Whenever there's something to do (eat, forage, chat, enter a tunnel, wheek at a human) a button for it pops up on the right: tap it, or hold it to munch, forage and chat.

Gamepads: left stick to scurry, right stick to look, Ⓐ eat and enter, Ⓧ forage, Ⓨ chat, Ⓑ popcorn, RB sniff, LB wheek, RT scurry, Back for the map, d-pad up for the journal, Start to pause. In menus the d-pad (or the stick) moves between buttons, Ⓐ picks and Ⓑ goes back. The prompts show the gamepad's buttons while you're using one.

The park sits in the middle of a 3×3 world of zones (a snowy mountain, a deep wood, a town, a beach, a creek, a petting zoo, a farm and a sunflower maze): walk off any edge, sides or corners, to go to the next one. Stand still next to a kneeling human for pets. Watch the sky for the hawk by day (a gull at the beach, a snowy owl on the peaks at night), the foxes in the woods at night and Smudge the barn cat on the farm: hide under bushes, in logs and burrows, or freeze. At a burrow, press E to nap, crawl down into the warren or scurry along a route you have already explored.

Long tunnels

Find every burrow in a place and it's linked to the long tunnels (the park links once you've found 5 of its 10). From any burrow in a linked place, the tunnel menu offers a ride to every other linked place. The world map (press M twice) shows the nine places, the burrows you've found in each and which are linked.

Places to discover

Each one has an icon on its zone's map, and sniffing (R) nearby marks the way in.

  • 🏡 Home (the park): the pet flap at the foot of your house's front door. Nap in your hidey house (it saves), eat from your bowl, and show off everything you've collected on your trophy shelf.

  • 🛖 The barns (the farm and the petting zoo): squeeze through the little holes at the foot of the walls, munch the hay pile or burrow into it (F) for the treats hidden inside.

  • 🐾 The pet shop (Downtown, after 6 PM): the cat flap round the back. Tiptoe past Duchess the cat, crawl through the tubes (E at an open end) and make friends with Butterscotch.

  • 🍃 The leaf raft (Willow Creek): a big leaf on the bank at the west end of the creek. Ride it downstream (steer with A/D, paddle with W, slow with S) to Willow Island.

  • 🏅 The agility tent (Critter Corner): duck under the tent flap and run the course against the clock for a rosette (E on the green mat to start, Space to hop the bar).

  • 🌳 The Hollow Oak (the Deep Wood): squeeze into the knothole and hop up the bracket fungi inside (Space) to the lookout at the top, without waking the owl.

  • 🌻 The old windmill (Sunflower Fields): slip in through the mouse hole, dodge the sweep arm, climb the ramp to the loft and catch the seeds spilling from the hopper (A/D).

  • 🌊 The sea cave (Sandy Cove): open at low tide, 8 to 2 morning and night. Grab the shells and get out before the tide comes back in.

  • ❄️ The ice cave (Snowcap Peaks): squeeze through the crack beside the frozen waterfall. On the ice you slide until something stops you (WASD picks the way): reach the berries frozen in the walls and the Frost Crystal at the back, and warm up in the hot spring by the door.

Saves and settings

The title screen has three save slots. Save from the pause menu (P), or "Save & quit" back to the title; the game also autosaves at sunrise and when you close the tab. After a game over you can go back to your last save. Saves and your best score live in the browser's local storage. Cozy mode (on the breed picker, or in Settings for the guinea pig you're playing): nothing can hurt you and there's no game over, for little ones or a relaxed forage. Otherwise the days get harder from day 3 on. Settings (⚙️ on the title screen or in the pause menu) set the volume, music and sound effects, the graphics (Auto, the default, turns things down by itself if your device struggles; Low turns off shadows, thins the fur and draws less far away), screen flashes and whether to show the touch controls.

Run it locally

Serve the folder with any static web server and open it:

python3 -m http.server 8000     # then open http://localhost:8000

The models load with fetch, so opening index.html straight from disk won't work. Three.js and the Fredoka font load from CDNs.

How it's put together

Path What it holds
index.html Title screen, breed picker, HUD, journal and menus (markup and CSS). The version lives in its script tag, js/game.js?v=X.Y.Z, and in the import map above it, which gives every module in js/ the same ?v=X.Y.Z: a release bumps them all, so no one keeps a stale module from the cache
js/game.js The entry: the main loop and boot. It imports the rest, native ES modules with no build step
js/*.js The game, a module per part: util (seeded random numbers, noise, helpers), render (renderer, scene, camera, sky, textures), assets (loading and instancing the models), world (terrain, the 3×3 zones), zones (the eight zones around the park, each a recipe for the shared builder in build), state (the game state), breeds and pig (guinea pigs and their fur), items, interact (eating, foraging, sniffing), warren (burrows, tunnels and the warren under the park), people (humans and the herd), threats (the hawk and foxes), interiors (the little indoor scenes, and the barns), gnaw, player (movement and the camera), day, goals, hud (HUD, maps, journal), save, settings, input, audio, fx (particles and messages)
js/places/*.js Home and its trophy shelf, and each zone's big discovery: the pet shop, the leaf raft and Willow Island, the agility tent, the Hollow Oak, the windmill, the sea cave and the ice cave
assets/*.glb The models, generated by tools/build_assets.py
assets/music/*.mp3 The music: three seamless loops (the meadow by day, moonlight at night, the warren underground) composed for the game with Wavelength. The game loops each one sample-exactly and cross-fades between them
tools/build_assets.py The Blender script that builds every model
tools/preview.py Renders one model to a PNG
tools/shots.cjs A screenshot tour of the game with Playwright
tools/check.cjs World checks with Playwright: every module versioned, everything reachable in every zone and the warren, night, random input, eating, each place to discover, saves, memory

window.__game is a debug handle (state, pig, herd, humans, tunnels, camera) that the screenshot tour uses to pose scenes.

Models

blender -b --factory-startup --python tools/build_assets.py -- assets             # every model
blender -b --factory-startup --python tools/build_assets.py -- assets Fox Oak     # just these
blender -b --factory-startup --python tools/preview.py -- Fox 1.4 0.35 prev.png  # a quick look at one

A new model also needs its name in MODELS in js/assets.js. Each model has its own random seed, so rebuilding one gives the same geometry as a full build (the bytes of the .glb can still shift). 14 of the shipped models were exported before that seed and the script's last tweaks, so rebuilding one of them gives a slightly different variation: check it in the game before committing.

Checks

PW=/path/to/node_modules/playwright node tools/check.cjs              # every check
PW=/path/to/node_modules/playwright node tools/check.cjs reach saves  # just these

Runs in a tiny headless window and tests the world through window.__game: that every module loaded with the version, then from every way into each zone, a walkability grid (the game's own collision, deep water and the rim) must reach every exit, burrow, forage spot, plant, human and animal; the same underground for every chamber, curio and treat. Then night in every zone, random key mashing, eating and foraging, every zone's signature treat (and wading in to forage watercress), goals and a human's request, the music (the loops decode and follow day, night and the warren) and the settings, gnawing, every place to discover played through (the barns, the pet shop and its tubes, swapping a herd member, the leaf raft to Willow Island, an agility run, climbing the Hollow Oak past the owl, the windmill's ramp and seed catching, a sea cave run against the tide, the ice cave's slides to the crystal and the berries), the map icons and a quiet night Downtown, continuing old and zoned saves (and a save round trip), touch controls on a phone-sized screen, a stand-in gamepad from the menus into the game, and memory after visiting everything (after garbage collection; a second round of visits must not grow it). Exits 1 on any failure or console error.

Screenshots

PW=/path/to/node_modules/playwright node tools/shots.cjs shots              # every scene
PW=/path/to/node_modules/playwright node tools/shots.cjs shots herd forage  # just these

Poses the title, breed picker, herd, pets, forage, house, tunnel and journal (and the warren, zones, each zone's signature forage spot, a zone guinea pig, the places checklist, and each place to discover from outside and in), then prints draw calls, triangles and any console errors. URL points it at another copy (it defaults to the local dev site, https://wheek.localhost/), W/H set the size, and TOUCH=1 emulates a touch screen (the touchui scene shows the touch controls).

License

Code and models: MIT. Part of Tiny Bit Adventures.

About

A guinea pig survival forage in the big green woods. Three.js and Blender models, no build step. Part of Tiny Bit Adventures.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages