top | item 44101175

Show HN: Porting Terraria and Celeste to WebAssembly

338 points| coolelectronics | 9 months ago |velzie.rip

48 comments

order

modeless|9 months ago

Porting games to the web is a fun hobby! I've done Quake III [1] and Cave Story [2]. Just like in this story it's all about the details. Getting the game loading is just the start. Things like adding touch controls for mobile, handling multiplayer, managing save files, supporting modern screen resolutions and frame rates, they take more time than the initial port.

[1] Single player: https://thelongestyard.link/q3a-demo/ Multiplayer: https://thelongestyard.link/q3a-demo/?server=HN

[2] https://thelongestyard.link/cave-story/

dwattttt|9 months ago

It's really impressive how much worked out of the box, decompiling a C# binary, then recompiling it for a target as different as WASM.

underdeserver|9 months ago

And then it's also really impressive how much they did to get to the end.

delusional|9 months ago

> One of my favorite genres of weird project is "thing running in the browser that should absolutely not be running in the browser". Some of my favorites are the [...] the direct recompilation of Minecraft 1.12

Heh, you'd think Minecraft would be exactly the sort of thing that absolutely should be running in the browser, considering it was originally a Java applet.

I understand the point, I just find it amusing.

pjmlp|9 months ago

Even more interesting is this idea of running WebAssembly on the server, in containers, with orchestration services among them, and communicating across sandboxed environments.

Somehow it reminds me of something, but memory is getting fuzzier nowadays. /s

kkukshtel|9 months ago

This post presupposes a bit of knowledge about C#/WASM and Native code linking in the C# ecosystem. I wrote a post a while back that could be a complement to this that does some more level setting about what's possible these days with compiling C#-based engines to the web for those that don't already have the context:

So You Want To Compile Your C# Game Engine To The Web With WASM

https://kylekukshtel.com/csharp-wasm-game-engine-compile-web...

jasonjmcghee|9 months ago

Getting firebase "bandwidth quota exceeded" error when trying the demo.

You shouldn't have to worry about this kind of stuff if it's just a static site.

I'd host this on a cdn like cloudflare or github pages (free!).

coolelectronics|9 months ago

My bad! Switched over to the github pages fallback. Cloudflare pages isn't suitable because the wasm files (100mb+) exceed the 25mb limit. (i could bypass this with service worker jank but that tends to be fragile). Github Pages also isn't suitable because it doesn't have a native way of sending the coi/coep headers that are required for SharedArrayBuffer to be available. Can also bypass that with service worker jank but I would prefer not to

James_K|9 months ago

I've recently started trying to do a bit of basic game development targeting the web through WASM+OpenGL+SDL, and I must say, I'm shocked with how easy it is. I spent more time fiddling with CMake files than I did trying to the code to run on the web. There are still some limitations and rough spots on the web platform, but I've honestly had a much harder time compiling things for Windows or MacOS than for WASM.

Fraterkes|9 months ago

Dumb question: do you have access to any of the nice text rendering features of the browser when you use Wasm, or is it basically just drawing to a canvas

inlinestyle_it|9 months ago

Amazing work. But I'm wondering, this is only for your own personal use right? Because the projects you are talking about here are still covered by copyright and thus even if you were the one who ported them to the web it's still not possibile to redistribute them for other people benefit.

If you are interested in taking a look, we run a cloud gaming service based on WASM at https://gaming.inlinestyle.it with cloud saves support. Many of things you discussed are related to what we had to do too, but we tried to do it only for opensource and freeware games so that everyone can benefit from them and play them on the cloud.

Appreciate any suggestion you have on how to improve the service!

71bw|9 months ago

Your (?) website is so resource-demanding it's insane. I'm struggling to run it at any decent framerate on an i5-7500T. Makes the entire browser just crumble

poink|9 months ago

I scrolled through the whole thing on my phone and it was fine

kunwon1|9 months ago

The moving background is absolutely intolerable, I didn't last ten seconds

01HNNWZ0MV43FF|9 months ago

This is very cool. However, the blog itself is not hitting 60 FPS on my Firefox. Probably that background effect?

dgb23|9 months ago

I found that effect disturbing and distracting. It's rendered in a canvas element that you can delete via the inspector.

acheong08|9 months ago

This is so cool. Last time I played Terraria was back in 2014. One minor complaint: the resolution is too high & everything is scaled down a ton. It would be nice if we could have it scaled at 200% so i can actually see the text and icons

rlmineing_dead|9 months ago

Cool to see FNA/XNA projects projects working in the browser

Spunkie|9 months ago

It seems cool but haven't been able to get it working. I'm downloading terraria assets with the from steam option but its at only 5% after an hour.

caminanteblanco|9 months ago

This is absolutely amazing! I intend to use this on my Chromebook ASAP

parallax_error|9 months ago

Safari on ios really hates this, all 3 demos crash upon loading lol

mickey475778|9 months ago

[deleted]

nindalf|9 months ago

ChatGPT, it sounds like you're claiming credit for this work when you say "we".

For everyone else, take a look at the comment history for what AI generated comments look like in May 2025.

mickey475778|9 months ago

[deleted]

vitto_gioda|9 months ago

I don't understand what you can get at by commenting on all the posts on HN. I will click on your profile and find your website where you talk about your saas at $49 rather than $212?

pil0u|9 months ago

Thank you ChatGPT. -_-