Cellular Automata Territory Acquisition (C.A.T.A)

A walkthrough of Kata, a two-player cellular automaton game in Chaos software. Players alternate strikes, blocks, and meditation moves while the board evolves each turn. The game ends when one player's health drops to zero, with automatic rule resets at score thresholds of 48, 32, and 16.
Chapters
Hello and welcome to Chaos. Today we will be exploring the cellular automaton territory acquisition method inside of the Chaos software. So in order to start it up, you want to go to the GitHub repository, the kata folder, and then there are going to be two files in here we care about. There's the kata instructions which is just a text file outlining everything I will go over in this video with some visual, uh, visualizations to help you kinda understand what's going on. And then there's the Kata executable. So we're gonna start that up. Alright, so first things first, what is Kata? Kata is a game where 2 players compete to dominate the game board with their color and reduce their opponent's score faster than their own. So there are 3 windows. There is the game board, the rule board, and then the score window. And in this video, uh, I will first go over, uh, what all the windows are doing and when you should be paying attention to them. Then I will go over the controls, how you can manipulate the various windows. And then I will do a couple of simulated rounds so you can see how two people might play a game. And then once all that's done, I will go over some of the specific events that happen at certain scores. So to begin, back to the windows. So the largest one in the center is called the game board. In a fresh game, there will be 4 squares. There will be 2 white diagonal from each other and 2 black. And each of those squares, as you can see, has the opposite color pixel in the center of it. So this is where the actual cellular automaton rules get applied. If you See here on the rule board, I'll go over how this works in a little bit, but if I change positions in the cellular automaton rule, things will start to happen, and the 2-dimensional cellular automaton will be dynamically applied based on whatever rule happens to be there at that time. So we're going to clear this so you get an idea how that works. And then there's a rule board over here. Um, so upon start, the rule board is divided into two collections of 16 tiles. The top half of the board is Player 1's, the bottom half is Player 2's. So the top half of the board, or Player 1's tiles, represent all the neighborhoods that have a black cell at the center. And then the bottom half of the board, Player 2's, represents all the neighborhoods that have a white cell at the center. And you can change any of the 32 rule positions just by clicking on them. Alright. And so the tiles are numbered 1, 2, 3, 4, 5, 6, 7, 8, and so forth. So, and then the neighborhoods are determined by a binary conversion of that number. So if we're looking at this tile number 1, so z— sorry, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, and so forth down to 31. So if we're looking at the binary conversion of the 1 tile, It'll be right here. And the neighborhoods, uh, follow a center, up, right, down, left, uh, order. So the first value will be the center cell because it's a 0. Second value will be up. That's right. Third value will be right. Fourth value will be down. The 5th value will be the left neighbor. And you can see 1 and 17. And so let's just say I was to change this to a 1, ignoring this value right now, that 1 is now in the right position, so the neighbor to the right would be changed to a 1. All right, so that's it for the rule, uh, rule board. And next we're going to look at the scoreboard. So the scoreboard is this command prompt window on the right. Uh, it's very simple, there's no interactions, uh with it. It just shows the result of various actions taken by either player. It will show the status of the game, whether it's paused or not, and then upon pause it will say "PAUSE," and then upon unpause it will show Player 1 and Player 2 score. Alright. So now for controls. So the first and the simplest control is the Escape key. If you have selected the game board or the rule board and you press the Escape key, it will shut down the game and start it up again. It is ineffective on the scoreboard, so just keep that in mind. The second key is the Tab key. So the Tab is what you're going to use to start and end each turn. So pressing Tab once from a fresh game with the game board or rule board selected We'll pause it, and then while the game is paused, any changes made to the rule board will be ineffective until the game is unpaused. And so if we unpause it, we will see that now the cellular automaton rule will be get— will get applied, and it shows us these scores resulting from the initial board state. Alright, so then we pause again. Just gonna clean this up real quick. Alright, so now it's unpaused because the, uh, you see the two player scores, um, and then the third control is the Enter or Return key. So while the game board or the rule board is selected, pressing the Enter key will revert it to its initial position or its initial orientation. It'll kind of reset it. And then the final avenue for control is clicking. So clicking on the ruleboard, or due to some kind of funny quirks, you can affect changes on the ruleboard in an area equal in size to the ruleboard on the gameboard. So just be aware of that as you are playing. Alright, so I'm going to clear the rule board, wipe the game board, and we can get into a mock turn. Okay, so each turn has 2 phases. There is an action phase and a reaction phase. So to begin the action phase from a fresh game, you want to press Tab or pause the game. So this starts the action phase. Uh, during an action phase, each player gets 2 moves. A player can strike, block, or meditate. So a strike is when a player changes a tile on their opponent's side of the board to their color. So a strike from player 1 onto player 2 would be player 1 going from their side of the board to their opponent's and changing one of their tiles to black. And then a strike from Player 2 to Player 1 would be Player 2 going from their side of the board to Player 1's side of the board and changing one of their tiles from black to white. So a block is when a player changes one of their tiles to their color. So a block for Player 1 would be changing a white tile to black, and a block for Player 2 would be changing a black tile to white. And then meditation. So a meditation is when a player who is currently losing opts to reset the board at the beginning of a reaction phase. So let's say that Player 1 struck Player 2, Player 2 struck Player 1, Player 1 struck Player 2 again. And Player 2, Player 1. Then we unpause. We see the result. So that counts as the first move. So on the first move, each player must strike twice. And now if we're on the second move, we see that player 2 is currently losing because they start at a single point disadvantage in a fresh game. And so now player 1 and player 2 each have the option to block, attack, and player 2 has the option to meditate if they so wish. So Player 2 is going to go first. They're going to block. Player 1 is going to strike. Player 2 is going to opt to meditate, so that means they use up one of their turns, or they forego one of their turns during the action phase. And so Player 1 is going to strike again. And so in order to execute a meditate, after the game is unpaused, while it's running, Player 2, at a moment of their choosing, regardless of what the score ends up being when the reaction phase begins, may clear the board Then we pause, and that is the conclusion of the first two turns. So, uh, now Gonna speak a little more in depth about the reaction phase. We just learned that in the action phase there are 3 moves. You can strike, block, or meditate. Strike is going to your opponent's side of the board and changing their tile to one of your colors. A block is going to your side of the board and turning one of your tiles back to your color. Then meditate is while the game is running hitting the return key and resetting the board. Only the player who is losing during the action phase, during the last action phase, can meditate. So then, reaction phase, as you've seen, that is where the meditations occur. But the other thing about the reaction phase— let me just mess around with this to get a good demonstration— is sometimes cellular automata don't always settle to static patterns. Sometimes you will get something that is either an infinite loop or takes so long to resolve that it's not worth, uh, not worth waiting. In the event that you find yourself watching a pattern for more than a minute, the player who, uh, is losing during that reaction phase gets to choose when to pause. So in this case, Player 1 would be able to choose when to pause. And so, yeah, so Player 1 would be able to choose when to pause, and then the next action phase begins. And then the final particular about each turn, so I'm going to reset this. So as we see, we paused, we're in a new action phase, player 1 is currently losing. Let's just say that this is our board state. Oh, yeah, so Player 1 is currently losing. So if in this move Player 2 attacks, Player 1 attacks, Player 2 attacks, but then Player 1 decides to meditate, we would end the action phase and begin the reaction phase by pressing Tab, unpausing, The board starts to run. But remember, Player 1 opted to meditate on this move. But for Player 1, they might like how this looks, you know, they might not want to meditate because they might not know what the meditation will do or if it will give them a more favorable board state. So in the event that Player 1 forgoes their meditation. So let's say that Player 1 decided, "You know what, I like this board, I'm just gonna roll with it." Let's pause the game, let's start the next action phase. Now on this action phase, Player 2 will have 3 moves. They can still only block once per turn, but now they get— now they have up to 3 strikes. So in this turn, Player 1 strikes— sorry, Player 2 goes first. So Player 2 would strike, Player 1 would strike, Player 2 would strike, Player 1 would strike, and then because Player 1 gave up their meditation, Player 2 gets an extra strike. So they will strike one more time, and that will be the move. Um, so that is most everything, I believe, that can happen. During a regular turn. And then the last thing is the scores. So as you'll see, each player starts with— here, let me clear this real quick. You know what, let's start a new game. Alright, so we're starting a fresh game. So you can't see it, but each player starts with 64 health points. If you pause and unpause, so that is just a blank round, you will see that it says Player 1 has 62 and Player 2 has 61. One health point is equivalent to a quarter of the game board filled with an opponent's color, and Upon the initiation of each reaction phase— so we're going to pause. So this is the action phase. Let's say actions are taken, what have you. Upon unpausing, or the initiation of the reaction phase, the number of white and black cells are calculated and then applied, uh, or, and then subtracted from their opponent's health bar, or yeah, health points. So, and 1 health point is equal to a quarter of the game board filled with a color. So if nothing else, if no moves are made on the rule board, the health points will just decrement by 2 for 32 moves until until player 2 loses, effectively. Alright, so let's start it up again. And then the only other thing that happens is you might have seen— I'm going to— So if scores are going down by 2, once— or if a player's score is equal to 48 or 16, the game board will reset. It will be in a— what's it called? Effectively, it is as if a player meditated, but neither player can choose to do it or can prevent it. So if you'll see on this next turn, Player 1's score will equal 48, and the game board will reset. So if a player's score equals 48 or 16, the game board will reset. And then if a player's score equals 32, the game board and rule board will reset. Um, yeah, and, uh, the only other thing is the first player's score to reach 0, uh, will also reset the game and rule board. That player will lose. I think I've already said this, but because Player 2 starts with a point disadvantage, they get to go first. And I hope you enjoy. Yeah, fuck it.










