Menu
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Vault
Time Travel Schematics
T.E.C. Time Archive
The Why Files
Have You Seen...?
Chronovisor
TimeTravelForum.tk
TimeTravelForum.net
ParanormalNetwork.net
Paranormalis.com
ConspiracyCafe.net
Streams
Live streams
Featured streams
Multi-Viewer
Members
Current visitors
New profile posts
Search profile posts
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
General Discussion Forum
Computing, Gaming & Tech Talk
Langtoncraft: When Langton's Ant Meets Starcraft [WIP]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Num7" data-source="post: 253805" data-attributes="member: 1"><p>Hey everyone,</p><p></p><p>Have you heard of Langton's ant before?</p><p>[URL unfurl="true"]https://en.wikipedia.org/wiki/Langton%27s_ant[/URL]</p><p></p><p>It's a cellular automaton. A pixel-thing that moves on a pixel grid inside a simulation.</p><p></p><p>Its moving pattern is as follows:</p><ul> <li data-xf-list-type="ul">At a white square, turn 90° clockwise, flip the color of the square, move forward one unit</li> <li data-xf-list-type="ul">At a black square, turn 90° counter-clockwise, flip the color of the square, move forward one unit</li> </ul><p>Basically, it moves according to what color a pixel is. Then it switches this pixel's color. Repeat.</p><p></p><p>Here's an animated version from Wikipedia:</p><p><img src="https://upload.wikimedia.org/wikipedia/commons/0/09/LangtonsAntAnimated.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>After about 11,000 steps (movements), out of the chaos, appears a pattern, a highway:</p><p></p><p>[ATTACH=full]17602[/ATTACH]</p><p></p><p>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.</p><p></p><p>[ATTACH=full]17603[/ATTACH]</p><p></p><p>It also had a free-for-all mode, in which many ants were "fighting" and interacting with one another:</p><p></p><p>[ATTACH=full]17604[/ATTACH]</p><p></p><p>So, the other day, I was watching <a href="https://www.twitch.tv/directory/category/marbles-on-stream" target="_blank">Marbles on Stream on Twitch</a>, 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!</p><p></p><p>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.</p><p></p><p>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?</p><p></p><p>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.</p><p></p><p>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.</p><p></p><p>Here is what it looks like right now:</p><p></p><p>[ATTACH=full]17605[/ATTACH]</p><p></p><p>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.</p><p></p><p>The players in this screenshot are all fictional. But earlier today I booted it on Twitch and [USER=2]@TimeWizardCosmo[/USER] joined the simulation. It worked great.</p><p></p><p>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.</p><p></p><p>To be continued! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite38" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Num7, post: 253805, member: 1"] Hey everyone, Have you heard of Langton's ant before? [URL unfurl="true"]https://en.wikipedia.org/wiki/Langton%27s_ant[/URL] It's a cellular automaton. A pixel-thing that moves on a pixel grid inside a simulation. Its moving pattern is as follows: [LIST] [*]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 [/LIST] Basically, it moves according to what color a pixel is. Then it switches this pixel's color. Repeat. Here's an animated version from Wikipedia: [IMG]https://upload.wikimedia.org/wikipedia/commons/0/09/LangtonsAntAnimated.gif[/IMG] After about 11,000 steps (movements), out of the chaos, appears a pattern, a highway: [ATTACH type="full" width="525px" alt="1703877718925.png"]17602[/ATTACH] 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. [ATTACH type="full" width="658px" alt="1703877803339.png"]17603[/ATTACH] It also had a free-for-all mode, in which many ants were "fighting" and interacting with one another: [ATTACH type="full" width="669px" alt="1703877884729.png"]17604[/ATTACH] So, the other day, I was watching [URL='https://www.twitch.tv/directory/category/marbles-on-stream']Marbles on Stream on Twitch[/URL], 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: [ATTACH type="full" alt="1703878385546.png"]17605[/ATTACH] 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 [USER=2]@TimeWizardCosmo[/USER] 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! :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
General Discussion Forum
Computing, Gaming & Tech Talk
Langtoncraft: When Langton's Ant Meets Starcraft [WIP]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top