Hey everyone,
Have you heard of Langton's ant before?
en.wikipedia.org
It's a cellular automaton. A pixel-thing that moves on a pixel grid inside a simulation.
Its moving pattern is as follows:
Here's an animated version from Wikipedia:
After about 11,000 steps (movements), out of the chaos, appears a pattern, a highway:

About 6-7 years ago, I created a Python version with a friend. It simulated a Langton's ant, in a classic, infinite mode. Here's an example in which you can see the highway crossing-over from one side to the other.

It also had a free-for-all mode, in which many ants were "fighting" and interacting with one another:

So, the other day, I was watching Marbles on Stream on Twitch, and I was thinking to myself, how clever it was. Marbles on Stream is a random game of marbles rolling down paths and obstacles. Nothing special there. What's special is that when you're watching a stream, you can type !play in the chat and join the game. From the Twitch chat!
So I was wondering, what kind of game or simulation could I possibly create that could integrate with the Twitch chat in such a fashion. I kept thinking about it for a little while, until, suddenly, I thought of this Langton's Ant simulator we created years ago. What if I stream it and have people from the chat join and have their own ant? That sounded cool.
So I went ahead and started modifying the code. I was able to easily integrate the thing with Twitch. It works pretty good. But the free-for-all you see above, this colorful mess, is pretty boring. It takes place in a blank space. So I decided to have it take place on a map instead. Now, what kind of map could I use? Am I supposed to create one?
I happened to randomly watch a dude stream Starcraft Brood War on Twitch. Then I thought... Why not have the Langton's ants fight on a Starcraft map? Why not "The Hunters"? The absolute classic. So I went ahead and implemented this map with collision detection that would prevent ants from moving over certain types of terrain (water in this case) and such.
Then it seemed only logical to add resources. Minerals and Vespene gas. At that point, I decided it was going to become a Starcraft-themed simulation.
Here is what it looks like right now:

When the ant moves close to mineral and Vespene geysers, it gathers some. The minerals are used to upgrade LVL, which allows your ant to move faster. Vespene gas doesn't have any use yet. Suggestions welcome. Perhaps a !boost chat command that would consume Vespene gas in exchange for a bonus? We'll see.
The players in this screenshot are all fictional. But earlier today I booted it on Twitch and @TimeWizardCosmo joined the simulation. It worked great.
It's a pretty fun project, I gotta say I have a lot of fun coding it and having it evolve over its iterations. I haven't programmed like this in years and it feels awesome.
To be continued!
Have you heard of Langton's ant before?

Langton's ant - Wikipedia
It's a cellular automaton. A pixel-thing that moves on a pixel grid inside a simulation.
Its moving pattern is as follows:
- At a white square, turn 90° clockwise, flip the color of the square, move forward one unit
- At a black square, turn 90° counter-clockwise, flip the color of the square, move forward one unit
Here's an animated version from Wikipedia:

After about 11,000 steps (movements), out of the chaos, appears a pattern, a highway:

About 6-7 years ago, I created a Python version with a friend. It simulated a Langton's ant, in a classic, infinite mode. Here's an example in which you can see the highway crossing-over from one side to the other.

It also had a free-for-all mode, in which many ants were "fighting" and interacting with one another:

So, the other day, I was watching Marbles on Stream on Twitch, and I was thinking to myself, how clever it was. Marbles on Stream is a random game of marbles rolling down paths and obstacles. Nothing special there. What's special is that when you're watching a stream, you can type !play in the chat and join the game. From the Twitch chat!
So I was wondering, what kind of game or simulation could I possibly create that could integrate with the Twitch chat in such a fashion. I kept thinking about it for a little while, until, suddenly, I thought of this Langton's Ant simulator we created years ago. What if I stream it and have people from the chat join and have their own ant? That sounded cool.
So I went ahead and started modifying the code. I was able to easily integrate the thing with Twitch. It works pretty good. But the free-for-all you see above, this colorful mess, is pretty boring. It takes place in a blank space. So I decided to have it take place on a map instead. Now, what kind of map could I use? Am I supposed to create one?
I happened to randomly watch a dude stream Starcraft Brood War on Twitch. Then I thought... Why not have the Langton's ants fight on a Starcraft map? Why not "The Hunters"? The absolute classic. So I went ahead and implemented this map with collision detection that would prevent ants from moving over certain types of terrain (water in this case) and such.
Then it seemed only logical to add resources. Minerals and Vespene gas. At that point, I decided it was going to become a Starcraft-themed simulation.
Here is what it looks like right now:

When the ant moves close to mineral and Vespene geysers, it gathers some. The minerals are used to upgrade LVL, which allows your ant to move faster. Vespene gas doesn't have any use yet. Suggestions welcome. Perhaps a !boost chat command that would consume Vespene gas in exchange for a bonus? We'll see.
The players in this screenshot are all fictional. But earlier today I booted it on Twitch and @TimeWizardCosmo joined the simulation. It worked great.
It's a pretty fun project, I gotta say I have a lot of fun coding it and having it evolve over its iterations. I haven't programmed like this in years and it feels awesome.
To be continued!

Last edited: