Web build on castle.veridianresonance.com
The Godot web export is served from an R2 bucket by a small Worker, the same
setup as tetris-autobattler's play. site. Cloudflare Pages can't host it: Pages
caps files at 25 MiB and index.wasm is ~40 MB.
browser → Worker (worker.js) → R2 bucket castle-crawler-web
One-time setup
- R2 must be enabled on the Cloudflare account (Dashboard → R2). It already is if tetris-autobattler deploys.
veridianresonance.commust be a zone on the same account. It is; the deploy attachescastle.as a Worker custom domain and creates the DNS record itself.- Node installed, then log in to Wrangler once (opens a browser):
bash
npx wrangler@4 login
- Godot 4.7.1 web export templates installed (Editor → Manage Export Templates).
Deploy
From Git Bash at the repo root:
deploy/web/deploy.sh
It exports game/ with the "Web" preset into build/web/, creates the bucket if
needed, uploads the files (index.html last), deploys the Worker and checks the
site answers 200. --skip-export re-uploads the existing build. Set GODOT if
Godot isn't at the path in the script.
Test locally
python -m http.server 8060 --directory build/web
Then open http://localhost:8060 (also in .claude/launch.json as web-build).
Limits of the web build
- Co-op by room code. Browsers have no UDP, so ENet is unavailable; web
players connect peer to peer over WebRTC (
game/scripts/web_lobby.gd). The Worker's/signalendpoint (a Durable Object per room code, seeworker.jsand thedurable_objects/migrationsinwrangler.jsonc) only swaps the connection offers. Web and desktop players cannot play together. No TURN relay yet, so very strict networks cannot connect. deploy.sh --prefix betauploads the game under/beta/to try a build without replacing the live one.- Renders with the Compatibility (WebGL 2) renderer, Godot's default for web.
- Gear saves (
user://) go to the browser's IndexedDB, per browser. - Files are served
Cache-Control: no-cache+ ETag, so a new deploy is picked up on the next page load.