Everything around lightning network powered Game of Life at satoshisgameof.life
People
Repo info
Activity
Andrea
@miniguzi_twitter
Great game! I enjoy observing the different patterns.
Very easy to pay with lightning network
adler99
@adler99
please don't use space fillers etc. The protocol server-client doesn't handle very well too populated universes
STAWKEYE
@STAWKEYE
This is really cool, congrats. First tiem I tried I (for some stupid reason) refreshed the browser after my lightning payment had cleared on my phone but before the pattern populated in the browser. Nothing happened and so I re-drew the pattern and repaid. This time it worked, but the first payment is spent but no pattern. Only telling you for bug reporting purposes, I certianly don't want a refund on 48 satoshi or whatever it was!
adler99
@adler99
@STAWKEYE sorry to hear that! that's a known design bug, the Satosh's Game of Life page needs to be connected to the server for the payment to be associated with your pattern... a refund would be possible thanks to lightning, just send me an invoice ;-)
STAWKEYE
@STAWKEYE
I'm not worried about the 48 satoshi of course, but if you wouldn't mind here's an invoice so that I can test out my upgraded Eclair mobile wallet! It's supposed to be able to accept payments via mobile now which is great!
If it doesn't work, no worries. Also FWIW I have since made 3 more payments to your site to make patterns and they all worked great! (I didn't refresh the pages that time!)
STAWKEYE
@STAWKEYE
Any place to see a picture/gif of the patterns in your catalog without manually selecting and placing them? Like a summary sheet? I'm having way more fun with this than I should, good job!
adler99
@adler99
Hi, sorry that I didn't send your 48 satoshis yet... the invoice expired. Could you generate one with expire date far in the future? To see patterns and learn about them, I recommend browsing http://www.conwaylife.com/wiki/Main_Page If you want to go deeper into Game of Life you can try out Golly (http://golly.sourceforge.net/) no shared universe, no lightning payments ;-)
Its on my feature list to add links to the corresponding wiki page, or include it somehow in the pattern list...
STAWKEYE
@STAWKEYE
Sure thing! New invoice attached, however my mobile wallet doesn't seem to let you change the expiry so I'm not sure how long it lasts. If it expires again no worries.
I'll also point out this nice reference I found if you didn't know about it. Allows you to load the patterns and see them in action before placing in your board.
@adler99 I asked the Eclair devs and I had been working under an incorrect assumption. The mobile wallet can receive payments, but the app must be running on the phone at the time the payment is made. He sent me a test payment and verified that it works, which is all I wanted anyway. I'm attaching an invoice using my "full" Lightning Node which is online 24/7 and has a 5 day expiry, but you don't need to pay it unless you feel like having an excuse to mess with Lightning, haha!
Lightning is awesome. May we some day regret tossing valuable satoshis around much the same way as the "Bitcoin Pizza Guy" years ago... haha
adler99
@adler99
Hehe, I hope so ;-), BTW Satoshi's Game of Life has some performance issues right now, I'll fix that in the near future. Maybe by cleaning up some 'star dust'...
adler99
@adler99
@/all universe was cleaned up. After fixing the universe we might be able to reactivate the old state of the universe. I'll keep you posted.
STAWKEYE
@STAWKEYE
I think I broke it - I placed a "breeder" which apparently sweeps the whole board with pixels and I imagine after a while it really killed performance. I won't spawn any more big stuff, but you may want to remove the breeder form your dropdown if that's what did it.
It did get me thinking, though - I know it's not in the spirit of the original game, but as a way to "clean house" could each pixel have a shelf life? That may not work if expiring cells cause patterns to collapse and "explode", taking neighboring patterns with them, since cells would be continually expiring all over the board.
adler99
@adler99
Don't worry, I left them intentionally in the game because they are great patterns and if you explore them in a small scale the universe can handle it. Actually the performance bottleneck is the transfer of universe state to the browser. The server side algorithm is quite efficient and uses the redundancy in many large patterns.
adler99
@adler99
I thought about shelf life of cells... and that maybe it could be coupled with economic incentives, e.g. a breeder would need a lot of funding to keep it running... but that's complicated matter because each live cell has more then one parent. You would need to keep track over many generations which live cells were born and should be discounted from which account. I didn't find a good set of rules to do that. Input and discussion is very appreciated! As a side effect any bookkeeping of that kind would break the efficiency of the algorithm.
STAWKEYE
@STAWKEYE
I was thinking along the lines of every cell has an age variable that increments by 1 every step that the pixel is on and resets to zero every time the pixel is off. Not sure how it's coded but it could be an array with a cell for every pixel containing the age of the corresponding pixel. Pixel forces to off when X=someshelflife. In regard to shelf life no pixel keeps track of any other pixel, it just has its own number. There would be no economic incentive; all pixels would just die off after some time. Repeating patterns that cycle every pixel would never die, since each pixel would reset to zero before shelf life is hit. (Fun thought experiment: Is there any pattern that remains in one location (i.e. no ships) that would never die?)
All that being said, I still don't think it would work. Patterns collapsing, exploding, and screwing up everything nearby causing constant chain reactions of destruction. Although that may be fun too...
adler99
@adler99
I guess a breeder could survive such a rule set, at least the gliders move always, so they would probably never reach the max cell count. There are periodic patterns that stay in one place. The challenge is to find high periodicity patterns with a low cell count ;-)
adler99
@adler99
Coding: array of cells has it's limits, imagine having a 1 million x 1 millon universe ... (Satoshi's Game of Life's is much bigger ;-) and most of the cells are dead. SGoL uses quadtree data structure with heavy caching and memoization to reuse equal parts of the universe. The algorithm is called hashlife. I published the algorithmic heart of it here: https://github.com/noctilu/quadtree
STAWKEYE
@STAWKEYE
Ah I guess I never zoomed out enough - I assumed you had smaller bounds on the universe. In my mind the breeder and the gliders would never die, but the Gosper guns would (they have 2 still-life blocks each and would therefore expire) and the breeder/gliders would at least eventually fly out of bounds.
And with the gosper guns dead, the gliders would be in finite supply and eventually clear out.
Wish I knew how to code - it would be fun to modify your code to also mimic magnetism, whereby you place bodies and they automatically distribute in a bounded space by repelling each other until an equilibrium position is established. You could even substitute the equations for magnetic repulsion with gravitational attraction, and with the flip of a switch go from bodies repelling toward equilibrium to the same bodies attracting, combining, and ultimately collapsing into one large body in the center. I know how to do this in VBA, but that would be a laggy mess with that many cells in Excel trying to do this ;-)
adler99
@adler99
Would be a great exercise to do Game of Life in Excel ;-)