trivia:
• started working on the game as a side project 4 days ago, landing ~1,150 PRs
• every time i found an issue in the code i asked bot to make a lint rule against it
• used TLA+ heavily to find bugs in the game's various state machines: the story, cutscenes, the game's systems. there are many formal verification skills, one for each major system
• i put context into the filepaths: code that runs every frame or every tick gets a .hot.ts extension, and a lint rule bans allocating in it (no object literals, closures, new, etc.), so the game loop creates almost no garbage and GC doesn't cause stutters
• game engine is mostly custom. three.js draws the 3D scene, but the simulation, post-processing and audio are all ours
• the simulation is fully deterministic, so every run replays exactly from its inputs. when you post a high score, the server replays your whole run to check it isn't cheated
• we generate dynamic og:images for every run based on your final stats, and it's all localized too! the game supports 10 languages
• my favorite feature: the music seamlessly transitions into different music for the various biomes, continuing the previous melody
• no audio files. all the music and sound effects are synthesized live in the browser by a custom Game Boy-style chip (two pulse voices, a wave voice, noise) plus a synthwave layer. the songs are written as text in code
• all the pixel art is code. every sprite is a file drawn with one shared palette and packed into a sprite atlas at build time
• it runs inside an X post, from the 245px card up to full screen. the bar is 60 fps with 500 enemies on a mid-range phone
• the build fails if the first download goes over budget. it's about 124 KB gzipped right now
• bots play the game headless to tune each difficulty against target survival rates
• comments are banned by a lint rule. if code needs explaining, the fix is a better name or a test
Today I spent a lot of time refining our admin portal. I probably haven't shared this before but https://t.co/YpguK8fv8g doesn't run on Shopify. I made the entire service myself and self-hosted it for the same cost as the Shopify subscription but with 10x more control. Really the era of personal software.
Having our own backend unlocks some crazy potential. I can treat the storefront like a real walk-in store. Every rack is customisable, every click is trackable. I can decide when a customer sees a particular item. I can even decide which combination of clicks unlocks a certain discount.
It's become quite a project for me to optimize conversions. For a small business, we can only spend so much on ads. So two things are really important to me:
1. Making products that people actually want
2. Make a store where people love to shop
I’ve never paid good attention to tests but they have become a mandatory part of even the smallest repos I create these days.
Building is so much faster if you invest in writing tests. What a weird time. Anybody else doing this?