Episode 8: Mirrored pairs and p-mirrored formations
Sometimes we encounter a set of two of dancing fly formations which seem to be related. For example, when you compare FnF with BnB, the movement phases look very similar. Both formations are just going in a different direction: FnF goes left while BnB goes up. Also Lifted F-vortex and Lifted B-vortex look similar, but in a different way: the movements look similar but both formations go upwards.
When I observed these symmetries I got curious and investigated what the relations between these pairs of dancing formations exactly are. In this episode I will share what I found by introducing two types of symmetry relations between dancing fly formations: a strong 2-way relation called
mirrored pair and a weaker 1-way relation called
partially mirrored formation (abbreviated to
p-mirrored formation). I will explain both relations and show you examples of formations for which these relations hold.
Perhaps these concepts are useful to discover new dancing fly formations, based on existing ones. Or they help understanding why certain types of formations do not exist.
Mirrored pairs
A pair of dancing fly formations is called a
mirrored pair if they have the same number of phases in the short loop, and each phase of either formation can by transformed into a phase of the other formation by:
- Replacing fireflies by butterflies and vice versa.
- Mirroring the location and direction of all flies in the diagonal line from top-left to bottom-right.
Why should the
diagonal line be used as a mirror, instead of any other line? Well, the combination of the following properties of the diagonal mirror assure that it may work:
- The moving direction of flies is swapped. For example, fireflies moving counter-clockwise are replaced by butterflies moving clockwise.
- Cave scanning from left to right becomes equivalent to cave scanning from top to bottom.
- Cave scanning from top to bottom becomes equivalent to cave scanning from left to right.
Let’s look at an example to clarify these matters.
FnF & BnB
The simplest example of a mirrored pair is FnF & BnB. Below picture shows all phases of both formations and illustrates the mirroring in the diagonal line for each phase.
So, each phase of FnF is the mirrored image of a phase of BnB and vice versa. This mirroring only works in the diagonal line, because only then it is possible that the movements of fireflies correspond to movements of butterflies, including the interaction between two flies.
Some time ago, I wondered why FnF goes left while BnB goes up. My reasoning: “Fireflies move left and butterflies move right, so if FnF goes left then BnB must go right.” To me, it felt strange at first that BnB goes up instead of right. Now, with the concept of mirrored pair, and the fact that the diagonal line must be used as mirror, the difference in moving directions is easily explained: if you draw an arrow pointing to the left and mirror it in the diagonal, the result will be an arrow pointing upwards.
Not every dancing formation forms a mirrored pair with some mirrored counterpart. This is because the BD engine scans all elements in a cave row-by-row, so
first from top to bottom and
then from left to right. Mirroring a formation in the diagonal line does not change this order - the BD engine will still work in the same way is it usually does. But it depends on the formation whether this order is relevant. The condition under which a formation forms a mirrored pair could be formulated as follows:
Condition for mirrored pair:
In each phase, the movements of the flies are the same when either row-by-row (from top to bottom, from left to right) or column-by-column (from left to right, from top to bottom) cave scanning would be applied.
For FnF and BnB, this condition is satisfied, because only two flies are involved, and at any time when they interact, both are always present on the same row or on the same column. So row-by-row and column-by-column scanning always result in the same movements of both flies.
Partially mirrored formations (and pairs)
Next to the concept of mirrored pair discussed above, let’s introduce the following weaker variant of this relation. A dancing fly formation A is said to have a
partially mirrored formation (or
p-mirrored formation) B if B is a dancing fly formation which results (directly or indirectly) from mirroring any of the phases of A in the diagonal line and replacing fireflies by butterflies (and vice versa).
So, in order to check whether a dancing formation A has a p-mirrored formation, you have to do the following: For each phase, build in the Construction Kit the mirrored setup (with swapped types of flies and the locations/directions mirrored in the diagonal), and test whether this setup results in a dancing formation. If you have found at least one dancing formation, this is a p-mirrored formation B of A.
Note that it is allowed that the mirror image of a phase of A is not directly a phase of B; it is allowed that when running the cave, the resulting setup transforms indirectly (after some frames) into a phase of B.
Nevertheless, if the mirror image of the A phase
is directly a phase of B, then we know that, conversely, A is also a partially mirrored formation of B, so then the relation is two-way and we could speak of a
partially mirrored pair.
Are you still following me?
Here's a summary of the possible situations:
- If for all phases of A the mirror image does not give a dancing formaton, then there is no relation at all.
- If for at least 1 phase of A its mirror image leads indirectly to a dancing formation B, then B is a
p-mirrored formation of A.
- If for at least 1 phase of A its mirror image is directy a phase of dancing formation B, then A and B are a
p-mirrored pair.
- If for all phases of A the mirror image is directly a phase of dancing formation B, and A and B have the same number of phases, then A and B are a (fully)
mirrored pair.
Clearly, if any pair of formations is a mirrored pair, it is also a partially mirrored pair: this is a weaker relation.
Also, it is possible that a dancing fly formation has multiple p-mirrored counterparts, while it forms a (fully) mirrored pair with at most one other formation.
Lifted vortex formations
An example of a p-mirrored pair is Lifted F-vortex & Lifted B-vortex. Below picture shows each phase of Lifted B-vortex together with its mirrored image.
The following remarks can be made per phase:
- Phase 1: The mirrored image does not give a dancing formation. Instead, the 3 flies keep spinning around.
- Phase 2: Idem.
- Phase 3: The mirrored image is not a phase of any known formation, but after one frame it equals phase 3 of Lifted F-vortex, and as such it transforms indirectly to this formation. This proves that Lifted F-vortex is a p-mirrored formation of Lifted B-vortex.
- Phase 4: The mirrored image equals phase 3 of Lifted F-vortex. Now we know that also conversely, Lifted B-vortex is a p-mirrored formation of Lifted F-vortex, so both formations form a p-mirrored pair.
- Phase 5: The mirrored image equals phase 4 of Lifted F-vortex.
As we have seen earlier, the break-in of the FF into the B-vortex happens just after phase 5 of the Lifted B-vortex. Interesting to note is that a similar break-in does not happen for the mirrored image. Instead, the break-in of the BF into the F-vortex happens one frame later. Due to the Boulder Dash engine rules, both dancing formation have a different natural point of breaking in, which aren't each other’s mirrored point in the diagonal:
- Lifted F-vortex: the break-in point is at the left/top of the vortex: the BF moves right (clockwise) and is scanned first at that point.
- Lifted B-vortex: the break-in point is at the top/right of the vortex: the FF moves left (counter-clockwise) and is scanned first at that point.
So, although both formations are based on the same principles, they are not exactly each other’s mirror image. Instead of a mirrored pair, they form a p-mirrored pair.
What about Gear Wheels?
The Gear Wheels formation is a combination of the Lifted F/B-vortex formations. It turns out that this formation forms a p-mirrored pair with itself!
Below picture shows phase 3 of Gear Wheels together with its mirrored image.
The mirrored image is not exactly a phase of Gear Wheels, however, after one frame it equals phase 1 of Gear Wheels.
Fright-x formations
There are several dancing fly formations which stand alone, in the sense that a (partially) mirrored counterpart formation does not exist.
Below picture shows the crucial phase 7 of Fright-3 (when the rival-FF breaks into the vortex), together with its mirrored butterfly image. (For simplicity, the colors of the butterfly image are the same as for the corresponding fireflies.)
Because of the row-by-row scanning, the green firefly breaks into the vortex. However, the green butterfly does not yet break in at this point. So the next frame will be different for the butterfly setup. The green butterfly will move 2 positions around the vortex and break in at the left/bottom side. This step splits the vortex without forming a new vortex, which ultimately leads to all 3 butterflies spinning around individually.
It is possible to do a similar test for all other phases of Fright-3. For all these phases, the mirrored image leads to a similar set of 3 butterflies spinning around.
So, Fright-3 does not have a (partially) mirrored counterpart. By the way, this should not come as a surprise, since we already know from previous episode that a dancing fly formation with 3 BF does not exist.
But what about Fright-4?
Perhaps surprisingly, the Fright-4 forms a p-mirrored pair with The 4 Elements. This formation consists of 4 BF moving down-left, and will be discussed in more detail in the next episode. Actually, I already had a feeling that Fright-4 and The 4 Elements might be related, but now this relation is confirmed.
Below picture shows phase 8 of Fright-4 together with its mirrored image.
This mirrored images is exactly one of the phases of The 4 Elements. Although the green FF breaks in after this phase, the green BF won’t do so yet. Instead, it breaks in two frames later, after which it starts a new vortex with the blue BF behind him.
For the other phases of Fright-4, some of them lead to 4 spinning butterflies, some lead indirectly to a phase of The 4 Elements, and some are directly equal to a phase of The 4 Elements.
So clearly, Fright-4 & The 4 Elements are a p-mirrored pair.
And Fright-5?
Given that Fright-4 forms a p-mirrored pair with The 4 Elements, one might guess that Fright-5 also forms some sort of pair with an “extended version” of The 4 Elements. This is not the case. Below picture shows phase 3 of Fright-5 together with its mirrored image.
For this phase, and also for the others, the mirrored image ultimately leads to 5 spinning butterflies. The problem here is similar to Fright-3's mirrored image. When the yellow BF breaks in at the left/bottom corner, it starts a new vortex with the purple BF. Afterwards, the green BF approaches, but at the moment of breaking in, he is alone: there is no BF behind him to start a new vortex. So the vortex is split and all 5 BF take an individual position, where they start spinning around independently.
Until now, we have discussed the following relations:
-
FnF & BnB: mirrored pair;
-
Lifted F-vortex & Lifted B-vortex: p-mirrored pair;
-
Gear Wheels: p-mirrored pair with itself;
-
Fright-4 & The 4 Elements: p-mirrored pair.
Several other (p-)mirrored pairs exist, for example, the mirrored pair Crawling-F4 & Crawling-B4, which will be treated in a later episode.
So what’s next?
The existence of (p-)mirrored pairs can be used to discover new dancing fly formations. From now on, whenever a new dancing fly formation is discovered, it is a good idea to check for each phase whether its mirrored image results in another dancing fly formation.
In the upcoming articles, when I discuss a dancing formation, I'm planning to also discuss the existence of any (p-)mirrored counterpart formations.