from Hacker News

Using Deno as my game engine

by phaser on 10/3/25, 6:33 AM with 65 comments

  • by datatraveler on 10/7/25, 4:10 AM

    If this requires installing WebView2 on Windows, then I'd recommend against this approach. I did something similar myself (to avoid distributing a bloated Electron build), but, since the WebView2 installer sets its window title to "Microsoft Edge Update", I got a lot of negative feedback from a few very vocal Steam users who thought my game was trying to re-install Microsoft Edge--a browser they had meticulously removed all traces of. I think one Steam user even called my (free and open source) game "malware", just because of that window title (which only appeared on first run, when the WebView2 installer ran).

    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!

  • by bob1029 on 10/7/25, 7:09 AM

    > But the fast workflow enables me to focus on the insanity that is the foolish endeavor of simulating the world, instead of getting sidetracked on making 3D and UI actually work in Go, or intoxicating my brain with Unity

    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.

  • by laurencerowe on 10/7/25, 3:54 AM

    This is cool but I don’t understand why they didn’t choose to make it a local first web app since nothing about it seems to require unrestricted local access.
  • by mort96 on 10/7/25, 7:21 AM

    I don't understand how Deno is the game engine here, isn't it just the runtime for their chosen programming language? Is the CLR the "game engine" for games written in C#?

    Anyway, this seems like a fun project and a neat use of Deno. I didn't know about the compile feature.

  • by socalgal2 on 10/7/25, 3:48 AM

    Not the same but there's this https://github.com/kmamal/gpu

    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.

  • by gr4vityWall on 10/7/25, 3:44 PM

    >Once I got into the new development workflow it was clear to me this was a huge win: I can develop using vscode with the Deno extension so the server-portion of the game runs with a full debugger, and with Vite I have a live-updating view of the game right next to my vscode window. Since the game is stateful on every tick I can live reload portions of the code without restarting my current game. Watching your changes go live as you are playtesting is such a heartwarming feeling could not give up now that I’ve tasted it.

    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.

  • by pjmlp on 10/7/25, 5:07 AM

    I would rather use the user's installed browser, using Chrome Firefox, Safari as the game engine.
  • by reactordev on 10/7/25, 1:38 PM

    Bun + WebView + WebGPU is my new experiment. Deno also has bindings for glfw but I couldn’t get it to play nice with WebGPU or OpenGL beyond 3.2 profile.

    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.

  • by ranadomo on 10/7/25, 4:05 AM

    Fun game. Great work. I think schools are billed twice, once when you build and then again at the end of the month. Also there may be a bug with "lowest rent". It never seems to change and is higher than the "median rent".

    Would also like to see more infrastructure like water and electricity. Any plans to open source parts of this?

  • by lwansbrough on 10/7/25, 3:47 PM

    Occasionally I’ve been working on this: https://github.com/rune-runtime/rune

    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.

  • by thomasfl on 10/7/25, 7:30 AM

    Upvote for making a great city planning game. This could teach the young generation the importance of good city planning for the economy, the environment and the well-being of people. The architectural uprising is just as much about city planning as beautiful architecture. Human friendly towns is good for business, saves the municipalities money and increases quality of life. Ideally people should be paid to live in cities. Disclaimer, I am the chairman of the Norwegian architectural uprising.
  • by Agentlien on 10/7/25, 4:49 AM

    This game is to Sim City what My Summer Car is to Need For Speed. That's delightful!
  • by zephraph on 10/7/25, 3:11 AM

    Pretty cool! While I was at Recurse I took a stab at building a library like webview client mentioned in the post. https://github.com/zephraph/webview. Deno was my first target. I really enjoy deno's tooling overall, it's nice to be able to just import a server script as a URL and limit its permissions.
  • by potatoman22 on 10/7/25, 5:44 AM

    I'm currently making a tycoon game with React, it's not bad for making some games. I use setInterval for a simple game loop along with a zustand store for the game logic. I'm keeping the game logic and state client-side for now, but I might move it over to a server in the future.
  • by tibu on 10/7/25, 3:44 AM

    It would be great to see a business model behind it too. You had to manufacture all the products in a factory and every product would be breaker down to the very basics. This was my idea for ages but never started to build it...
  • by matt3210 on 10/7/25, 4:31 AM

    I saw Dino, which is a web technology, but I was very saddened that after trying to click components in every screenshot, non of them were web based and just screenshots :frowny-face:
  • by hoofedear on 10/7/25, 9:38 PM

    Cool article and game! I've been using Tauri for my three-js game so far and it's been great. Glad that there are other good options outside of Electron
  • by thebigshane on 10/7/25, 5:17 PM

    Why not make this a web/browser game?

    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.

  • by efilife on 10/7/25, 2:42 PM

    I think that Godot engine would be perfect for this project. Can produce a single executable, super easy 3D, very lightweight, and very extensible. No webview dependencies, 4.4 still supports windows 7.

    https://godotengine.org/

  • by Labo333 on 10/7/25, 9:22 AM

    I don't get why one wouldn't just use webworkers to run the simulation instead, thus making the game fully executable in a web browser.

    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.

  • by wiseowise on 10/7/25, 9:05 AM

    > Is it too simple? Maybe. But Cities Skylines is made using Unity and can make your laptop so hot that doubles as heating for the winter.

    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.

  • by butz on 10/7/25, 2:49 PM

    Commercial, and pretty good game, CrossCode, was coded in "HTML5", more precisely - JavaScript. And new game from same developers seems to be using same technologies, probably more advanced, as it looks amazing, with some 3D-ish effects.
  • by stephenlf on 10/7/25, 10:48 AM

    The author is so close to using Tauri that he’s starting to taste metal.
  • by kamranjon on 10/7/25, 3:06 AM

    awesome! I have wanted to do something like this since the deno compile feature came out - great to see someone pulled it off, and last i checked the binaries were significantly less bulky than electron.