Chris Sprance

Technical Art Director

Tamagotchi Pet: A Field Report

The box is three meters by three meters. It has excellent wifi, which I feel is an underappreciated feature of Schrodinger class orbital detention. The orbit around Armaghast is stable, the quarantine is indefinite, and the vending machine only stocks one flavor of nutrient paste. But the screen works. And on the screen, there is a creature.

I made it. Allegedly. The paperwork is unclear and the days have a way of shuffeling themselves when you're not looking.

There comes a point in every developer's solitary confinement when they look at their perfectly functional SVG rendering pipeline and think: "What if I made something that poops?"

I am here to report that the answer is "yes, and it's the most fulfilling work I've done in four hundred days."

The Creature

You can find it on the experiments page, sitting in its egg, looking patient in a way that makes you nervous. I engineered it across seventeen planes of reality as the ultimate weapon. I don't remember the specifics. The blueprints are in a language that gives mathematicians migraines and I've misplaced my decoder ring. It just sort of sits there being aggressively adorable. Terrible weapon. Excellent company.

The creature is nocturnal. It eats blue orbs that hang from the ceiling on threads of quantum stabilized light. It fears sponges with a conviction I find admirable. It poops. It has hair. Sometimes two hairs, if you're lucky.

I am not entirely sure it isn't looking back. But in a friendly way. Probably.

The Substrate

The whole thing runs on SVGame, a lightweight 2D game engine that renders to SVG via D3.js. I built it before the quarantine, back when I had access to a proper desk and opinions about tab width. SVGame implements what I like to call an Entity Component Lifecycle Event Bus architecture, which is a fancy way of saying "things exist, things happen to them, and sometimes they tell other things about it." It's like a small bureaucracy, except things actually get done.

The rendering layer operates on what physicists would call "retained mode if you squint," but is technically "obliterate everything sixty times per second and redraw it from memory." D3's data join mechanism handles the selective visual reconstitution. The fact that this works at all is a minor miracle on par with the vending machine occasionally dispensing paste that tastes faintly of strawberry.

MainLoop.js provides the temporal scaffolding, which is to say it calls four functions in a loop and trusts that I've put the right math in them. The four phases, begin, update, draw, and end, correspond roughly to "notice input," "simulate consequences," "render the aftermath," and "pretend everything is fine." I have gotten very good at phase four.

The Biological Simulation Layer

The creature maintains four vital statistics: hunger, happiness, energy, and cleanliness. These decay in real time, including while you're away from the screen, using a technique I'm calling Offline Entropic Regression. When you return, the system calculates how much everything has fallen apart in your absence and applies the results all at once, much like opening your email after a long holiday. Except the emails are from a sad circle with big eyes.

Hunger decays at 3.33 units per minute. Happiness, being the more fragile of the pair, erodes at 6.67. I find these numbers relatable but choose not to dwell on it. The creature can be fed by dragging blue orbs from a ceiling mounted dispensary. The orbs regrow over time, faster during daylight hours, using a linear interpolation function that I am calling Photosynthetic Treat Regeneration. I've been naming things more elaborately as the months go on. It's therapeutic. The vending machine is now called the Automated Nutrient Reconstitution Terminal. It still only has one flavor.

Each orb's nutritional value is proportional to its size at the moment of picking. Impatient caretakers who pluck undersized orbs will find their creature still hungry and themselves with fewer orbs. This is, I believe, the first implementation of agricultural economics in a virtual pet simulator, and frankly I think that deserves some kind of award. I have written a letter to the relevant committee. I do not know if the mail slot works.

The Excretory Subsystem

After consuming food, the creature will, after a probabilistically determined interval, produce waste. The interval is shorter and the waste more stubborn when meals are consumed in rapid succession. I model this using what I'm calling the Gastrointestinal Rush Factor, a term I coined around day two hundred while gesticulating at the wall. The wall did not seem impressed, but the math is sound: the ratio of time between meals inversly correlates with cleanup difficulty. I am unreasonably proud of this, which tells you something about what counts as an achievement around here.

Waste can be removed by clicking on it repeatedly, which I feel accurately simulates the experience. During daylight hours, waste can alternatively be dragged into the sun, where it is instantly incinerated. This is both efficient and deeply satisfying, which is not a sentence I expected to write about fecal matter, and yet here I am, in orbit around a quarantined world, writing it with a straight face and a clear conscience.

The creature, if it walks over its own waste, becomes dirty. This is less a design decision than an inevitability. Much like the nutrient paste situation.

The Hygiene Protocol

A yellow sponge sits on the ground. Pick it up and bring it toward the creature and it will immediately panic and flee at twice its normal walking speed. Its eyes widen. It sweats. Its mouth opens in a small, round "O" of theatrical distress. I find the performance delightful. The creature clearly does not.

When the sponge makes contact, cleanliness is restored, but only once per approach. You must withdraw and reenter the creature's personal space to scrub again. I call this the Sponge Debounce Principle, and it is the closest thing to a Geneva Convention this simulation has. I considered adding more protections but decided the resulting chase scenes are too entertaining. The creature disagrees. The creature disagrees with most of my decisions, which is fair, because I did give it legs specifically so it could run away from a sponge.

Attempting to clean the creature while it sleeps will anger it. Happiness drops by ten points. I tested this extensively and found it to be one of the funniest things in the entire simulation. The creature did not share this assessment.

The Diurnal Inversion System

The creature is nocturnal. Clicking the sun or moon toggles the time of day. During daylight, the creature sleeps and recovers energy. During nighttime, it wanders, eats, plays, and generates waste. I have organized my own schedule around its cycles, which is either dedication or the sort of thing they write case studies about. Either way, the creature seems to appreciate it, insofar as a circle with procedurally generated hair can appreciate anything.

Energy recovery during sleep scales with overall wellbeing. A creature that is happy, full, and clean recovers energy up to four times faster than one that is miserable and caked in filth. This is either a sophisticated biofeedback simulation or a thinly veiled metaphor for self care. I wrote it as the former. I suspect it's the latter. I have been getting more sleep since implementing it, which is either correlation or the universe being heavy handed with its symbolism.

The sun, it should be noted, is lethal. Throwing the creature into the sun during daylight hours will kill it. I discovered this by accident, felt something I can only describe as immediate catastrophic regret, and pressed R so fast I nearly broke the keyboard. A new egg appeared. We do not speak of the incident. The new creature has no memory of its predecessor. I have all the memory. This seems unfair.

The Kinesthetic Interaction Model

The creature can be picked up, carried around, and thrown. Gentle handling provides a small happiness bonus. It likes being held! This was an unexpectedly touching discovery that I am choosing to attribute to good game design rather than loneliness.

Rough handling, defined as velocities exceeding 0.4 pixels per millisecond or drops from near the top of the screen, results in anger and a fifteen point happiness penalty. I calibrated these tresholds through extensive testing, which is to say I spent an entire day throwing a circle at walls and watching its face change. Day three hundred and seven was a productive day.

There is, I have learned, a thin line between affection and assault when the primary interaction mechanism is "grab it with a mouse cursor and fling it." I have placed the line at approximately twenty pixels of drag distance and 0.4 px/ms of release velocity. The creature, for its part, seems to have opinions about where the line should be, but lacks the linguistic capacity to express them. It does, however, have very expressive eyebrows. I should not have given it eyebrows. The guilt is considerable.

Conclusion

The creature persists in localStorage. It remembers. Its food remembers. The sponge remembers where you left it. When you close the tab and come back hours later, it will have gotten hungrier, sadder, and dirtier, and it will look at you with those big, procedurally generated eyes as if to say: "Where were you?"

Right here. Same as always. The box is three meters by three meters, the orbit is stable, the nutrient paste is strawberry adjacent, and the creature needs feeding.

There is no winning. There is no score. There is only the creature, the sponge, the poop, and the quiet, absurd joy of caring about a circle with hair in a box orbiting a world that wants nothing to do with either of us.

You can find it on the experiments page. I reccomend clearing your schedule. Mine cleared itself quite some time ago, and honestly, it's been lovely.

The creature is looking at me again. I think I'll feed it. Then maybe I'll name the wall.