Moondog, day 20 (9 Nov): the Sunken Ruin comes alive, and the town starts to play music

Around 90 commits. The morning went into making the Sunken Ruin, the first dungeon, feel inhabited. The afternoon went into music, for NPCs and for players.

The Sunken Ruin

Its creatures now make sounds: calls, footsteps, attack noises. There are noises off in the dark too, placed with markers round the first level, so you hear something before you see it.

The yanari moved in. They're gangs of tiny oni who roam the first level, and they took over the kobolds' giggles (they suited the yanari better).

Then I dressed the level properly: the builders' kitchen, sleeping halls, storeroom, well room and workshop, plus the Moon Hall, a gathering hall and a memorial. The design point I care about here is age. The builders left thousands of years ago, so nothing perishable of theirs survives. The straw pallets and cloth hangings are gone. Buckets, barrels and crates are just rings of rust stain and flakes. A winch is only its stone posts. The iron that lasted is crusted with rust. Round each of the nine kobold nests are the kobolds' own fresh things: sleeping hollows of carried-in dirt, rags, gnawed bones. You can read who lives there now and who lived there before.

I rebaked the navigation after each pass and spread the east hall's tables 1.4 m apart, so there's room to walk between them.

Dungeon bugs

  • Creatures walked through walls. Chasing, fleeing, patrolling and retaliating all stepped a creature in a straight line at its target with no wall test, so kobolds simply ghosted through stone after players. Near a dungeon those moves now follow the navigation mesh, and any step that would cross a wall is undone.
  • Wanderers stuck in doorways. The dungeon's navmesh has no clearance from walls, so a wander path hugged each corner, and the wall-avoidance code then put back every step that came too close. A yanari stood at its first doorway for good. Wander paths are now pushed half a metre off the walls, and a creature that can't move for three seconds picks a new path.
  • Loot drops where the creature died, on the dungeon floor under it, including kills by poison and by pets. It used to land on the hillside overhead.
  • The camera shake measured from the hillside above the ruin instead of the dungeon floor.

Night vision

Each race now sees in the dark to its own degree. Catfolk see well, the Huma not at all. It lifts the view at night or underground but never turns it into daylight. It took three goes to get right:

  1. My first version kept resetting the ambient colour to one captured at login, fighting the sky system, which sets it whenever the sun moves. The view dimmed for a moment every time.
  2. Leaving the ambient colour to the sky fixed the flicker but halved the night vision.
  3. I compared the sky's night blue by its brightest channel, but by linear luminance it's about a sixth as bright as the old grey. Switching the comparison to linear luminance brought it back to full strength.

Music

NPC musicians, in four steps:

  • Twenty instruments as items, a music tracks table and an admin page for it.
  • In the evening and at night a free musician may start a tune, solo or in an ensemble with other musicians nearby. Only one performance runs in an area at a time, with a rest after each.
  • The client shows the performance and plays it. I added twenty instrument-playing animation clips to the player rig and fitted them to every race body. The drum clips were re-posed so the sticks actually land, and the Old Woman of the Mountain plays her taiko and koto. A starter tune exists for every instrument for now, with proper compositions to follow.

Then players: music skills, songs learned from NPC teachers, and playing a known song on an instrument you own. Your skill is rolled against the song's difficulty, so a fumble means nothing starts. Moving, drawing a weapon or taking a blow stops the song. Playing a song through trains the instrument.

Also today

  • Arrows fly a real arc with air drag and keep flying until they land, instead of vanishing at their range. A bow's range now sets its launch speed.
  • The compass kept breaking. Items meant never to wear were given a durability of 0, so the cleanup that removes broken items deleted them on your next craft or swing. They now have no durability at all.
  • Account sign-ups now go through invite keys, with bans managed from the admin side.
  • Placeable castle parts for building your own: a keep, stone walls with a parapet, corners, a two-storey tower, a gatehouse and a timber bridge over a moat.
  • A dozen more yōkai, among them the ikiryō, whose soul-cord now stays on the ground.