Skip to content
k06aPublic

About

๐Ÿก Voxel pixel-art house builder (single-file browser game)

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

2,365 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿก Homy

Play online

GitHub Pages build bundle catalog last commit commit activity repo size code size top language issues stars forks

WebGL2 single file dependencies items touch languages license

A voxel, pixel-art house builder that runs in the browser as a single HTML file. Pick a house type, a location (street, river, lake, sea, cliff, mountain, forest or island) and the nature around it, browse house variants with a slider or type a world seed, hit Create, move in and walk through the house in first person, rebuild it from 20 cm blocks, furnish it from the catalog, adopt animals, chat with the neighbours and explore an endless world.

โ–ถ๏ธ Play: https://k06a.github.io/homy/

Homy

๐Ÿ“ธ Screenshots

Fresh from the current build, on an iPad (2360ร—1640). The pictures are assets of a GitHub release, taken by tools/shots/readme.mjs.

The house

House options and a live preview The house cut floor by floor
Options with emoji, a world seed ๐ŸŒฑ with ๐ŸŽฒ for new variants and a live house in its world The house can be rotated, zoomed and cut floor by floor, with every room labelled
First-person living room Catalog and colour editor
Walking through the house in first person The catalog of 200+ items: colours and materials of every part of an item
Night The start screen in Japanese
At night lamps and street lights really shine 27 languages, switched at any moment with no reload

Places to live

A lakeside house A house on a cliff above the sea
A lakeside house: the street, neighbours, forest and mountains far into the distance On a cliff top above the sea among sakura trees: a fishing hut on stilts at the foot, a stair down from the lookout deck
A house on an island The ferry at the quay
On an island in a forest lake: the street crosses the water on a bridge Or a ferry instead of the bridge: it runs on a timetable, with two ferrymen in shifts
The jetty with a rowing boat Waves and surfers
The jetty behind the garden with a rowing boat you can row and a fishing hut A house on the beach: the surf rolls onto the sand in sets of waves
A tropical villa by the sea A snowy chalet
A tropical villa by the sea: a beach, a pier and a boat A chalet by a frozen lake
An autumn forest The world from high above
An autumn forest of giants: every tree is grown branch by branch, with roots snaking over the ground The endless world from high above: the horizon curves away like a little planet

A living world

A city avenue A half-timbered town
Cities with skyscrapers, avenues, buses and cars parked at the kerb Towns and villages in nine architectural styles, with shops, schools and people in the streets
A resident with the card Animals
Every resident has a name, a family, a job and a plan for the day: tap one to see the card and follow them Pets, farm and wild animals, birds: 28 species
Driving in third person Riding a dragon
Hail a car, take the wheel and drive; third person ๐ŸŽฅ works on foot and in any vehicle Touch a wild dragon to tame it: it comes to visit and takes you flying
A forest fire and the fire engine
A forest fire set with the lighter ๐Ÿ”ฅ: a neighbour phones, the fire engine arrives and the crew puts it out

iPhone (2556ร—1179)

Start Living room
World Night

โœจ Features

  • House generator. 22 house types in five traditions: Western Europe (๐Ÿก cottage, ๐ŸŒน half-timbered house, โšœ๏ธ mansard house, ๐ŸŒท Dutch gable house, ๐Ÿฐ castle, ๐Ÿ›๏ธ manor), North and mountains (๐Ÿ”๏ธ chalet, ๐ŸฆŒ Nordic house, ๐Ÿชต izba, ๐Ÿช† terem), South and deserts (๐Ÿซ’ Mediterranean house, ๐Ÿบ Cycladic house, ๐Ÿ•Œ riad, ๐ŸŒต adobe house), Asia (โ›ฉ๏ธ minka, ๐Ÿฎ Chinese house, ๐ŸŒด bungalow, ๐Ÿƒ rumah gadang) and Modern times (๐Ÿ™๏ธ villa, โฌ› barnhouse, ๐Ÿšœ farmhouse, ๐ŸŽฉ Victorian house). A type is a row of traits (window profile, roof form and slope, timber frame, parapet, towers, veranda, decor), so each has its own details: towers and battlements, stepped gables, a portico, carved window surrounds, an onion dome, an arcade, a tiled portal, an engawa gallery, a saddleback roof with horns, glazed gables. Six roof forms (flat, gable, hip, mansard, gambrel, saddleback) and nine wall finishes can be set apart from the type. The seed can pick the type inside a tradition, and the neighbours of a street mostly build in one tradition that follows the seed and the nature around. Houses grow wings from the seed, so they are L-, T- and U-shaped rather than plain boxes, big ones especially. The start screen groups the options from the inside out: the house (type, walls, roof, floors, floor area, bedrooms, bathrooms, garage and furniture), the lot (size, fence, trees, terrace and flower beds, a pool and a pond, outbuildings), the surroundings and the inhabitants; a choice is a row of buttons, an amount is a slider or a counter, and everything that is simply there or not is a switch. Outbuildings are switched one by one: a ๐Ÿ›– garden house, a ๐ŸŽฃ fishing hut by the garden pond (by real water it is not a switch: a boathouse on stilts with a fishing porch and a covered berth for the rowing boat always stands on the water nearest to the house, at the boardwalk behind the garden, at the foot of a cliff with a stair down from the lookout deck, or on a river past the side fence with a walkway from the bank), a ๐Ÿง– bathhouse, a ๐Ÿชด greenhouse and a โ›ฉ๏ธ gazebo. ๐ŸŽฒ shuffles the options. The house is built right on the start screen, already standing in its world: a slider browses 12 layout and lot variants, ๐Ÿ”„ regenerates them all, and each one can be rotated, zoomed and cut floor by floor with the vertical bar. The view distance of the preview has its own slider (100 to 1000 m), and the world around the lot curves away like a little planet. Create moves you in.
  • World seeds ๐ŸŒฑ. Every world has a seed. Type any number or word on the start screen to get the same house and the same world again. The seed shapes the house together with your options, and the whole world around the lot from the seed alone: your options never leak into the neighbourhood, so two players with the same seed share the same street, forests and mountains. The seed of the current world is shown in the โ˜ฐ menu with a copy button.
  • Thoughtful interiors. The kitchen sits next to the dining or living room (often open-plan with arches), and a bedroom may have its own bathroom. Furniture respects windows and doors: wardrobes never block windows, the desk and the sink stand by a window, the bed head is against a solid wall, the sofa faces the TV and armchairs are turned at 45ยฐ. Wood and fabrics follow one colour scheme for the whole house.
  • Neighbours with a life of their own. Every house on the street has a family that follows from the world seed: adults, kids, grandparents and often a dog, each with a name and their own clothes. They live by the clock: sleep at night, eat together at the dining table, cook, wash up and tidy, watch TV, read, play with toys, swing and jump on the trampoline, have a picnic on a checked blanket, go shopping or for a coffee, visit each other (and you) for tea or a film, go on family walks and walk the dog on a leash: about 50 activities in all. Inside the house and in the yard they find their own way through the doors and around the furniture. Tap a neighbour to hear who it is and what they are doing. Only the people near you are simulated; the rest are frozen and carry on when you come back.
  • Live TV. Every screen in the world (TVs, computers, arcade machines) shows what one of the nearest neighbours is looking at right now: a small extra render from their eyes, a few times a second and only while a screen is in view.
  • Cars. Cars, city cars and minivans drive along the street in both directions, keep their distance, stop and wait until the road is clear for people crossing, and beep if you stand in their lane. Every car carries a driver and often passengers: the same townsfolk, of different ages and clothes. There is always a grocery store two lots down the street.
  • Location and nature. Location features are independent switches that combine: a street with next-door neighbours, a river with a footbridge, a lake or the sea with a pier, a cliff with a waterfall, a forest of giants. Together they describe one scene the house stands in: the sea alone is a house on the beach, with sand all around and under the lot; a cliff puts the house on a cliff top above the sea, a lake, a river gorge or a valley 10 m below, with a lookout deck over the edge (the drop is a local basin with its own lower water: the sea level and the land of the rest of the world stay exactly as the seed made them); a forest is a clearing in the woods with trees right at every free fence; an island puts the lot on an island with water all around, a bridge for the street and a jetty with a rowing boat (in the sea, in a lake, on a river, or a rock with sheer shores when combined with a cliff); a lake or a river means the lot stands on the shore. The street in front of the house differs from seed to seed as well: it passes by, ends at a turning circle next to the home, ends in a ring road around a green, is cut into blocks by cross streets and a back street, or is a dirt track through the trees. A ๐Ÿ”๏ธ mountain switch raises a mountain wall right at the fence. The seed composes the scene from the switches under compatibility rules (a side of the lot holds one thing), so the same switches give different topologies: the river runs along the back or under a street bridge and past the side fence; the sea shore runs straight, steps back into a cove or sends an inlet up to the street (a cape); the mountain stands at one side, behind, on two sides (a valley), in a corner or all around (an amphitheatre), drops into the sea and lets the river through a gorge. They still combine: with the sea behind, a small lake and the river move to one side, and the river falls into the sea right beside the home: it runs behind the neighbours' lots and opens through a funnel-shaped mouth in the beach, with a sand bar in front of it where the swell breaks and calm river water behind. The seed also decides where the mountain and the forest are, how big the lake is, how hilly the land is, how built-up and how lively the street is. Around it lie meadows, snow, desert, tropics, an autumn forest or sakura groves, and big spreading trees grow on the lot. By the sea with a beach the waves come in sets and surfers ride the tall ones. On some islands a ferry sails instead of the bridge: it runs on a timetable between two quays, two ferrymen work it in shifts and live in the house by the quay, and the bus from town turns around there. A rowing boat is moored at the jetty: take the oars and row wherever the water reaches.
  • Everything is made of 20 cm blocks. The house and the lot are built of blocks that can be placed, removed and repainted (material + colour): one at a time, by flood-filling a surface, or as a box between two corners. Undo is supported.
  • A catalog of 200+ items, 70+ of them animated: clocks show the real time, fans spin, the fireplace burns, doors open, car wheels roll. Items snap to a grid on floors, walls and ceilings, rotate by 45ยฐ and sit on tables and nightstands with no gap. Colours and materials can be changed before and after placing, and favourite variants are kept in favourites lists.
  • Animals. 28 species: a cat and a dog live at home, cows, sheep and horses graze in meadows, deer, foxes, hares and bears roam the forest, birds fly, ducks, swans and fish swim, camels live in the desert and penguins in the snow. They walk, hop, fly and swim; any animal can be adopted from the ๐Ÿพ catalog tab and petted with a tap. Pets, wildlife, people, aliens ๐Ÿ‘ฝ (little green men and flying saucers) and magical creatures ๐Ÿ‰ (dragons, unicorns, fairies) are categories that can be switched on and off, on the start screen and in the โ˜ฐ menu. Wild animals have homes built into the landscape: burrows, fox dens, bear and wolf caves, nests on snags and cliffs, beehives, hay sheds, chicken coops, penguin rookeries. They wander around the home, dive into it when you come too close and sleep there at night; the dog has a kennel by the porch. Everybody really walks, but only those within about 34 m of the player are simulated: the rest stand frozen and carry on when you come back.
  • An endless world. A street with neighbours' houses and shops, mountains, lakes, waterfalls and nine biomes: meadows, a forest of huge trees, snow, desert, savanna, tropics, swamps, an autumn forest, sakura groves and a forest of giant mushrooms. Trees are grown with the space colonization algorithm (Runions et al., 2007) and the pipe model for branch thickness, so every tree has its own limbs, twigs, leaf clumps and roots snaking over the ground. Pixel surf rolls onto the sea shore, reeds and water lilies grow in lakes, and the biomes are dotted with fallen logs, boulders, berry bushes, pumpkins, stone lanterns, termite mounds, ice spikes and glowing mushrooms. The landscape is generated deterministically from the seed around the player; the distance hides behind a "fog of war" (white by day, black by night) whose radius goes up to 640 m and is set with a slider in the โ˜ฐ menu. Or turn on ๐ŸŒŽ Little planet: the world bends down beyond the view distance like the surface of a tiny globe, and the horizon becomes a curve.
  • Cities, towns and villages. The seed scatters settlements over the world: nine architectural styles tied to the biomes (half-timbered, Mediterranean, Nordic, East Asian, adobe, modern with skyscrapers, brick, rustic, stilt huts), seven street layouts (grid, rays and rings, winding lanes, an old core inside a grid, a village along a road, around a green, at a crossroads), a landmark by the main square, fountains, wells, markets, town walls, fields and parks. Each one has a name, shown when you are there.
  • Shops. Ground floors in settlements hold 23 kinds of venues (supermarkets with aisles, chillers, checkouts and a car park in front; bakeries, pharmacies, clothes, hardware, books, cafรฉs, banks and more; a general store and a tavern in villages), each with a pictogram sign over the street. Interiors are the finest level of the world generator: they are built only when you come close.
  • Public institutions. Every town and city has a school, a kindergarten, a hospital, a police station, a fire station and a town hall (cities add a library and a second school); villages may have a small school or a fire shed. They are rows of the CIVIC table in 34_settle.js (lot, forecourt, floors, colours) placed before the houses, and venues of 47_venue.js (sign, hours, job), so their interiors (classrooms, wards, play room, cell, engine bays with inn.bays) are generated only next to the player and people find them through the same spots lists (lie for beds, cell for the holding cell). Playgrounds (plan.play) stand in kindergarten yards and in every other park.
  • Fire and events. 79_fire.js: the ๐Ÿ”ฅ lighter sets a forest tree on fire. A fire is one record (the tree's cell on the 30-cell tree grid, its age, the age at which it is out, the call of the brigade); when each tree around catches fire, burns out or is put out follows from that record in closed form, Land.gen asks Fire.of(gx, gz) while drawing a tree, and only the few columns of a tree are rebuilt (Land.regen) when its state flips. After ten minutes the record expires and the generator draws the forest as before. 79_evt.js is the shared event interface: Evt.emit({k, x, y, z, r}) by whoever causes something, Evt.call(service, ev, who) by whoever notices it, services listen on Evt.on.call. Fire.callOf(f) gives the call to the vehicles (Town.dispatch).
  • Townsfolk. Settlements are inhabited: residents leave their houses, walk the streets to shops, benches and bus stops, browse, queue, sit in cafรฉs and go home; shops have staff during opening hours. Nobody is stored or stepped: where a resident is follows from the world seed and the clock, so far people cost nothing and a reload changes nothing.
  • Minimap. A round top-down map in the corner turns with you and shows the house, the lot, the street, water and everything you have built; an arrow on its rim always points home and the distance is shown below. It costs almost nothing: no extra render pass, just a small bitmap sampled a few hundred texels per frame from blocks already in memory and moved with a CSS transform. A bright line on it is the route home along the roads: the home street, side streets, the road to town and the town streets; it is built from the same seed-driven road generators, not searched in voxels. The โˆ’ and + buttons under the map (or a tap on it) enlarge it: the circle grows faster than the picture inside, so each of the five steps shows more, from 42 to 294 m around you.
  • VR mode. The ๐Ÿฅฝ button shows up wherever some VR path works. With WebXR (Quest, Vision Pro, Android Chrome) it opens an immersive-vr session: left stick walks, right stick turns in 30ยฐ steps, the trigger acts, A / X toggles flying. iPhone and iPad have no WebXR, so there the gyroscope turns the view (a window into the world), and on a phone a second tap splits the screen into two lens-corrected eyes for a Cardboard-style viewer: tap to act, hold to walk where you look, double tap to fly. The scene is simply drawn once per eye into the same low resolution target (src/game/76_vr.js).
  • Flying. Fly over the world with ๐Ÿชฝ; the flying speed has its own setting in the โ˜ฐ menu, up to ร—16.
  • Light. Daylight comes in through windows and openings, lamps from the catalog light up the rooms, and day and night cycle on their own, and the ๐ŸŒ™ button skips to the next nightfall or morning.
  • Wind. Variable, with gusts and lulls: it sways tree crowns, grass and flowers, sends waves across meadows and drives clouds across the sky. You can hear it, and its strength is set in the menu.
  • Weather. Deterministic from the seed and the world clock: voxel clouds are objects that travel with the wind, grow and melt; it rains (or snows) exactly under a dense cloud and thunders under the darkest ones. Cloud shadows cross the land, rain hangs under a far cloud as a veil, bolts light the world and thunder arrives late by the distance. Neighbours caught outdoors run home. โ˜ฐ โ†’ ๐ŸŒ World โ†’ ๐ŸŒฆ๏ธ picks auto or a fixed weather.
  • Music. An endless calm score that the game composes as it plays (16_music.js, Web Audio synthesis, no audio files): the notes are a function of the world seed and the number of the phrase, drawn level by level (key โ†’ section with a chord progression, a rising "call" motif and its answer โ†’ phrase โ†’ notes), so the piece never repeats and every world has a melody of its own. A harp-like ripple of chord notes, a bass pulse and soft percussion (a shaker, a low thump, a wooden click) carry it forward in the rhythm of a groove; five grooves (running sixteenths, three-three-two, a lilt in triplets, a bounce on the off-beats, a low-high figure) take turns every six sections, two to three minutes, in a shuffled order with a breath in between. The mood follows you: gentler at home, running in sixteenths and calling outdoors, higher and lighter with sparkles in flight, slower at night; the biome picks the timbre. Music and sound effects have separate switches in the โ˜ฐ menu. node tools/music.test.mjs checks the score without sound, G.Music.render(seconds, mood, seed) renders it off line.
  • The sea. A real swell made of voxel steps: trochoidal (Gerstner) waves with sharp crests and flat troughs, deep-water dispersion, sets of tall waves, shoaling by Green's law and breaking at 0.78 of the depth. Waves break into foam at the beach, straits and bays stay sheltered, lakes and rivers stay calm. Surfers ride the crests, the rowing boat climbs the waves. Every water surface mirrors the sky at a low angle and carries a path of sun sparks.
  • Saves. Several worlds are kept in the browser, and reloading the page brings you back to the same spot. A world can be exported to a file and imported back.
  • 27 interface languages, switched at any moment in the โ˜ฐ menu with no reload: English, Chinese, Hindi, Spanish, Arabic, French, Bengali, Portuguese, Russian, Ukrainian, Belarusian, Indonesian, Urdu, German, Japanese, Marathi, Telugu, Turkish, Tamil, Vietnamese, Korean, Persian, Italian, Swahili, Punjabi, Thai and Filipino. The world never depends on the language.
  • Updates and offline. A small service worker (sw.js) keeps one whole copy of the game page, so the game starts with no network. A new version is downloaded in the background and checked against the SHA-256 in version.json; only then does the update button appear with short release notes, and it works with no network. A download that fails or stops half way shows nothing and leaves the kept copy alone.

๐Ÿ—บ๏ธ Roadmap

What comes next in the world, as batches of one pull request each: docs/ROADMAP.md (740 planned additions in 47 batches).

๐ŸŽฎ Controls

Touch screen Keyboard and mouse
Walk joystick in the lower left of the screen W A S D
Look drag a finger over the rest of the screen drag with the mouse button held
Field of view pinch with two fingers (landscape), or the โ˜ฐ menu slider mouse wheel
Pick an item / action short tap click
Use: doors of cars, seats, check-in desks, curtains, lamps, instruments the green button (hold for more) E (hold for more)
Catalog ๐Ÿ›‹๏ธ B
Place / rotate / 45ยฐ โœ… / ๐Ÿ”„ / โ†—๏ธ Enter / R / T
Blocks: place, remove, paint ๐Ÿงฑ โ›๏ธ ๐ŸŽจ 2 3 4
Fly, jump ๐Ÿชฝ, โคด๏ธ F, Space
Hide the interface ๐Ÿ‘๏ธ H
Pet an animal, greet a neighbour / release your own animal tap / โ›๏ธ and tap click
Undo โ†ฉ๏ธ Z

๐Ÿงฉ How it works

  • One file. index.html holds everything: the minified game code, the descriptions of the catalog items and all the languages. A catalog item is not stored as voxels: the bundle carries the few lines that describe it (boxes, cylinders, moving parts) and the game draws the models from them on start, a few per frame. The 25 language packs are packed by a small text model (src/game/05_unpack.js), which beats the server's gzip on short texts in many scripts, and the chosen one is unpacked in the browser.
  • GPU rendering (WebGL2), no libraries. Blocks are merged by a greedy mesher with ambient occlusion and drawn in large batches; static furniture is baked into shared buffers. The scene is rendered at a low resolution and upscaled without smoothing, which gives the pixel-art look with outlines and dithering.
  • The world. Real blocks in sparse chunks near the player, simplified tiles at two levels of detail further away (from the same terrain function), and fog beyond that. Everything outside your lot comes from the world seed only.
  • Street life. Neighbours and cars are lightweight instances of catalog models with animated parts (swinging legs and arms, rolling wheels). Cars brake for whatever is ahead of them in their lane, and people wait at the curb until every approaching car can still stop.
  • Light is computed on a grid around the player in small portions and stored in a 3D texture.

๐Ÿ› ๏ธ Development

npm ci                        # once: the minifier (terser) and the headless browser driver
node build/build.mjs          # build index.html (MINIFY=0 keeps the code readable)
./tools/publish.sh "message"  # build + commit + push (GitHub Pages serves main)
node tools/shot.mjs ...       # run in headless Chrome: steps, touch gestures, screenshots
./tools/screens.sh            # refresh preview.png (the link preview picture)
DRY=1 BUILD=readme node tools/release.mjs   # take the README screenshots into tmp/release/ to look at them
node tools/icons.mjs          # regenerate the icons
node tools/test.mjs           # every tools/*.test.mjs side by side (name or name:part runs only those; --list shows the jobs)
                              # GitHub runs each test, and each part of a long one, as a job of its own on every push (workflow "tests")
node tools/undo.test.mjs      # undo / redo: the command model, then the buttons and the history panel in headless Chrome
node tools/place.test.mjs     # placing furniture: the offered spot is never behind a wall (a stage of blocks and a scan of the house in headless Chrome)
A=dir B=dir node tools/update.test.mjs   # updates: two builds (index.html + version.json each) behind a failing server, the button only after a whole download, the update with no network
node tools/gen.test.mjs [part]    # the world generator without a browser: determinism (also in workers and Rust vs JS), houses, towns, land, roads, shares over many seeds, golden hashes
node tools/gen/view.mjs house '{"seed":5,"type":"riad"}' out.ppm   # a picture of a lot (or `land โ€ฆ cx cz n`) to look at a failure of the generator tests
  • Game sources live in src/game/*.js (concatenated in name order), styles in src/style.css.
  • Catalog items are described in a voxel DSL: build/dsl.mjs (reference in the file header), the items themselves in build/items/*.mjs, English names in build/i18n.mjs. Check an item with an ASCII preview: node build/check.mjs --show <id>.
  • Interface strings are written as tr('ะฟะพ-ั€ัƒััะบะธ', 'in English', ...args) with two plain string literals; {0} puts an argument in, {0#one|other} picks a plural form, {g:he|she} a form by the gender set with sexed(sex, text). Russian and English live in the code, the other 25 languages in i18n/<id>.json keyed by the English text; the build packs them all into the bundle (build/pack.mjs), so the language switches offline. The build fails when a text has no translation in some language: node build/lang.mjs --missing lists them as JSON to translate, node build/lang.mjs --merge file.json puts translations in, --prune drops unused keys (LANG_WARN=1 turns the failure into a warning while you work). node tools/i18n.test.mjs checks the same plus the templates.
  • Saves still use the hsh. localStorage prefix and the hsh IndexedDB database from the game's former name, so existing worlds keep working.
  • Screenshots never go into git. A build that adds tools/shots/<build>.mjs gets its pictures taken by the release workflow and attached to the GitHub release v<build>. The README pictures are the list in tools/shots/readme.mjs: to refresh them, re-export it from the tools/shots/<build>.mjs of the next build and point the links above at that release.

๐Ÿ“„ License

MIT

About

๐Ÿก Voxel pixel-art house builder (single-file browser game)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages