Posted February 16, 2021 by PtitPoly
#Cellular Automata #Quality of Life #Conway's Game of Life #Conway #Game of Life #Cellular Automaton
Hi everybody !
After a long absence, I just needed a comment about the lack of an exit button to get myself back into this little project (which was hard to believe at first, but ended up being tragically true... all this time without a way to leave the game except that Alt+F4 strategy).
I had a lot of fun doing it so I decided to take the time to add a couple things that I thought would be nice to have, like a menu.
Now, by pressing the Escape key, you will open the new menu (which should be open by default).
This menu now contains a list of all the shortcuts you can use in-simulation, a list of a few presets available, re-created from Conway's Game of Life's wiki, and a few sliders to control some post processing values. I may add a way to change the color of the cells in the near future and I am currently thinking about optimizing the whole simulation. I want to deploy the game on WebGL (browser) but the current performances are very bad (5-6 FPS in average). While working on medium to high CPUs allows to get very high framerates on the standalone build, I had to limit the timestep to 60 FPS for lower-end CPUs (which may never get there). WebGL would be a huge win for me as I know it stops many people from using this (what is think is a fairly ok) program when the only option is to download a zip file, me included.
Now, I never expected more than a few people getting on my project and downloading it and I am so grateful that so many people got interesting in this. Cellular automatas are AWESOME !!
But yeah, next stop will be the WebGL build. I have a few ideas on how to approach the issue of having to render and update what is currently 12,000 cells (150 x 80 grid) every frame and doing massive amount of operations on each cell like finding every active neighbouring cell to each cell (which is 8 max). As you can imagine, this is a lot of operations in one frame, not even speaking about a second (~720,000 renders if running at 60 FPS, leaving the operations out). The bigger the grid, the more operations are needed and the lower the performances. Now, everything is rendered using the CPU (the GPU shouldn't be impacted), which is quite limiting.
I am currently rendering the grid using individual sprites (16px * 16px) and instantiate all of them at runtime, keeping track of each of them and rendered as separate objects. I am currently thinking about using a 2D plan, problem is, nothing of what I have done so far can be kept, since the model is so different.
I will update ny new findings if my goals can be achieved or not and re-upload the newer version here.
This wraps up pretty much everything done so far.
You guys take care and be safe!
Cheers,
PtitPoly