Using Deno as My Game Engine
Key topics
The author shares their experience using Deno as a game engine for their city-building game, Microlandia, and the discussion revolves around the technical choices and trade-offs involved in using web technologies for game development.
Snapshot generated from the HN discussion
Discussion Activity
Very active discussionFirst comment
4d
Peak period
39
Days 5-6
Avg / period
13
Based on 65 loaded comments
Key moments
- 01Story posted
Oct 3, 2025 at 2:33 AM EDT
3 months ago
Step 01 - 02First comment
Oct 6, 2025 at 11:06 PM EDT
4d after posting
Step 02 - 03Peak activity
39 comments in Days 5-6
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 22, 2025 at 7:43 AM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
It's SDL + WebGPU + Node. It doesn't give you a webview. It gives you (windows, input, audio, joypads) via SDL and graphics via WebGPU. I'd guess you can run three.js on it.
It's not looking super loved though but it does show a simple idea. Glue SDL and WebGPU (via dawn or wgpu) to pretty much any language and you get an environment to make portable apps.
I'm a bit out of the loop with three.js. How far along is their WebGPU renderer? Is it close to feature parity with the WebGL renderer?
https://github.com/lesmana/webrtc-without-signaling-server
I'm sorry to say that if I had to do it again, I'd use Electron, despite the bloat. I bet Electron would also make distributing a Linux build easier, too. (WebView2 didn't work fullscreen on Proton when I last tested.)
Sorry to be a downer! Obviously, I originally loved this approach since I did something similar--it just didn't end up paying off. No one noticed that the download was ~100 MB lighter--but they sure noticed a brief flash of "Microsoft Edge" on their screen!
Lack of standards support in WebKit made it painful to use and even meant losing major features like VR support. WebKit and WebKitGTK were both extremely unstable in their own ways. And I never could figure out a decent debugging scenario setup.
WebView2 supports both the auto-updating "Evergreen" version and a fixed version[1]:
In the Fixed Version distribution mode, you control the timing of updates to the WebView2 Runtime for your app. You download a specific version of the WebView2 Runtime and then package it with your WebView2 app. The WebView2 Runtime on the client isn't automatically updated.
[1]: https://learn.microsoft.com/en-us/microsoft-edge/webview2/co...
The sooner Tauri grows Electron/Chrome bundling capabilities, the better.
Chunky and predictable beats confusion, errors, and inconsistencies.
And they do.
And most people don't have a Python runtime installed. Almost everyone has an OS with a web view component already installed.
That's just one of dozens of browser inconsistencies we've recently dealt with. It's just the most egregious.
https://ebitengine.org/en/documents/webassembly.html
a. load time - the Go wasm bundles can be large (TinyGo should help) but even with 25mb -> 5mb - that 5mb feels like big especially on a mobile download (i think?). But this is one off so I can suck it up.
b. This feels like a big one. I am only doing turn based games so may not be a big issue but it feels like the wasm <-> browser ser/deser can be a killer. Thank fully I am not doing high (or even medium) FPS games so will deal with that later :D
I investigated wasm as a scripting engine (not a compile target, which is a orettt great use case for wasm) and the thing that killed it for me was how difficult it was to do zero-copy host-wasm memory sharing. Wasm is designed to be sandboxed and breaking those guarantees is hard. The problems I hit were: 1. Many languages (AssemblyScript, Grain) expect to own the entire linear memory, so even with WASM shared memory, it isn’t safe to actually use it unless you jump through hoops (eg use AssemblyScript GC functions to allocate and pin memory for host use), 2. WASM multi memory promises to solve this by letting you attach additional separate linear memories but neither AssemblyScript nor Grain support it. Additionally the wasmer runtime doesn’t yet support it.
I didn’t investigate whether Rust or Emscripten had either of these issues (I assume not), but they felt like a poor choice for “scripting”. I also didn’t investigate using V8 or other JavaScript engines to run wasm.
I guess the performance depends on how much you have to serialise. The ideal is to work in SharedArrayBuffers directly on linear structures of primitives and avoiding serialisation altogether. I did this for a (JavaScript) particle system where the simulation is in a web worker, that way you can achieve zero copy and it’s fast. But yeah once you have to cross the boundary and convert those or copy data, performance is hurt quite a bit…
My thought was - can I take a language that I am comfortable with and is reasonable fast (both to develop and from perf persepective) and use that as my "logic layer". C and Rust would also have been great but for me C's memory management (Id be lying if I said I am comfortable after being away for over a decade) and battery-light standard library (again not sure what changed in last 10+ years) kept me at Go (Rust learning curve I did not even want to think about).
Back to the performance penalties - I structured it so that payloads are small and all state is kept on the wasm side with just batched messages to update view state. If I ever need to do do high FPS things il have to dig more into SharedArrayBuffers (but felt this was pain to get working). But then Id have reimplement a lot of the libs like phaserjs etc?
> But then Id have reimplement a lot of the libs like phaserjs etc?
The way I see it is that you either:
1. Do everything in WASM, using your languages native libraries (eg Emscripten supports SDL and WebGL, for example -- I hear newest wasm version also makes more directly available from browser WASM)
2. Use WASM to offload certain workfloads or simulation, and send data to Javascript and do all rendering in Javascript (using three.js, PIXI.js, or WebGL directly).
If using 2, you either send updates (I made a little toy test engine where I wrote messages to a SharedArrayBuffer that the JS side could read), or you operate directly on primitives in a SharedArrayBuffer (fastest since there's no serialisation needed, but harder to do).
Note for my particle system, I used PIXI.js to render and the webworker to simulate. I had a read index and a write index and the simulation would basically read the particle attributes from the read index and write them to the write index. The read index would be incremented for each particle and the write index only for live particles, meaning that as particles died it auto compacted:
Simplified for illustrative purposes. In real life, I used a wrapper than managed offsets automatically. But the point is that its a flat buffer, we don't try to serialise objects other than to read the properties out and write them back.Of course, the docs still say:
> Even if your app uses the Evergreen distribution mode, we recommend that you distribute the WebView2 Runtime, to cover edge cases where the Runtime wasn't already installed.
https://learn.microsoft.com/en-us/microsoft-edge/webview2/co...
I wish we knew how prevalent that situation was. Not sure what the failure mode would be. But it sure would be nice to be able to assume that a modern WebView always exists on Windows! That certainly wasn't the case back when I made my decision circa 2022.
"Steam customers love a quick and silent install. Add silent or quiet parameters to all run process commands and only add what you absolutely need for the game."
While Flutter could be used to draw UI to texture, Impeller could also be used by other UI frameworks. Recently, Avalonia team experimented with replacing Skia and a Flutter developer asked, if they are interested in using Impeller and even offered some help [1].
This would probably be suitable, as a more lightweight alternative to WebView, for integrating into game engines.
[0] https://chromium.googlesource.com/external/github.com/flutte...
[1] https://www.reddit.com/r/dotnet/comments/1nv3snm/comment/nh7...
https://stackoverflow.com/a/38709924
I'm glad the author found something that works for them. That said, if the author's goal was to publish a game with intention of turning a profit, this attitude can be very counterproductive. It does work out really well in some cases, but more often than not it results in failure. The distribution looks like a bathtub curve - either your concept is so simple that a DIY thing can work (Minecraft) or you have the other thing (Elden Ring).
The most challenging parts of game dev happen in places like photoshop, blender, audacity and blank sheet of paper. Turning the art integration tool into your primary obsession is a fantastic way to slide on all of these other value drivers. For example, populating a game with premade assets from the store is no longer a viable commercial solution when your audience has seen hundreds of prior arrangements of the same.
If the game is a hobby or other not-for-profit venture, then all of the advice in this article is fantastic. I started my game dev journey doing everything in the web as well. It is still a very compelling platform target. The thing that really gets me thinking is that despite my ability to create flawless webGL builds out of unity is the fact that I don't bother anymore. The need kind of went away once it became clear that layers like Proton on Linux would actually cover my ass.
Focusing purely on profits (as your comment does), is this really true? Production costs seems really low for those sort of games, and I see countless of them on the Playstation Store even, which does have some barrier to entry, so someone must find it profitable enough to continue churning out those sort of slop games.
But the author of this post seems to not do it for the profits, they have other goals in mind, so not sure it really matters in the end.
> If the game is a hobby or other not-for-profit venture, then all of the advice in this article is fantastic
Good job author for creating a fantastic blog post, I agree with parent :)
Anyway, this seems like a fun project and a neat use of Deno. I didn't know about the compile feature.
My second objection is that when I see a title of the form "using X as Y" (especially here, where the audience is technical) I expect the article content to be primarily about how X is useful for Y, and about the specific actions taken to make it fit for purpose. But this one seems to be largely about the consideration and rejection of other tools, and then the rest is basically just celebrating the experience of having made it work.
The main thing I learned about the game, outside of the screenshots and basic description, is that it uses a client-server model. Even though there's no clear reason why that would be necessary or even helpful beyond "it's written in TypeScript and that's what TypeScript devs are accustomed to". Certainly I can hardly fathom that any original implementation of SimCity too such an approach.
Just make it actually cheaper than the suburbs and you'll have more people.
...who in turn will create demand driving prices up.
I'm 100% with you on this, as I spent close to an hour in traffic yesterday driving into the city during the afternoon rush hour, but transport is so much cheaper than real estate, that plenty of people are actually stuck outside big cities.
Looking at the political situation around the world, I think learning should not stop at a certain age. I'm pretty sure even the "older" generation can learn from this. People that grew up with SimCity are now in their forties and fifties, and some never quit gaming at all.
If deno has some perks during development, there must be a way to replace websocket with some other transport that works with webworkers for "production" builds.
As someone who got into programming because of games, wrote a few game engines, released a few - the concept of being able to use webdev tech (beyond UI stuff) for the core game graphics is just unbelievable.
Obviously you won’t get every ounce of juice from the machine but a lot of games don’t require that AAA touch. I’m glad to see the author’s on the same tract as me. WebGPU is so awesome. My biggest issue with this whole approach is that is super trivial to spit out the gltf models that anyone can use your assets.
Trying to work some old school pkg logic into the mix doesn’t really help either. Barring writing my own binary format, I’d love to see a way to make gltf models secure. Allowable from your site but not loadable from elsewhere or something like that. DRM for the art assets.
Would also like to see more infrastructure like water and electricity. Any plans to open source parts of this?
The concept is to provide a WASM runtime for games with all the functionality you’d need. Graphics, audio, storage, input, UI, etc.
It’s made in Rust and doesn’t use a browser engine at all.
Haven’t touched it in a little while but the concept is still sound. It’s all the benefits that a mature engine would give you, without the engine. Eventually there would be a package manager where you would be able to find engines built for this runtime.
IMO This is the key part of the article. Having live reload available shortened the feedback loop drastically.
It makes an even bigger difference for game development than it does for web stuff, due to longer compile times. I hope it becomes commonplace for more more free game engines.
https://godotengine.org/
How does Microlandia fare against cities skylines? I have played neither, but I’m curious about performance comparisons between fully web sim game against unity one.
I don't feel like the author explained why such focus on being a downloadable game. Just nostalgia or because they want it included in Steam? With a web ui, why not make this a web game?
I absolutely loved the original SimCity and SC2000. The focus on creation, management, and simulation was always more fun to me than the graphics.
This game looks like so much fun as well and eager to give it a try.