Page 1 of 1

My Conway's Game of Life Implementation

Posted: March 23rd, 2017, 11:28 pm
by ThreeNPlusOne
This code was previously only on the Discord chat, so I decided to post it here as well.

It is a simulation of Conway's Game of Life made with Chili's awesome framework. It uses the concepts taught in the 2D arrays tutorial as well as references and the timers used in Snek. I will not explain GoL here as you can easily find out on Google (or read my code).

Controls:
SPACE: Pause/resume simulation.
RIGHT: Step forward one "life iteration".
LEFT: Step backward (coming soon)
DELETE: Clear the board (not particularly useful at this point)

I plan to update this post as new features are added, but for an (almost) real-time view of all my changes, follow the GitHub repository (https://github.com/threen-plus-one/conway-gol).

Re: My Conway's Game of Life Implementation

Posted: March 24th, 2017, 4:08 am
by albinopapa
Hey, interesting stuff that cellular atomata.

Chili and I also made a GoL, we had a contest who could write a faster sim ( chili won hands down ).
I saw chili preview yours in his Update vid, pretty cool stuff.

In the thread How do you multithread?

We start off talking about multithreading which lead to using the GoL as the platform of learning and eventually lead to chili challenging me which lead to him teaching me how to use SSE...I think it's worth the read when you have the time. It has some of our solutions in it as well.

I never did get around to making a faster version of mine, perhaps some day. Instead of using D3D shaders though, I will probably use C++ AMP.

Re: My Conway's Game of Life Implementation

Posted: March 24th, 2017, 4:01 pm
by chili
Glad to see you post your conway here threen, and welcome to the forums!

I too was contemplating doing GOL on the gpu. I think think the fastest implementations use some sort of hashing / caching / memoization technique to speed up the simulation dramatically.

Re: My Conway's Game of Life Implementation

Posted: May 26th, 2017, 11:09 am
by ThreeNPlusOne
The game goes backwards now. I used a list of unique_ptr to "BoardState". Feel free to evaluate this decision. Code is on GitHub.