171 points · by phaser · 1y ago · 65 comments
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!
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...
The sooner Tauri grows Electron/Chrome bundling capabilities, the better.
Chunky and predictable beats confusion, errors, and inconsistencies.
That's just one of dozens of browser inconsistencies we've recently dealt with. It's just the most egregious.
And they do.
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.
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
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...
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.
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.
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?
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.
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.
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.
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.
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.
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.
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.