A few months ago, I released a web app calculator for Pochi & Nyaa (2002), the little-known postmodern pet-themed fantasy falling-block puzzle game, which can be emulated with online multiplayer using Fightcade. Pochi & Nyaa was designed in response to the relative complexity of Puyo Puyo (1991) and its many sequels (1994, etc.). Puyo Puyo is famous for having an extremely high skill floor – when two players challenge, one player being even slightly more quick, efficient, or versatile with their piece placement can result in a genuinely insurmountable advantage for them.

Almost all of the complexity in Puyo Puyo comes from it being a "connect 4" game, similar to "match 3" games like Columns or Panel De Pon: because you cannot connect more than 3 same-coloured blocks without them clearing, play revolves around creating many same-coloured pairs of 3 and 1 (or 2 and 2), dividing them *using another pair*, and then using a single "ignition" clear to remove each division in sequence, causing each pair to fall together into 4, one by one, to produce a high-scoring chain reaction. While this system offers a lot of possibilities for creating and dividing these groups (especially since, unlike many other games, the connected 4 blocks do not need to be in a straight line), it also forces players to acquire a number of very difficult skills: not only do you have to be able to construct multiple divided pairs at once to be maximally efficient, but you also have to be able to read the opponent's board and immediately apprehend exactly how strong of a chain reaction they can produce, as well as read their "Next" piece windows to see when it's possible for them to set off the "ignition" clear at this very moment. Igniting a small but quick chain when your opponent cannot ignite their stronger chain is often enough to score a win out of nowhere.

Pochi & Nyaa is an attempt to simplify these skills by removing the "connect X" rule altogether - instead of joining a fixed number of blocks, pieces only clear when you place a special needle "ignition" block, similar to Super Puzzle Fighter II Turbo. But, unlike that game, you can summon the needle at any time, as often as you'd like. Thus, this game allows you to join as many same-coloured pieces as you'd like without having to use chain reactions (indeed, chain reactions give no additional bonus), and it also means that powerful structures resemble large, easily-readable pathways of same-coloured blocks. It also means that ignitions are much easier to forsee - since any number of blocks can be ignited, simply seeing a certain colour in the opponent's "Next" windows is enough to tell you that blocks of that colour are "ready to launch".

That being said… Pochi & Nyaa does force players to construct certain specific shapes of same-coloured structures in order to make powerful attacks. Attack power is based on "branching". When a structure is ignited by the needle, each block pops in turn as a wave. This wave travels down the "path" of the structure, increasing in value by 1 at each step. When the wave reaches a fork in the path, it *splits and multiplies*, with each split retaining the *full value* of the wave up to that point. Once a wave reaches the end of a path (henceforth, in keeping with the pet theme, a "tail") its value produces an attack which is sent to the opponent. The game's own tutorial (depicted above) shows a 7-block structure that splits into 3, and, as a result, has an attack value of 14.

There is also an extra rule about clearing single blocks (dropping a needle on 1 block by itself): even though that should be worth 1, its value is reduced to 0. This is consistent with the trend that, in versus puzzle games, doing the smallest possible clear (e.g. matching a single 3 in Columns or Panel De Pon) does nothing except remove the blocks. Because 1 is the smallest clear in this game, it is worth 0 as a special case. Henceforth, I refer to such clears as "1-tails", in the sense that the single block is the "tail" of itself.

Now, that algorithm seems on face value to be pleasingly simple, allowing players to easily grasp the power of a given structure by counting the tails in it, actually working out the exact figure in the spur of the moment is frightfully difficult when a structure is especially large.

Fig. 1: example of the kind of immense structures that are both easy and beneficial to build even in casual play. This has 7 tails… or does it have 8? Keep reading…

Thus, I decided to build this calculator web app. It shouldn't take too long, right? Just make a grid, let the user paint blocks on it, and show the numbers for exactly how much an ignition would be worth. What more do I need to know?

Of course, at this point, you probably have a number of questions regarding other structure shapes that *aren't* just clean trees of thin 1-block-wide lines. This proved to be one of the four major problems I encountered while attempting to make the calculator fully accurate.

## Problem 1: Rectangles

For example, in figure 1 above, you can see a 2x2 square near in the upper corner. How does the wave travel through that? Do all of the blocks in it contribute to the wave's value? I did some research into this question, studying the game closely. And eventually, with a spine-tingling chill, I came to the realisation that the rules for calculating the worth of these shapes… are **version-specific**.

Pochi & Nyaa was released for the Neo Geo Multi Video System (MVS) in 2002. It was then given an expanded PlayStation 2 port in 2003 with additional game modes, smoother controls, and the re-inclusion of formerly-cut characters. And, as it turns out, it diverges from the MVS version in the matter of calculating the value of structures. (One obvious case is in the simultaneous ignition of a 1-tail and at least one other block: on PS2, this prevents the 1-tail's value from being reduced to 0, but on MVS, it doesn't.)

Back to the question of rectangles and other lumps. What happens when the wave enters the square? It sounds like the wave splits and propagates to both corners. But what happens when they finally meet up in the final corner? Well, here is where the version difference comes into play: in the MVS version, *waves can merge*, but in the PS2 version, *they cannot*. On PS2, if two waves would continue to a block, only one does, and the other, if it cannot propagate anywhere else, *becomes a tail*.

Fig. 2: diagram of the differences between the PS2 algorithm (left) and the (assumed) MVS algorithm (right). On the left, the rectangle at the bottom counterintuitively contains 3 tails from this ignition, two of which are the result of waves being unable to merge. Note that the MVS calculation is not actually fully correct, as will be demonstrated shortly.

In figure 2, I show an important detail about the PS2 version: when two waves meet, the vertical-traveling wave gets priority over the horizontal-traveling wave, which produces a tree structure that favours vertical paths over horizontal paths. This actually makes a good deal of sense - given that the playfield of Pochi & Nyaa is taller than wide and blocks are affected by gravity, one can make, for instance, a 2x7 rectangle much easier than a 7x2 rectangle. If horizontal paths were prioritised over vertical paths, the 2x7 rectangle would, if ignited from the top, have 7 tails(!) and be extremely powerful as a result. As it is now, the more difficult-to-produce 7x2 rectangle has 7 tails instead, and the 2x7 only has 2.

Of course, that's only in the PS2 version. In the MVS version, something much more complicated occurs: not only can two waves combine back into one, but their resulting value is equal to *the set of all blocks visited by each*. This, surprisingly, means that each wave tracks each unique block visited (or perhaps just each coordinate in the playfield grid) and carries with it a list of visited blocks. Nevertheless, this was what my research provided me, so I implemented this algorithm into my calculator.

(Based on the findings reported in this section, you can work out for yourself how loops - closed circuits of same-coloured blocks - have their value calculated.)

## Problem 2: A mysterious undocumented version-specific bonus

Soon after nailing down that problem, I immediately ran into another: the MVS version's numbers were unexpectedly higher than my app was calculating. Consider a structure made of 6 blocks with 3 tails, each worth 3, 4 and 4. Now, 3 + 4 + 4 is 11, so it's worth 11, right?

And yet, on *just* MVS, it's worth 12. To quote a certain well-known riddle, *"Where's the extra 1?"*

Shortening the structure by 1 block, keeping the same number of tails, produces 2 + 3 + 3 = 8. The extra 1 is gone.

Not only that, but adding another tail and another block to the structure, which would seemingly produce 3 + 4 + 5 + 5 = 17, instead produces… 19. Now there's an extra 2??

Most vexing, however, was discovering, to my shock, that if one constructed the "14" structure shown in the game's own tutorial in figure 1, in just the MVS version, *it does not produce 14*. The extra 1 even appears here. The game's own tutorial (in just this version) is wrong!

Now, granted, I was already aware that the MVS version was released as something of a compromise, with characters cut and slightly stiff block-movement controls, so I wasn't entirely surprised that a discrepancy such as this was present. At around this time, I was glancing around the game systems page of the official Pochi & Nyaa website, and discovered a small extra detail in its description:

分岐補正 (bunki hosei, lit. "branch supplementation") seems to be an extra value in the formula which is entirely unmentioned in the game itself (and completely absent from the PS2 version). Buoyed by this finding, I proceeded to build various structures and compare their expected value, their actual value, and the number of tails they have. I'll spare you the spreadsheet screenshots, but my conclusions were as follows: on the MVS version, the value is increased by **4% per tail**, then rounded down. In the case of the 3 + 4 + 4 structure that has 3 tails, the 11 is increased by 4% x 3, or 12%. 12% of 11 is ≈ 1.32, so it is increased from 11 to 12 and the 0.32 is rounded away. Thus, an extra 1 is awarded.

I wasn't entirely sure at the time whether single lines were considered "tails" or not. If they were, then that would mean that a single line that's 24 blocks long is worth 24, but *a single line that's 25 blocks long would be worth 26.*

As revealed above, the 4% bonus indeed applies to single lines. I added this bonus to the calculator, and it seemed to hold up. Incidentally, I'm not entirely sure what the design purpose of this bonus is, especially given only one version of the game has it, but I assume it is a relic from earlier in development when value calculation was a lot more complicated. Remember that Puyo Puyo has a number of bonus multipliers for including different colours and different groups in chain clears, so it's likely that the developers were still thinking in that design space before deciding to simplify and streamline these mechanics.

## Problem 3: A literal corner case

The third problem yet again involved a version-specific MVS detail. This time, it involved placing the needle in the corner of a structure, such that it touches two same-coloured blocks at once. What happens there? Well, in the PS2 version, it would ignite both blocks, creating two waves which can't merge, so it's simple given what was found so far. But what about the MVS version?

In researching this, I ran headfirst into yet another discrepancy: even though the MVS version, as stated above, doesn't care about the orientation of structures when calculating value, in the case of multi-block ignitions like this, it actually does.

Fig. 3: example of two structures, with identical shape, and ignition point, but differ in final value (11 and 14, respectively) seemingly only because of their orientation.

In figure 3, the ignition on the left is worth 6, while the one on the right, which is *identical* to the one on the left *except being rotated 90 degrees*, is worth 7.

The breakthrough for this problem came fortuitously quickly: while investigating the matter, I soon discovered that the following ignitions (figure 4) have an identical value (7) even though one contains an extra block. This meant that the extra block's value was *completely wasted*, which could only mean that it was a 1-tail (and thus being reduced to 0).

Fig. 4: diagram of the values of each tail in these two ignitions. Note that the right side is identical in value to the left side due to the 1-tail being discarded.

But why was this being considered a 1-tail, instead of progressing to the left and merging with the wave above? The only possible answer I could come up with immediately explained everything about this problem: on the MVS version, waves can merge, *unless they have different starting blocks*. When the blue needle lands in figure 4, it ignites the middle and bottom steps, and thus creates two waves that cannot merge. The first wave consumes almost all the blocks, and the second only consumes the bottom step.

And, it would be very safe to assume that when waves in the MVS version cannot merge, the PS2 version's priority for vertical paths also comes into effect here. Thus, I was able to decipher the values for the structures in figure 3.

Fig. 5: annotation of figure 3 showing the values of each tail. Note that the 4% bonus is **not** included in this diagram, due to being applied after each tail's value is tallied.

Incidentally, I think I understand why this slightly counterintuitive limitation on wave merging is in place: each block that a needle simultaneously touches is considered part of a *completely separate structure* to the others. Often this makes sense (in the case of placing a needle between two separate vertical lines), but in this case, it does not. This may explain why the PS2 version stuck with a more consistent rule about merging, by forbidding it entirely. (Note also that in the game Nyoki-Nyoki Tabidachi-hen (2016), which uses similar mechanics to Pochi and Nyaa, needles cannot ignite multiple blocks at once at all, instead prioritising igniting the block below over those to the left and right.)

## Problem 4: 1-tails and the 4%-per-tail bonus

While testing the robustness of my solution to the previous problem, one final problem arose: I'd found a situation, *yet again on MVS only*, where it seemed like a 1-tail's value *was* contributing to the final value of an ignition, instead of being reduced to 0.

In this footage, the main structure is worth 20 (3 + 5 + 5 + 5 = 18, and 16% of 18 is an extra 2.88) but adding a single block - one which should have resulted in a worthless 1-tail - was instead adding 1 to the final value (pushing it up to 21). And yet, adding one more 1-tail to the mix did not add a further 1. What really bothered me was that, having demonstrated to my satisfaction that the 1-tail is considered a separate structure from the larger 4-tail structure, it was still influencing the overall value.

The fact that, on analysing the structure, the 4%-per-tail bonus pushed the structure up to 2.88 - somewhat close to 3 - made me assume that the 1-tail was influencing the value through that bonus. This made me realise that a number of lingering questions remained about this bonus:

- Is the bonus calculated on a per-structure basis (by increasing each structure's ignition value separately), or using the total value of all ignited structures?
- If the bonus is calculated for all ignited structures, do 1-tails have a value of 1 or 0 in that calculation? Does the 1-tail's inclusion mean the bonus becomes 16% of 19 (3.04), even though the base value is 18?
- If the bonus is calculated on a per-structure basis, does it still count other structures' tails anyway?
- Are 1-tails counted as tails for the bonus? Does the 1-tail's inclusion raise the bonus in that footage's ignition from 16% to 20%?

With further experimentation, and the input of the contributors to the Fightcade versus puzzle games Discord server "Puzzle Wednesday") in which I was discussing this problem, it was determined that the bonus is calculated using the total of all structures, and 1-tails have a value of 1 in that calculation (i.e. question 2 is answered in the affirmative), but does not increase the number of counted tails. So, for the second ignition in the above footage, the calculation is 3 + 5 + 5 + 5 + 16% of 19, which gives 21.04.

…Except, *why* doesn't it increase the number of tails? If the bonus is calculated using the total of all structures, why doesn't it count the tails in all structures? Is it because of a special case for 1-tails? Or… maybe it only counts the greatest number of tails in a single structure. I noticed that the game UI includes a box in the middle that shows the 最大分岐 (saidai bunki, lit. "greatest number of branches"), so maybe the game cares about that in particular.

This quick test, involving the simultaneous ignition of a 5-tailed structure (with base ignition value 26) and a 2-tailed structure (with base ignition value 4), confirmed that it was, indeed, the greatest number of tails in one structure. If it used the total number of tails across all structures (7), then the final value would be 30 + 28% of 30 = 38.4. Instead, it uses 5 (from the blue structure) and the value is 30 + 20% of 30 = 36.

## Conclusion

Finally, I'd run out of lingering issues, and was able to complete my calculator to my satisfaction. The fact that all of the major problems arose from just the MVS version was a little irksome, but the fact that the MVS version is the only available version on Fightcade (and thus particularly competitively relevant) made it all the more important that its ruleset be represented correctly in my calculator. It offers both the MVS and PS2 rulesets as an easily-fipped toggle, allowing the differences between them to be easily scrutinised.

That being said, there are still a number of auxiliary features that would be helpful to add:

- Some kind of overlay which shows, when hovering the mouse over an ignition coordinate, the exact paths traveled by the waves, and the values of each block and tail, so that new players can visually comprehend the algorithm each version uses.
- Some toggles that allow the "Hurry Up" bonus to be included in calculations. The "Hurry Up" bonus is a permanent 25% bonus applied to both players' ignitions after 45 seconds, and then again every 15 seconds afterward.

Anyway… I hope that any of you who are interested in this game (even if only by this blog post) consider using this calculator to help understand the game (again, available by clicking here) - and, once you've cleared the VS. CPU mode, feel no hesitation in playing with me on Fightcade. Just step in the lobby and see if I'm around, anytime. **I WILL ACCEPT CHALLENGES FROM ANYONE ! !** _{(Note: offer not necessarily valid for perpetuity)}

Oh, and any bugs can be reported here.