Log In  

Hi everybody,

Here is my first cart, a version of Conway's Game of Life.

I hope you'll like it :)

Cart #this_is_no_qr_code-0 | 2022-01-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#104554 2022-01-08 18:19


This is actually pretty fantastic and interesting to explore, @hpcodecraft. Gold star work.

I'm going to post a version here though that moves the arrows and plotter as fast as the block size you are using to draw with and with less hiccup.

Cart #this_is_no_qr_code_mod-0 | 2022-01-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I will tell you - when you are redrawing the screen at a pixel size of 1x1 each frame, you might just XOR the cursor there and it will be about 100x faster and smoother to work in the field.

If you like, I can give you an example.

P#104566 2022-01-08 20:16 ( Edited 2022-01-08 20:19)

Hello @dw817, thanks for your reply :)

I've compared your version with mine and saw you removed the throttling from the cursor (this I understand), and put in three poke-statements. These I don't understand, could you explain what they do? I'm not into the whole memory part of PICO-8 yet.

Also, for the XOR the cursor thing you mentioned, an example would help me a lot! I noticed the speed gets really low and there are frame drops with grid size 1 & 2, if I try to draw every frame. That's why I also put in some throttling there, so that the player at least can see every generation.

If you know a way to make this better, I'd be happy to learn about it.


P#104647 2022-01-09 11:11

Ummmm so what exactly is this?

P#104652 2022-01-09 13:29

@Enderboy011 It's my PICO-8 version of "Conway's Game of Life", a "zero player game" - you input an initial playfield and then see how it evolves.

The evolution follows these three rules only:

  1. Any live cell with two or three live neighbours survives.
  2. Any dead cell with three live neighbours becomes a live cell.
  3. All other live cells die in the next generation. Similarly, all other dead cells stay dead.

The game has been invented in 1970 and new patterns are still found today. It also is turing-complete, which means you can build a computer inside the game (if you're patient and have a large play field).

If you want to learn more, there is lot of info to find via Google (including a google easteregg).
Youtube has some nice videos of crazy stuff people do with it, I recommend "epic conway's game of life" by Rational Animations, for example.

P#104653 2022-01-09 13:55

Very nice! Not sure if this is interesting to you, but the technique from https://www.lexaloffle.com/bbs/?tid=46044 seems like it could be used to get fast updates at 128x128. 60fps should be possible, I think - you can certainly get the neighbor count much faster than that, not sure what the extra shifts and boolean ops required to go from neighbor count to actual cell values will do.

P#104657 2022-01-09 16:14 ( Edited 2022-01-09 16:26)

@luchak realtime game of life has already been done:

this is indeed using heavily memory operations to operate on multiple cells with as few operations as possible.

P#104663 2022-01-09 17:51

@luchak @freds72 Thanks for your replies, there's some good learning material for me!

P#104664 2022-01-09 18:01

@freds72 Good callout! I guess I should have expected that this had been done. The approach taken in that cart also makes a lot more sense than what I was suggesting; no need to keep the same format as screen data for the grid.

P#104669 2022-01-09 19:04 ( Edited 2022-01-10 01:37)

That is pretty fast animation agreed, yet I happen to like @hpcodecraft's rendition more cause it has more options that allow you to explore the anomaly in closer detail.

Oh, and here is an example of XPLOT. Back in the day we had to do this to move graphics over backgrounds in computers that couldn't redraw the screen every cycle because they were so slow.

Cart #xplot-0 | 2022-01-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Someone may mention, you could use memory transfers too for the screen which would be far easier than xplot, now that the cork is out of the bottle we have a new 32k of memory to play with.

P#104699 2022-01-10 01:21 ( Edited 2022-01-10 02:58)

@hpcodecraft still how do i play its confusing

P#104848 2022-01-11 23:30

[Please log in to post a comment]