Abyss Vanish

ABYSS VANISH / DEVELOPMENT JOURNAL

Foodie Tale's First Night: Chasing a Cycles Night

November 6 to 7: a pig with 25 yuan at a 1980s Taiwanese night market; the engine's night tuned after the one Cycles rendered, and the first night is on the site to play in a browser.

On November 6 I said: let's start making the game. Foodie Tale's first night is a small story: a pig with 25 yuan left in his pocket walks into a 1980s Taiwanese night market at eight in the evening, and his appetite is always bigger than his pocket. By the evening I had seen the same town rendered at night by Cycles, and it was lovely, so I asked: how does Cycles work out that soft light? This entry is the answer, and how the engine caught up step by step. Early on November 7 the first night went up on the site, ready to play. Agents wrote the code, made the models and took the measurements; I asked, looked, and said whether it was good.

The first night: the last few coins

Development
Two ten-yuan coins and a five in his pocket. Four stalls on the street: grilled sausage 10, fruit shaved ice 15, noodle soup 25, fried chicken 30. Click a stall and he walks there, with the vendor's offer over their head; press the red button on the card and the vendor cooks and serves, he eats, and writes it into his taste notebook in his own words.
Difficulty
25 yuan buys the sausage and the shaved ice, or one bowl of noodles; the fried chicken is always just out of reach. All four cost 80, so one night can never fill the notebook. That is on purpose: every coin is a choice.
What changed
When money runs short, people are the other way. The fried-chicken vendor sees him hesitate and asks a favour: fetch a bunch of basil from the grandma at the arcade grocery. Bring it back and he fries a piece to taste for free, and that goes into the notebook too. When nothing is in reach and no favour is left, the card becomes the night's notebook page, and "another night" starts again.
Still open
A night is not saved. The vendors are Gen Town residents standing in; the prices are design values, not period facts, and the Taiwanese touches are design, not research.

A face that eats

Development
The hero is a generated pig, and at first he had no face. This game is about eating, so he needed a face that eats.
Difficulty
The rig the AI made had the lower half of his head on his neck and chest. And the engine had no shape keys, so a cheek could not puff out.
What changed
The engine gained shape keys and their animation tracks. The face was built piece by piece by small programs: eyes, lids, the inside of the mouth, a tongue, brows; the head given back to the head bone, 13 face bones, the jaw taking everything below the mouth. The shape keys are each cheek, a smile and flaring nostrils, and "Eat" is a 4.4-second performance: a sniff with the nostrils flaring, a bite with the tongue forward, chewing side to side with full cheeks, a swallow, a smile. It plays over his body standing as it was.
Still open
Only the hero has a face; the stand-in vendors are still Gen Town's wooden dolls.
The pig up close eating the grilled sausage, eyes closed and smiling
Eating the grilled sausage, the web version in Chromium (WebGL 2), 1024 × 640.

Why Cycles' light is soft

Development
The same town rendered at night by Blender's Cycles looked lovely to me, and I wanted the engine to draw that night, so first I asked: how does it work out that soft light?
Difficulty
Cycles is a path tracer: each pixel averages hundreds of light paths (the comparison below used 160 samples). The softness comes from a few things: lights have size, so shadow edges are soft; light bounces, so the street carries warm colour onto the stalls' fronts; glowing surfaces are lights themselves; the whole sky is one huge light; then a denoiser and the AgX tone curve. The engine has about 16 ms a frame and cannot work that way.
What changed
So each one gets a stand-in: filtered shadows for the soft edges; a cheap "bounce" layer for the bounced light; a small light in front of each glowing surface; ambient light and ambient occlusion for the sky; and the same AgX for the tone.
Still open
A stand-in is a stand-in. The bounce does not ask whether anything is in the way; it goes by which way a face turns, and the ambient occlusion darkens it.

The same units, the same reach

Development
On the night of November 6 the target was set: the engine's night is that Cycles night. The town's export carries that night's settings and marks its lights as physical units.
Difficulty
Two of the differences were the engine's own. One was tone: AgX had been only for the studio light. The other was units: in the same units as Cycles, from the same file, the engine drew the town far darker than Cycles. The lanterns' lights, 4.5 m up, had a range of 3.5 m and never reached the street. That range is a setting of EEVEE, Blender's other, real-time renderer; Cycles has none.
What changed
AgX became a layer for any light, on Metal, WebGL and Vulkan. A point light of W watts is turned into the engine's brightness the way Cycles lights a surface, and a light now reaches until it gives a five-hundredth of the engine's unit, from 1 to 100 m: the town's lamps reach 9.7 to 15 m, the stalls' lights 94 m.
Still open
The brightness was right, but colder than Cycles: the stalls' fronts and the people under the lamps stayed dark.

Adding warmth

Development
Looking at the two side by side, I answered: Yes, add warmth.
Difficulty
The engine lit only faces turned toward a lamp; in Cycles the light bounced off the pale street onto the stalls' fronts and the people. Glowing windows and signs in Cycles light what is near them. And the market roof was white in the engine and red in Cycles: Blender's exporter carries no colour made from noise, ramps, bricks or mixes, and none hidden inside node groups.
What changed
Each light now also gives a little of its colour back from all round, weighted by facing, so a face turned square away takes none (.25 fell short, .5 was no closer, so .35). Every glowing object without a lamp gets a small light half a metre in front of its glowing faces, 72 in the town, at night only. 60 materials have their colour carried over as an average, and the roofs are red and blue-green again.
Still open
Seeing it in the window, I said the overall feeling was there. It is not identical; the two pictures below compare them.
Four views, three each: the engine night before the warmth, after bounce and glow lights, and the Cycles target
Four views, left to right: the engine before the warmth, after bounce (.35) and the glow lights, and the Cycles target.
The engine night as published beside the Cycles target, four views
Left, the engine in real time as published on November 7; right, Cycles at 160 samples. Four views: the start, down the street, a stall up close, the street from above.

Onto the web

Development
On November 7 I asked about trying a web version. It is the engine's own host compiled to WebAssembly and drawing with WebGL 2; characters' textures are fitted to 1024, and the pig keeps 1024 × 1048 so the eating close-up stays sharp.
Difficulty
It got stuck three times. The web build's texture fitter took the end of a character file as its texture, but the new character files keep shape keys after the texture, so the pig was refused. A hash constant in the script compiler did not fit 32-bit WebAssembly, so the host did not build. And the web checker's local server queued only 5 connections while the page fetches 24 files at once, so on macOS it never started.
What changed
All three were fixed in the engine. Then the whole first night, 10 steps from the start to "another night", ran on the Mac (Metal), in Chromium and in WebKit, with the same results. The web version is 1,788 files, 103 MB unpacked, and a first visit moves 36.2 MB. From a local server the first frame came at 2.0 s in Chromium and 2.8 s in WebKit. From the public address (a Mac in Taiwan): 36.9 s for the very first visitor, before Cloudflare held the files, and 14.1 s for a new visitor after that.
Still open
Checked only in desktop browsers; phones, tablets and Firefox are not checked yet.
The same four moments, native Metal on the left and Chromium on the right: the start, the sausage served, the pig eating, the notebook page
The same four moments, native (Metal) on the left and the web (Chromium, WebGL 2) on the right: the start, the sausage served, eating, and the night's notebook page.

Play Foodie Tale's first night

閱讀中文版All entries