3 ms·
Is size still an issue with Go if you wanted to compile to WASM and target the browser?
by tjpnz 3y ago
Is size still an issue with Go if you wanted to compile to WASM and target the browser?
- pjmlp 3y agoIf the browser is the main target, I would just use browser native engines like Pixijs.
- angra_mainyu 3y agoshout out to babylon.js, incredibly good 3d game engine for the browser
- pjmlp 3y agoDefinitely, my example was for 2D games. Currently the one with best WebGPU support.
- Narishma 3y agoWhat would a 2D game need WebGPU for?
- angra_mainyu 3y agoPlenty of 2D games are actually in 3D rendered to a flat "2D" representation. Also, shaders are a thing in 2D games.
- Narishma 3y agoOk but you don't need WebGPU for those things, WebGL should be fine.
- pjmlp 3y agoBabylonJS is not for 2D games, read the thread properly.
- JoeyJoJoJr 3y agoI would recommend against anyone using PixiJS. From a code perspective it feels dated and inconsistent. It can be very difficult finding correct information for the latest version, and you will very easily hit performance problems if you want to create a full screen game. You will need to apply the bitmap caching feature to yield best performance, and to me it seemed riddled with rendering and interaction bugs, or at the very least highly unintuitive behaviour from its usage. I didn’t discover these problems until I was too far into development of my game.
- pjmlp 3y agoAnd the alternative 2D game engine designed for the Web with GPU acceleration is?
- JoeyJoJoJr 3y agoIt’s not ideal, but I’d go with something non-JavaScript. Heaps or Kha in the Haxe ecosystem would be a far more worthwhile choice IMO.
- euroderf 3y agoThere's tinygo, which is still missing bits here & there, including reflection, which makes encoding/decoding (json, xml) problematic.
- bdhcuidbebe 3y agoThere has been work to get ebiten running with tinygo, which will yield smaller and maybe faster wasm. Not sure about status, just try yourself with tinygo command instead of go.
- tslocum 3y agoBoxcars[0], a web-based client for playing backgammon powered by Ebitengine, compiles to a 20MB WASM binary[1], and as long as the server and browser are gzip-enabled, this actual transfer size is reduced to a little under a third of this. 0. https://code.rocketnine.space/tslocum/boxcars https://code.rocketnine.space/tslocum/boxcars 1. https://play.bgammon.org https://play.bgammon.org