Last weekend I went to Brisbane coding event called code smash. It coincided with node knockout. The event was provided us with a space to work, people to work with and pizza. What we did at the event was up to us. In the spirit of node knockout I was keen to do some serious team coding and get results. Luckily I managed to team up with Andrew who had similar goals. Andrew works with ruby on rails full time and I work on asp.net mvc full time. So clearly the sensible thing to do was to write a Game of Life in NodeJS. Just to keep us on our toes.
This weekend I was still energetic about the project. So I
- Changed the polling to push based sockets using socket.io;
- Made the packets a smaller;
- Made the field size as big as I could;
- Switched out the heavy duty game library and did the painting with jCanvas; and
- Gave our Game of Life a home.
I’m not usually a big fan of games like I used to be back in the day. This is probably because I lack the time. This game is a set-and-forget sort of game, there’s no big time investment required. I’m still thinking about how to make it more interesting by adding to the multi-player aspect of the game.
The game suffers from entropy over time and relies on people visiting to add cells to make the result dynamic and interesting.
I have though of a few other interesting possibilities, that could still be explored:
- Calculate a big field and be able to zoom and scroll around parts of it.
- Be able generate a still image of a big field frame of the game. Maybe keep some cell history and heat map the image if it’s sparse.
- Introduce colours to the cells that mix as cells reproduce.
- Introduce a multi-player aspect where each player can add spawn points that emit predetermined cell formations.
- Make the server send only the unpredictable state updates, and get the clients to do the other predictable calculations related to display.
- Be able to have an infinite sized field that scales as servers are added to calculate more of the field.
The code is on github.