4 ms·
Is the score and game over message part of the automaton? Couldn't quite tell from the debug pixels output.
by pvg 8y ago
Is the score and game over message part of the automaton? Couldn't quite tell from the debug pixels output.
- uranium 8y agoYes, everything inside the canvas is part of the same giant automaton, and follows the same rules. In fact, @imode, if you want to look at one of the smaller state machines, look at the scoreboard code in https://github.com/ericu/CellCulTuring/blob/master/scoreboard.js https://github.com/ericu/CellCulTuring/blob/master/scoreboar.... It's a seven-segment display with some tweaks and a hack to show the game-over message. I initialize the scoreboards by drawing the segments in hard-to-see colors so that they're invisible when they're turned off. Each cell of the scoreboard always knows the current score; they propagate the updates to each other as fast as the find out about them. Each segment has an ID [a different color field] and a lookup table that tells for which scores e.g. ID 3 should be visible. So then when each segment is supposed to be visible, it sets a high-order color bit to show up. That's one of the few places that I actually have to set bits just for visibility. For the ball, wall, paddle, and such I just chose the bits such that you could see what the cells were naturally--I didn't have any bits to spare. For the sub-space of bits allocated to the scoreboard, I've got plenty extra. I was considering doing a fancier font using a 1-hot encoding instead of 7-segment, but I wanted to get this done.
- pvg 8y agoAh thanks, and I see the state change crawl up the border of the canvas that I missed before - I was looking for another 'wave' across the whole field.
- taneq 8y agoWow, that's awesome. The score display makes me think of some of the stuff that's been done in Wireworld: https://unnikked.ga/simulate-logic-circuits-using-wireworld-cellular-automaton-11391bc26b1c https://unnikked.ga/simulate-logic-circuits-using-wireworld-... (There was a similar thing posted here a while back, too, that used modified rules to make it a bit quicker and simpler, but I can't remember what it was called...)
- rzzzt 8y agoThe Powder Toy includes Wireworld elements, among other electronic bits: https://powdertoy.co.uk/Wiki/W/Elements:Electronics.html#WireWorld_Wire https://powdertoy.co.uk/Wiki/W/Elements:Electronics.html#Wir...
- taneq 8y agoThat's really cool, I'd never encountered Powder Toy before. Thanks!
- daveFNbuck 8y agoIs the AI part of the automaton too? I assumed that was programmed separately and I was a bit disappointed.
- daveFNbuck 8y agoNevermind, I just found the more revealing colors. That's great!