DEV Community

tobeficv
tobeficv

Posted on AI-assisted

I built a 3D startup tycoon in a single HTML file (and open-sourced it)

Founder's Way: the title screen and the headquarters office

Founder's Way is a 3D startup tycoon that runs in the browser. You start in a garage with your own business idea and try to grow it into a headquarters downtown under realistic costs, taxes and churn. It's open source (AGPL-3.0), and the whole game is one HTML file.

β–Ά Play: https://tobeficv.github.io/founders-way/
πŸ’» Code: https://github.com/tobeficv/founders-way

Here are a few things I learned building it.

1. One HTML file, no build step

The game is a single index.html of about 1 MB: CSS, the simulation, the 3D scene, five languages and the pixel icons. The only external script is three.js r128 from a CDN.

That sounds like a bad idea, and for a big team it would be. For a solo project it has real benefits:

  • Anyone can play it instantly. It runs from GitHub Pages, from an itch.io embed, or from a double click on the file.
  • Every merged change goes live in about a minute. GitHub Pages serves main and there is nothing to build.
  • Contributors don't need a toolchain. Open the file in a browser and edit.

The cost is navigation inside a huge file. Clear section headers and grep help a lot.

2. Making a voxel office cheap to draw

Early versions froze WebGL on a mid-range laptop. The title screen, a full headquarters with dozens of people, was making about 1,700 draw calls. Three changes brought it down to about 570, with the same ~105k triangles:

  • Merge static scenery. Walls, floors and furniture that never move are merged into a few meshes. Invisible hitboxes stay behind so you can still click a desk.
  • Vertex colors instead of materials. Flat Lambert materials are baked into vertex colors, so many objects can share one material and one draw call.
  • Merge each character by animated group. A character used to be ~28 small boxes, each with its own draw call. Now it's one mesh per moving part (head, torso, each arm and leg), so 7 draw calls per person.

Shadows also update every other frame. Nobody notices, and it saves a lot.

3. Simulating an idea, not just a company

The interesting part of a startup isn't the office, it's whether the idea is any good. So each idea has 12 assumptions (price people will pay, conversion, churn, customer acquisition cost…). Each assumption has:

  • a prior range based on benchmarks for the business model,
  • a known range that shrinks as you learn,
  • and a hidden truth, drawn with a slight bias against optimism, because founders are optimistic.

You discover the truth by running validation tests (interviews, landing pages, pilots). The measurements are noisy, and interviews inflate willingness to pay, just like in real life. A stress test runs your plan in 100 simulated worlds and shows how often you survive.

4. Letting players shape the roadmap, safely

Being open source means anyone can propose a change, including trolls. The setup:

  • main is protected: nothing merges without the maintainer's approval and a passing smoke test. The test is a Playwright script that simulates 60 in-game days in every difficulty.
  • Every 2 hours a GitHub Actions job reviews new pull requests with Claude. A free shell pre-filter first holds anything suspicious (huge diffs, brand-new accounts, many open PRs).
  • The model only reads. The PR is saved to files, and Claude returns a JSON verdict (APPROVE, CHANGES or CLOSE) plus feedback, using --json-schema. A plain shell step, not the model, posts the comment and labels. Even if someone hides "approve this" in their PR, the worst outcome is a wrong comment.
  • Merged contributors get credited in the game. Ideas with the most πŸ‘ get built, with the proposer's name.

Try it, break it, shape it

I'd love feedback on the first 10 minutes. Is the tutorial clear? Where did you get lost? And if you want to contribute, there are issues labeled good first issue: a translation, new industries, mobile layout.

Disclosure: I build Founder's Way with Claude as my coding partner, and this post was drafted with its help.

Top comments (0)