Hacker News new | past | comments | ask | show | jobs | submit login

I've experienced a lot of these concerns while building https://github.com/MeoMix/symbiants

I have a simple question that maybe someone smarter than me can answer confidently:

If I want to build something akin to Dwarf Fortress (in terms of simulation complexity) as a browser-first experience - what stack should I choose?

Originally, I prototyped something out using React, PixiJS, and ReactPixi (https://github.com/MeoMix/antfarm). The two main issues I ran into were the performance of React's reconciler processing tens of thousands of entities when most weren't changing (despite heavy memoization) and GC lurching due to excess object allocations. My takeaway was that if I wanted to continue writing in JS/TS that I would need to write non-idiomatic code to avoid excess allocations and abandon React. This approach would result in me effectively creating my own engine to manage state.

I decided to not go that direction. I chose Rust because no GC is a language feature (especially good since GCs in WASM are heavy) and I chose Bevy because it seemed like a fairly structured way to mutate a large amount of code.

Progress has been slow for a lot of the reasons listed in this article. I've written a lot of this off to WASM being a new frontier for game dev, and I'm new to Rust/Bevy/ECS/gamedev, and rationalized my effort by noting there's not a lot of complex simulation games running in browser (that I'm aware of).

It's not clear to me that I've made the right decision, and just need to take the good with the bad, in order to develop the type of game I want in the type of environment I want.




I personally would use C++ with SDL2, but I use c++ a lot already so I'm biased. Emscripten would allow you to target WASM.


If you're targeting the browser first why not use a browser first library like PhaserJS [0]?. I don't see a reason to work around with WASM; HTML5 canvas might be everything that you need.

[0] https://phaser.io/


I'm aware of Phaser and evaluated it, but didn't try prototyping something out using it.

My primary concerns were: lack of any coherent plan towards supporting WebGPU, TS bindings being best effort rather than being written natively in TS, and, crucially, Phaser4 being stuck in development hell.

Phaser 4 was announced in 2019, https://www.patreon.com/posts/28467752, and hasn't shipped. Current version on GitHub is v3.8. It made me deeply uncomfortable planning to build ontop of an engine that's stalled out for 5 years. I would not reasonably expect to be given support for WebGPU ever and I strongly feel that WebGPU is going to be the defining way web games are written in the coming year(s).

I also wasn't able to find any super compelling games written using Phaser. Since I evaluated it, it appears that Vampire Survivors was written using it, but then they abandoned Phaser and adopted Unity in v1.6.


>If I want to build something akin to Dwarf Fortress (in terms of simulation complexity) as a browser-first experience - what stack should I choose?

I'd suggest Haxe with OpenFL or HaxeFlixel.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: