Home Forums Game Frame Firmware Modding Game of Life Mode

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #679
    Edmond
    Participant

    Just jotting down my ideas before the FW is released for modification.

    I think it would be cool to replace the clock/breakout code with a Conway Life sim. I think to make it look interesting on the 16×16 grid it should have a few modification:

    1. Constant random seeding of cells. Probably have some setting that randomly places new live cells if the number of live cells drops below a fixed %.

    2. Live cells are white.

    3. Dead cells start black but each time a a live cell has lived on the space it should rotate through a color palette.

    I think with some tweaking to the % numbers, colors, and perhaps the Life game rules we could make a really cool effect.

    #680
    andreas
    Participant

    I have Life at the top of my list of game frame projects I want to do once I get mine. I think it’ll look really cool. Instead of random seeding after the game has begun I was planning on running games for only a short number of cycles and then restarting with a new seed.

    #681
    Yan
    Participant

    That would be nice!

    Really like the idea of living cells rotating through the palette.

    #1913
    Edmond
    Participant

    I finally found some time to get around to making this. Attached is my first draft of the FW with a Game Of Life mode in place of the normal clock/breakout game. The “gol.bmp” needs to be placed in the 00system folder on the SD card.

    When GOL is running:
    “Setup” key returns to normal GameFrame mode.
    “Next” reinitializes the screen with random living cells.

    The screen will also auto reinitialize if:
    1. The sim has hit a steady state for 10 frames
    2. The sim has managed to keep going for 60 seconds since the last re-init.

    Some future improvements ideas that I might try put in:
    1. Have it do some sort of smooth animation when it needs to reinit (maybe a fade to black, then fade the new cells in).
    2. Come up with alternate color palettes, and rotate between those for each sim.
    3. Maybe have the colors, and other setting stored on the SD card to make it easier for others to come up with and share cool looking configs.

    Overall, pretty fun little project. Took a couple of re-writes to work around mem limits of the board. Seems like if you need something like ~900B of free memory for the stack before the GM will not boot past setup. 🙂

    Attachments:
    You must be logged in to view attached files.
    #1915
    Edmond
    Participant

    Previous post rejected attaching the FW src *.ino file. Attaching as a zip this time.

    Attachments:
    You must be logged in to view attached files.
    #1917
    Edmond
    Participant

    Found some time today and it didn’t take that long to finish up. I think this is probably a good finished version.

    Changes:
    1. Added a nice simple fade in/out when one run ends and another starts.
    2. Adjusted delay values to make things more pleasant.
    3. Added multiple different color combos for the dead cells. It will pick a random palette at the start of each run.
    4. Fixed a bug in the random code. (I was having to put in a dumb delay instead of just looping on the sample_waiting bool. Had to make declare it volatile to make sure the compiler didn’t stick it in a reg and enter a inf. loop).
    5. General code cleanup to make sure all variables are typed correctly.

    Attachments:
    You must be logged in to view attached files.
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Firmware Modding’ is closed to new topics and replies.