The Wonj

Devlog 6: light, day and night, a trader, a glider, and sound

A long day on the RPG. The world got new light, shadows and a full day and night, the first loop closed with a trader to sell to and a glider to buy from him, and the game learned to make sound, along with a new tool for making it.

The light

The picture got a pass on light. Colours are now tone mapped, so bright snow and sky keep their detail instead of washing out to white. Light bounces off the ground into the shade, the creases where blocks meet darken a little, surfaces catch a sheen that's sharpest on water, and looking toward the sun gives a soft lens flare.

Each effect switches on and off from the chat while playing, which made it easy to compare them in the game itself and keep the ones that look right. Outlines, bloom and a distance haze are in there too, and start switched off. The Object Creator switches all of them off, so the colours being edited are the colours seen.

A figure standing on a dark chimney top in snowy pine woods, the sun bright and haloed above it and a faint ring of lens flare beside it.

Shadows from the sun

The sun moves now, crossing the sky from east to west and turning warmer and dimmer as it nears the horizon. Shadows follow it. For every pixel on screen the game traces a path toward the sun through a copy of the world kept on the graphics card, so a shadow's edge is the exact shape of the blocks casting it at any angle, and nothing shimmers or crawls as the sun moves. Trees, boulders and houses all cast them; people don't.

That copy of the world is filled in the background as land loads or changes, a region at a time. At the very edge of the loaded land a shadow can flicker for a moment while a new region arrives.

Snowy ground in a town under the sun, with its lens flare: a house and pines cast block-edged shadows toward the camera across the snow and a dirt path, and a villager stands in the middle distance.

Day and night

The sun now goes all the way round. After the day comes dusk, the sky warming to sunset and fading to its last light; then night, with the sun passing under the land; then dawn, and the day again, with no jump anywhere. The sky blends between painted skies for day, sunset, dusk and night by how high the sun is, with a warm glow on the sun's side, and the distant haze takes the colour of the horizon, so far hills fade into the sky at every hour.

Dusk over a snowy town and green hills: a deep blue sky with the first stars, a pink glow along the horizon, the land dimming.

Night has a moon, rising opposite the sun, its disc fading in as it clears the horizon, and stars fade in across the sky as the light goes. The moon is a light of its own: while it's higher than the sun it casts the shadows and the sheen, so by night the land is dim and blue rather than black.

Night over snowy hills: a full moon and stars in a dark sky, the trees black, the snow lit a pale blue.

A trader in every town

Every town square now has a trader, a person like any other with a pack and a purse of his own. Bring him what you found out in the hills and he'll buy it. Every person now carries coins, and yours show under your pack.

His offer comes only from what he has: the more of a kind he already holds, the less he pays for it, and the emptier his purse, the less he pays for anything. Once his pack is full he buys nothing. Coins and goods are never made from nothing; they only change hands, so his prices fall as you sell to him and stay down.

Press E near him to open the trade: each kind in your pack with his offer and how many he holds, a button to sell one or all, and both purses. While trading you stand still.

The trade screen open in a snowy town square in front of the trader: your finds listed with his offer, how many he holds and buttons to sell one or all, his wares below with his prices, and both purses. A chat line at the bottom left reports a teleport.

Buying, and the glider

Traders sell as well as buy. Under your finds, the trade screen lists his wares: his price, how many he holds, and a button to buy one, greyed out when you can't pay or your pack is full. His price comes from the same rule as his offer, seen from his side, with a markup, so selling something and buying it straight back never pays. What you pay goes into his purse, which lets him pay more for what you bring him next.

The trade screen open beside the trader in a town square: his wares, herbs, flowers, a crystal, a relic and a glider, each with his price, how many he holds and a buy button, with your purse empty and his full.

Every trader keeps a glider among his wares. Buy one and you can open it in the air: press Space mid-fall and it spreads above you, slowing your fall to a drift while you steer at running speed. Space again or landing folds it. It's made of wood, linen, rope and leather, shows on your back while it's open, takes a slot in your pack, and is lost with the pack. While gliding you can still pick things up, but not swing or trade.

The player gliding side-on under the open glider against a clear blue sky, low over sandy terraces, with trees on the horizon. The player gliding close to the camera over green terraced slopes, with a pale cliff face, snowy ground and pines behind.
The player seen from behind, gliding under an open striped glider high above green hills, with sakura trees, mossy boulders, sandy terraces and a lake below and snowy pine slopes fading into the haze.

That closes the game's first loop: go out and gather, come home and sell, and buy a glider for getting back out.

Sound, and the Sound Maker

The game can play sound now. Sounds placed in the world fade with distance and pan as the camera turns, with a little random pitch so repeats don't sound identical, and the game falls quiet while its window isn't in front.

Making those sounds is the job of a new tool beside the Object Creator: the Sound Maker, its own program. A sound is a short recipe of settings: the wave, how it rises and fades, its pitch and slide, vibrato, a jump in pitch, repeats, filters and volume. Every change plays at once. Starting points roll a fresh sound of a kind (pickup, hit, jump, blip, step or explosion), Randomize rolls anything, and Mutate nudges what you have. It works in the style of sfxr, the classic little sound generator.

Each sound saves as a readable text recipe with a sound file baked beside it, which the game plays as it is. The same recipe always bakes exactly the same sound.

The Sound Maker: wave buttons across the top with Square selected, sliders for the volume shape, pitch, vibrato, pitch jump, square duty, repeat, filters and volume, and starting points on the right: pickup, hit, jump, blip, step and explosion, with Randomize and Mutate.

No holes at the edge

Land loads nearest first, but on a new game the far edge used to show holes for a few seconds where land hadn't arrived yet. Now the haze closes in to the edge of what has loaded and opens back out as the rest comes in, so the gaps stay hidden. Once everything is in, the view reaches exactly as far as before. Play also starts with the camera a little further back and higher, so there's more of the world in view from the first moment.

A small town in the snow under a bright sun: two houses, a dirt path and a villager, with pine woods behind fading into haze on a far hill.