Lessons from Building a game engine from scratch in Gleam
summary
A browser game engine built in Gleam is underway, chosen because it compiles to JS and Erlang so the client uses canvas while the server leverages the BEAM for concurrency. Concrete wins and headaches: sprite animation via requestAnimationFrame, handling 60fps logic on 120Hz screens, a 4.46ms rounding gap that costs ~15 frames/sec, and a 170ms pause equating to ~10 pending updates that can cause a death spiral unless capped. Implementations include fixed-update/variable-render and an accumulator to reclaim partial frames.
AI-written summary · about
chapters (7)
- 0:00Building a game engine
- 2:03Why Gleam for browser
- 5:11Two key lessons
- 6:56Lesson one: game loop complexity
- 17:09Lesson two: AI and community
- 19:16Ambitious projects shape careers
- 20:41Should you take on ambitious projects
related talks
19mBridging the Gap with Gleam & Lustre
31mThe Tricks of Game Programming in a Pure Functional Language
46mA DIY guide to building your own Rendering Engine
49mRendering without lumpy bits
46mBuilding a Graphical IDE in Elm/Purescript (...)
35mBuilding Multiplayer Games with Phoenix and Phaser
43mNo More Jank: Escaping the Matrix of Frame Drops
40mLive code a game on the browser with Opal and Vue.js
