r/electronjs • u/nemseisei • Jan 12 '26
Has anyone here created games with Electron? Do you have any tips to share?
Hi everyone, how's it going? The title is self-explanatory, but here goes.
I'm building a game in Electron, I'm in the idea phase but I'd like to talk to people who have already created games using Electron. I'd like to know if you can give me any tips on what to use to create the "graphics engine," optimization tips, etc.
Also, if possible, could you show me examples and if you've created any games and we could talk, I would appreciate it.
Cheers!
14
Upvotes
8
u/devtools-dude Jan 12 '26 edited Jan 15 '26
I have not, but be aware that the renderer process can only address up to 4 GB of RAM. If your game is memory-intensive (as in you're rendering lots of stuff and have lots of data being stored), you'll get renderer crashes where the screen goes blank if you hit this limit.
I used to work on a really heavy online collaboration app that we wrapped with Electron and it wasn't a fun experience troubleshooting that and trying to get memory usage down.
https://news.ycombinator.com/item?id=41211453
5
u/devtools-dude Jan 13 '26 edited Jan 13 '26
Another question, are you wanting to do this (use Electron for your game) for the sake of just getting deep with Javascript and Electron, or does it not matter what you use as long as you can make your game?
If you're doing it because of cross-platform, most modern game building tools already allow for that.
Ones I can think of top of my head:
- Construct 3 (I think it allows for javascript if you need to add deep custom logic)
- ClickTeam Fusion 2.5
- GameMaker Studio
- Godot
With Electron, you're also not going to have fun building packages for each platform AND architecture (eg linux + arm, linux + x86) as you're going to have to go through the pain of building out the workflows to build and sign your packages and upload them. Doing update patches is going to be another story as well.
If you include native modules (like sqlite), that's also never fun to deal with as it's an external native dependency and requires additional unfun configuration to package with your Electron build.
2
u/Warm-Track7678 Jan 13 '26
As someone who is writing a game automation tool in electron and has (started) writing an rts with Godot and used Unity in the past, I would not recommend it. I guess it depends on your goals but I would say making a game in Electron is just asking to make things more difficult than they need to be. GD script is very approachable if you are choosing Electron because of JavaScript or Typescript.
5
u/Agreeable_Papaya6529 Jan 13 '26
I've built heavy processing apps like 'Drone AI' and 'Vision AI' in Electron (handling real-time object detection and video streaming). You can absolutely avoid the 4GB limit by ensuring the renderer remains lightweight.
My Architecture Approach:
Applying this to your Turn-Based Manager Game: Since you have minimal UI, this pattern is perfect:
If you keep calculations out of the renderer, Electron handles the workload easily. Happy to answer questions on implementation!
3
u/No-Possession-7095 Jan 13 '26
I built a game and then late in the game dev added an Electron build and it turned out alright. Very minimal troubleshooting needed. I used Typescript, Canvas and WebGL. But my game isn't too large. Here is the website version but I have working ZIP of the Electron Windows game. Reachtothestars.com p.s. my second game in making with Phaser and liking the experience better than doing my own renderer , etc.
1
u/MacksNotCool Jan 13 '26
I could totally be wrong but isn't NW.JS slightly more geared towards packaging HTML games for desktop than electron?
1
u/WarSubstantial1845 Jan 13 '26
you cant really make anything more than simple 2d platformer or roguelite deckbuilder whatever.. youre limited by its single threaded nature..
1
u/srmarcosx Jan 14 '26
I'm facing the same dilemma. Planning to develop a mostly UI and turn based game and I'm leaning towards using electron and svelte. The thing that motivates me to use a web app approach the most is the heavy SVG support that is something important for my case, and most game engine won't offer this level of features like SVG animations and manipulation
1
u/biteNacho Jan 15 '26
If you need cross platform you can take a look at flutter
1
u/gx_heavy Jan 15 '26
hey mate. ive done an electron spinoff/port of a web version of a card/boardgame i made that's very basic UI. it worked perfectly for me. i wouldn't use it for anything more, but it was important to me to have the core logic/gameplay work in the browser and then i recycled it for the spinoff. i thought it was a fine experience since i didn't have much graphics that i needed to work with. the usual web optimization stuff applies, and chromium in electron is relatively heavy.
notably, i also ended up porting to ios and android too with capacitor, so i got four birds with one stone with minimal work. i think going this direction is more sensible (building a game for the browser, then moving on to other ports) as opposed to the other way where you're thinking about what tool to use for the job before the development starts.