Attract and Repel (revisited, again)

For discussion of other cellular automata.
Post Reply
User avatar
SeanBP
Posts: 36
Joined: December 2nd, 2014, 12:49 am

Attract and Repel (revisited, again)

Post by SeanBP »

Hello!

10 years ago I posted this thread about a rule I had come up with, where cells can attract and repel other cells around it: viewtopic.php?f=11&t=1751. I later tried refining the rules, and posted it here: viewtopic.php?f=11&t=6454&p=182225#p182225, however this simplified version didn't produce as complex of a behavior as my first iteration did.

After messing around with it again, I found a better way to express the rules of the first, more interesting rule set, shown below. As this is a difficult rule set to implement into Golly, I wrote up a PyGame application to run it (which also can import/export patterns), which you can download here: https://github.com/SeanBP/Attract_and_Repel. I've also included a folder of some interesting patterns.

Video: https://imgur.com/a/v5GfB1R

Rules
Cell States:
- Empty (0): inactive
- Positive (1): attracted to neighbors
- Negative (-1): repelled from neighbors

Step Update Rules:
1. Compute Vectors:
- Around an active cell, compute two unit vectors from its neighbors:
- Cardinal: N, S, E, W neighbors weighted by absolute values
- Diagonal: NE, NW, SE, SW neighbors weighted by absolute values
- If the two vectors are exactly opposite, cancel both

2. Apply Influence:
- Choose neighbors along the vector's direction
- Add the cell's value (+1 or -1) to each selected neighbor in a new grid
- Do not double-count if selected by both vectors

3. Resolve New States:
- Set cell to 1 if total > 0
- Set cell to -1 if total < 0
- Set cell to 0 if total == 0
User avatar
SeanBP
Posts: 36
Joined: December 2nd, 2014, 12:49 am

Re: Attract and Repel (revisited, again)

Post by SeanBP »

I wanted to update this with a few interesting patterns that I've found. First, the basic patterns:

There are three basic types of spaceships, U-ships, diagonal ships, and bullet (cardinal and diagonal) ships. This shows the basic U-ship on the left, and how they can be chained together and widened:
Image

And here is the diagonal ship (which can also be chained), and the two bullet ships.
Image

Bullets make up the most common non-still pattern in random seeds, the basic bullet chain rake. This often keeps random seeds active as these wash over still lives to make more patterns.
Image

Now, some interesting puffers. This is a 4-period bullet chain breeder:
Image

A 128-period u-ship rake:
Image

A 48-period U+diagonal ship rake:
Image

A diagonal ship chain rake:
Image

And here are some other various patterns, like a replicator:
Image

And some oscillators:
Image

Since each cell is influenced by a 5x5 grid centered on it each tick, I believe this is unfortunately impractical to implement in Golly, so forgive the pattern images instead of proper pattern code. I've included all these patterns (and a few more, a gun, still lives, and a bunch of puffers) as txt files in my github, which can be copied and pasted into my pygame application to hopefully make sharing patterns a bit easier.
Post Reply