5 ms·
Unity compiles down to 3MB wasm. Though they don't need to ship the dotnet runtime, they use IL2CPP, a proprietary thing that translates dotnet code into C++. T
by andai 6mo ago
Unity compiles down to 3MB wasm. Though they don't need to ship the dotnet runtime, they use IL2CPP, a proprietary thing that translates dotnet code into C++. Then they run Emscripten on it.
Also I think Godot's WASM outputs used to be 2-3x smaller in Godot 3 (though the C# one was bigger).
You can ship a JS game in kilobytes, although atop 30 million lines of Chromium that's cheating of course :) still good fun.
https://js13kgames.com/ https://js13kgames.com/
Notch also made a bunch of 4kb Java (not JS) games back in the day, which is probably what got me into this stuff.
https://web.archive.org/web/20090108001738/http://www.mojang.com/notch/ https://web.archive.org/web/20090108001738/http://www.mojang...
- silon42 6mo agoWASM requires a browser too, no? (or an equivalent runtime, possibly smaller depending on requirements)
- andai 6mo agoYeah, you said what I said.
- sheept 6mo agoIn general wasm only requires an interpreter. But in the case of Unity web, there's JavaScript glue code that requires browser APIs that allow it to actually render. There's other wasm runtimes that don't require a browser, but presumably you can't run the same Unity wasm binary in those runtimes and expect a scene to render.
- flohofwoe 6mo agoTbf, you can also ship WASM games in kilobytes. E.g. here's a Pacman clone written in C99 in "46.8 kB transferred" (107 KBytes uncompressed size): https://floooh.github.io/pacman.c/pacman.html https://floooh.github.io/pacman.c/pacman.html ...can probably be made quite a bit smaller when 'as-small-as-possible' is the main goal.