4 ms·
I didn't find this article especially compelling. It basically says, "Don't use React for the game dev specific aspects of development. Instead, use it for the
by SeanAnderson 2y ago
I didn't find this article especially compelling. It basically says, "Don't use React for the game dev specific aspects of development. Instead, use it for the UI since that's what React excels at."
I don't find that to be especially insightful because there's clear parity between a game's UI and a website. In contrast, the actual game rendering logic has the potential to ask far more of React than it's capable of giving.
A couple of years ago I tried building a 2D ant colony sim using React+PixiJS. (https://github.com/MeoMix/antfarm https://github.com/MeoMix/antfarm) It didn't go great because React's reconciler became a performance bottleneck very quickly, even with everything memoized, and the GC caused stuttering which was difficult to mitigate when React wants to work with immutable objects rather than mutating existing state. The latter is easy enough to work around, but trying to avoid instantiating strings, etc. just felt like I was working against my tools a bit.
That said, new versions of React and PixiJS have come out since I last tried and it's possible that those performance enhancements + subdividing my grid and doing smarter updates would allow me to continue on for a while, but, at the time, I didn't feel like I was getting the dev experience I wanted out of React for a canvas-driven simulation.
All that said, I absolutely find the idea of declarative, reactive game development quite appealing and if your game doesn't ask much of performance then the trade-offs for getting that could very well be worth it.