Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
A jam submission

Conway's Game of Life+View game page

Conway's Game of Life+
Submitted by AniAko (@AniAko) — 1 day, 41 minutes before the deadline
Add to collection

Play game

Conway's Game of Life+'s itch.io page

Git Repository
https://github.com/DelightfulGames/CGOL/tree/main

Performance Strategy
Conway’s Game of Life+

From the very beginning, my Visual Studio debugger would crash Unity whenever I attached it -_-. So Debug.Log statements for the win!

After seeing a few submissions editing a giant texture for performance sake to represent the game field, I wanted to try a different approach. I knew full well this decision would place this build behind on the performance front, but overall I felt the approach was an ok choice despite it. Instead, I instantiate a field of 3D objects to represent my bitmap. Further optimization could be afforded, so much that a “borderless/infinite” game board could be maintained: Delete “dead” entities and instantiate only when needed. But there’s only so much time in a day 🙂

My overall strategy was to take this zero-player game and turn it into a 1-player game, albeit via ECS. To that end I added HiScores for the data-points, some bonus features (question marks “?”), and I devised a way to end the game: When all nodes would die, or a pattern would loop infinitely after so many iterations I’d have the game’s end-screens appear.

GameOver = All nodes died 🙁
Homeostasis Achieved = loop detected of forever on-going life 🙂

The Homeostasis System isn’t the best optimized: it catches repeating patterns, but not the shortest repeating pattern in the shortest generations. If you’re patient (give it 1k-5k generations after you see a loop), it will ultimately register.

The NodeUpdateSystem records a list of each generation’s “Nodes Alive” of the last 10k generations. Then the Homeostasis system reads the list and attempts to identify repeating entries. If it detects a duplicate entry, it measures the number of indices between those two values, and records the sequence of values in between. It then compares that sequence to the last 10k generations (most recent first) and attempts to identify it as repeating.

One optimizing strategy of note: I combined the NodeUpdateSystem (responsible for updating the displayed node and NodeGenerationSystem. This turned my algorithms into O(n) instead of O(2n) having 2 systems enumerate each cell. This saved some cycles in the end.

One I encountered that other devs should be aware of: Be AWARE of WHICH Math library you’re adding to you unmanaged systems. I was accidentally including System.Mathf.Tan instead of System.Mathematics.math.tan. This caused the editor to work PERFECTLY of course, but once deployed burst is only compatible with certain libraries, and most of the math libraries aren’t, but play nicely in the editor.

Another issue I encountered was needing to be careful to make sure my bitmap assets weren’t using compression or mips to ensure proper mapping pre-configured layouts for GoL.

System:
Windows 10
3.7GHz Intel Core i7-8700K
AMD Radeon R7 250
64GB Ram

30fps - 400 x 400 (160,000 Nodes)
60fps - 256 x 256 (65,536 Nodes)

Leave a comment

Log in with itch.io to leave a comment.

Comments

No one has posted a comment yet