Abstract 1 Introduction 2 Preliminaries 3 Computational Complexity 4 Algorithmic Techniques 5 Applications 6 Conclusion References Appendix A Complexity Proofs

Finding Shortest Walks in Kuru Kuru Kururin

Mickaël Laurent ORCID Charles University, Prague, Czech Republic Maher Mallem ORCID Inria, CNRS, ENS de Lyon, Université Claude Bernard Lyon 1, LIP, UMR 5668, 69342, Lyon cedex 07, France
Abstract

This paper serves as a celebration of the twenty-fifth anniversary of Kuru Kuru Kururin. Although this video game is presented as a collection of two-dimensional puzzles based on rotation, it naturally invites players to complete its levels as quickly as possible. This has led to a surprisingly rich and challenging playing field to finding foremost temporal walks. In this work, we tackle this problem both in theory and in practice. First, we introduce a model for the game and provide an in-depth complexity analysis. Most notably, we show how each gameplay mechanic independently brings a layer of 𝖭𝖯-hardness and/or 𝖼𝗈-𝖭𝖯-hardness. We also provide a pseudo-polynomial time algorithm for the general problem and identify several cases which can be solved in polynomial time. Along the way, we discuss connections to the more established framework of temporal graphs, both in the point model and the interval model. Then, we propose simple and flexible algorithmic techniques to reduce state space and guide the search, offering trade-offs between precision and computation speed in practice. These techniques were implemented and tested using a full recreation of the game physics and the levels from the original game. We demonstrate the efficiency of our framework in several settings – with or without taking damage, with or without unintended game mechanics – and relate empirical struggles which we encountered in practice to our complexity analysis. Our implementation is open source and fully available online, offering a novel and amusing setting to benchmark shortest path algorithms.

Keywords and phrases:
Shortest path, Complexity
Funding:
Mickaël Laurent: This work was supported by the Czech Ministry of Education, Youth and Sports under program ERC-CZ, grant agreement LL2325.
Copyright and License:
[Uncaptioned image] © Mickaël Laurent and Maher Mallem; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Problems, reductions and completeness
; Theory of computation Shortest paths
Supplementary Material:

Software  (Source Code): https://github.com/E-Sh4rk/KururinTAS [13]
  archived at Software Heritage Logo swh:1:dir:38c9ece3ce3ee16ef48ecd29d110e056706aa8f2
Software  (Tool-Assisted Speedrun): https://tasvideos.org/3933M [14]
Software  (Tool-Assisted Speedrun): https://tasvideos.org/6116M [19]
Acknowledgements:
We would like to thank the organizers and reviewers of the FUN2026 conference.
Editor:
John Iacono

1 Introduction

Kuru Kuru Kururin is a video game published by Nintendo for the Game Boy Advance in 2001. This game is composed of a succession of levels, in which the player (the helirin) has to walk through a maze, from the start area to (one of the) ending area(s).

Refer to caption
Figure 1: The helirin never stops rotating (here, clockwise).
Refer to caption
Figure 2: When hitting a wall, it loses a heart…
Refer to caption
Figure 3: …and is repelled (both in position and angle).

While studying the computational complexity of video games is nothing new (e.g., see [3, 9, 10] for classic video game series and [8, 17, 23] for pathfinding in video games), this game is unique in that the helirin constantly spins around at a fixed angular speed. The player cannot control its rotation speed, but can move the helirin up, down, left, right, and diagonally at three possible speeds (slow, medium, or fast). The helirin initially has three hearts. When the helirin hits a wall, it loses one heart and gets repelled (both in position and angle) as shown in Figures 1, 2 and 3. When reaching zero hearts, the level must be restarted from the start area. The level may contain some healing areas, which restore all hearts and prevent the helirin from taking damage. The starting area also has this effect.

Some additional mechanics are introduced in later levels. For instance, springs that reverse the direction of rotation of the helirin (clockwise / counterclockwise) when hit, or moving objects (pistons and spiked balls) that follow a predefined path and must be avoided (cf. Figures 4, 5 and 6).

Refer to caption
Figure 4: Some moving pistons and springs.
Refer to caption
Figure 5: The helirin hits a spring…
Refer to caption
Figure 6: …which reverses its rotation direction.

This paper is organized as follows. In Section 2, we propose a simplified model of the base gameplay, and extend it with additional mechanics (springs and moving objects). Then, we study complexity of each variant in Section 3. Section 4 then studies the actual game implementation and shows how to design an approximate path finding algorithm despite the gigantic number of states. Finally, in Section 5 we introduce KuruBot, our path-finder implementation for Kuru Kuru Kururin, then we elaborate on how it can be configured to achieve different goals.

2 Preliminaries

Definition 1.

,, and are respectively defined as the set of positive integers, integers and rational numbers. + and + are respectively defined as the set of non-negative integers and non-negative rational numbers.

2.1 Base Gameplay

Following the inner workings of Kuru Kuru Kururin, time is discrete, position is a couple of integer coordinates, and rotation angle is a rational cut of the unit circle.

Definition 2.

A helirin is defined as a tuple (,νcard,νdiag,ω) which represents a half-length a cardinal speed νcard a diagonal pointwise speed νdiag and an angular speed ωπ, ω+.

Definition 3.

A base helirin state 𝒮 is defined as a tuple (x,y,α,b) representing a center position (x,y)2, an angle αππ, 0α<1 and a boolean b{0,1} indicating whether the helirin is turning counterclockwise.

We treat angles modulo π. Like in the unit circle, angles are measured from segment [(0,0),(1,0)] and increase as you turn counterclockwise. By default, we assume that a helirin is turning counterclockwise – i.e., b=1.

Definition 4.

The base moveset is {,N,NE,E,SE,S,SW,W,NW}, i.e., a standstill and the eight cardinal and diagonal directions “north”, “north-east”, etc.

A base move is a couple (μ,d)× where d is the duration of the move.

During a move, the helirin is constantly spinning around by an angle ωπ (resp. ωπ) per time unit if it is turning counterclockwise (resp. clockwise).

Definition 5.

A base helirin walk 𝒲=(𝒮0,t0,(μ1,d1),,(μk,dk)) is a sequence of base moves from an initial state 𝒮0 and time t0. The duration of walk 𝒲 is defined as d(𝒲)=d1++dk.

Definition 6.

Let s. A tile is a s×s square in the plane which can interact with the helirin. The base tileset Σ features a goal tile kind, which only interacts with the center of the helirin, and wall tile kinds, which forbid a polygonal zone within the tile to intersect with any part of the helirin. There are five of them here: the plain square, and the four triangles filling half of the square.

A base tile is a tuple (κ,s,x,y)Σ××× where κ is the tile kind, s is the side length and (x,y) are the coordinates of the bottom-left corner of the s×s square.

We allow tiles to overlap each other. Plus, like in Kuru Kuru Kururin, we consider that goal tiles have priority over wall tiles. In other words, collisions with wall tiles are ignored if the center of the helirin is in a goal tile.

Definition 7.

A base helirin state 𝒮 is said to be valid if and only if the helirin does not intersect with a forbidden square of a wall tile. A base helirin walk 𝒲 is said to be valid if and only if all intermediate states during the walk are valid.

Definition 8 (Problem BaseKururin).
Input:

A helirin , a set of base tiles 𝒯={(κ1,s1,x1,y1),,(κN,sN,xN,yN)}, a base helirin state 𝒮0, times t0,D+.

Question:

Starting from state 𝒮0 at time t0, is there a valid base helirin walk to a goal tile of duration at most D?

Let N be the number of tiles. For the sake of simplicity, in the rest of the paper, we assume that we have pre-implemented routines to check whether a given base helirin state is valid in 𝒪(N) time, and whether a given base helirin walk is valid in polynomial time.

2.2 Additional Gameplay Mechanics

Definition 9.

A segment in the plane has the mirroring property if the following behavior occurs. Let q be the denominator of angular speed factor ω. If any part of the helirin would intersect the helirin after a unit-time move, the helirin rotation is reverted back by steps of 1/q until it no longer intersects with the spring tile edge – say, after an angle p/q. Then the rotation is reverted back by an additional angle p/q, and the helirin now turns the other way around.

A spring tile is a tile where exactly one edge of the square has the mirroring property.

When BaseKururin is augmented with spring tiles, four tile kinds are added to base tileset Σ: one for each choice of edge which has the mirroring property.

Definition 10.

A piston is defined as a tuple (s,x,y,τ,ton,toff,(μ,d),ν) which represents a square of side length s, the starting coordinates (x,y)2 of the bottom-left corner, a time period τ, a periodic activating time ta{0,,τ1}, a periodic deactivating time td{0,,τ1}, a base move (μ,d)× and a (pointwise) speed ν.

Definition 11.

A spiked ball is defined as a tuple (r,x,y,τ,t0,(μ,d),ν) which represents a disk of radius r, the starting coordinates (x,y)2 of the bottom-left corner of the square which inscribes the disk outer circle, a time period τ, a periodic starting time t0{0,,τ1}, a base move (μ,d)× and a (pointwise) speed ν.

In the presence of pistons and/or spiked balls, a base helirin walk is valid if and only if, on top of wall tiles, the helirin never intersects with them during the walk.

2.3 Other Problems

Definition 12 (Problem SubsetSum).
Input:

Elements a1,,an, target B.

Question:

Is there a set S{1,,n} such that iSai=B?

Definition 13.

Let V be a set of vertices. A timed arc is a tuple (u,v,t,δ) representing a directed arc (u,v)V2, a departure time t+ and a travel time δ. A point temporal graph 𝒢 is of the form (V,𝒜) where 𝒜 is a set of timed arcs.

An interval timed arc is a tuple (u,v,t,t,δ) representing a directed arc (u,v)V2, an earliest and a latest departure time t,t+ and a travel time δ. An interval temporal graph 𝒢 is of the form (V,𝒜) where 𝒜 is a set of interval timed arcs.

Definition 14.

A temporal walk W in a (point or interval) temporal graph 𝒢=(V,𝒜) is a sequence of timed arcs ((u1,v1,t1,δ1),,(uk,vk,tk,δk)) such that, for all i{1,,k1}, vi=ui+1 and ti+δiti+1. In the point model, arcs must belong to 𝒜. In the interval model, for every timed arc (ui,vi,ti,δi) in the walk, there must be an interval timed arc (u,v,t,t,δ) in 𝒜 such that ttit. The walk is called restless if t1=0 and ti+δi=ti+1 for all i. The arrival time of W is (tk+δk).

Definition 15 (Problem (Restless)ForemostTemporalWalk).
Input:

A (point or interval) temporal graph 𝒢=(V,𝒜), two vertices u,vV, a time D+.

Question:

Is there a (restless) temporal walk from u to v with arrival time at most D?

RestlessForemostTemporalWalk is in 𝖯 on point temporal graphs [2], whereas it is weakly 𝖭𝖯-hard on interval temporal graphs [22, 29], even with constant vertex-interval-membership-width [6]. ForemostTemporalWalk is in 𝖯 with both models [5].

3 Computational Complexity

In this section, we establish the computational complexity of problem BaseKururin. We start from the original problem, then consider several gameplay mechanics one by one and study their respective impact on the problem complexity. Omitted proofs are available in Appendix A.

3.1 Base Gameplay

First, we show that the base problem is in 𝖯𝖲𝖯𝖠𝖢𝖤.

Theorem 16.

BaseKururin is in 𝖯𝖲𝖯𝖠𝖢𝖤.

Proof (Sketch).

Recall that 𝖯𝖲𝖯𝖠𝖢𝖤=𝖭𝖯𝖲𝖯𝖠𝖢𝖤 from Savitch’s theorem [25]. So, if there exists a valid base helirin walk 𝒲=(𝒮0,t0,(μ1,d1),,(μk,dk)), we can find it by guessing moves (μi,di) in order, performing them on-the-fly while checking the validity of the corresponding walk prefixes. We do so while keeping track of the current base helirin state, and of time with a non-negative integer variable, checking that it never goes above D.

Next, we show that the base problem is 𝖭𝖯-hard, regardless of the value of the angular speed.

Theorem 17.

BaseKururin is weakly 𝖭𝖯-hard even when ω=0.

Proof.

We reduce from weakly 𝖭𝖯-hard problem SubsetSum [12]. We take inspiration from the 𝖭𝖯-hardness proof of problem RestlessForemostTemporalWalk on interval temporal graphs by Zeitz [29]. Let a1,,an be the elements and let B be the target. Let A=1inai and L=2A+1.

We propose the following instance of BaseKururin. We set the helirin properties to (,νcard,νdiag,ω)=(L,2L,2L1,0). We set D=2A+n1 and 𝒮0=(L,L,1/2,1). We set wall tiles to form the instance illustrated in Figure 7. For each choice of element ai in SubsetSum, we have two branching paths: one, which we call Pi,0, where you go east for 2ai time units, and another, which we call Pi,1, where you go north-east for ai time units, then south-east for ai time units. Both paths are then merged. Finally, there is a single 1×1 goal tile at position ((2D+1)L2B,L).

Figure 7: Layout of the 𝖭𝖯-hardness reduction of BaseKururin. The isolated square at the right represents the single 1×1 goal tile.

Recall that 2B<L. As such, by only taking paths of the form Pi,0, we only have access to x-coordinates which are multiples of L. So, the goal tile can only be reached by some taking paths of the form Pi,1, each of which induces an x-coordinate offset of (2ai) modulo L.

If our instance of SubsetSum has a solution S{1,,n}, we propose base helirin walk 𝒲 where, for all i{1,,n}, we take path Pi,1 if iS and path Pi,0 otherwise. This walk is valid and ends at position ((2D+1)L2(iSai),L)=((2D+1)L2B,L). Conversely, if we have a valid base helirin walk 𝒲, by our choice for speed values νcard,νdiag and time D, only the east, north-east and south-east directions can be used. Therefore, according to the position of wall tiles, the underlying path from base helirin walk 𝒲 is necessarily of the form Pi,j1Pn,jn with ji{0,1} for all i. We propose S={i{1,,n}|ji=1}. Then, because 𝒲 is valid and ends at position ((2D+1)L2B,L), we have: 2B=2(iSai).

 Remark 18.

A variant of this reduction, which does not require a goal tile of unit size, is available in Appendix A.1.

Note that the idea behind this reduction would work with any angular speed ω: it purely relies on the offset between cardinal and diagonal speed values, which gets magnified over time. As such, time D needs to be encoded in binary for our reduction to work. In fact, if time D is given in unary in the input, then BaseKururin can be solved in polynomial time.

Theorem 19.

BaseKururin is pseudo-polynomial-time solvable.

Proof.

We show this by encoding our instance as a point temporal graph with 𝒪(D4) vertices and 𝒪(D5) timed arcs. Each accessible center position can be encoded as a tuple (nN,nNE,nE,nSE) of values in {D,,D} giving a signed number of unit-time base moves in each direction in order to reach it. And timed arcs are of the form (u,v,t,1), where u represents a center position accessible at time t and v represents a center position accessible from u with one of the nine unit-time base moves. If N is the number of tiles in our instance I of BaseKururin then, in 𝒪(D5N) time, we can compute all accessible center positions, including whether they are in a goal tile, and compute an equivalent point temporal graph 𝒢I. Then problem ForemostTemporalWalk can be solved in linear time on 𝒢I to look for a walk from the starting center position to all accessible center positions in goal zones simultaneously [4].

 Remark 20.

Conversely, ForemostTemporalWalk on point temporal graphs can be reduced to BaseKururin. More on this in Appendix A.2.

Additionally, in the proof of Theorem 17, note that wall tiles were crucial to enforce specific durations for the diagonal base moves which corresponded to the elements in the instance of SubsetSum. If there are no such walls then, for each goal tile, one can compute a base helirin walk reaching it in minimum duration via an integer linear program with a constant number of variables and constraints. We have eight non-negative integer variables indicating the number of unit-time base moves in each of the eight directions. We aim to minimize their sum while ending the walk in the square goal tile (i.e., with four constraints). Each system can be solved in 𝒪(1) time (e.g., see [1]), so we can solve our problem in 𝒪(N) time. Details are available in Appendix A.3.

Theorem 21.

BaseKururin with no wall tiles is polynomial-time solvable.

3.2 Base Gameplay with Diagonal Speed Restrictions

In this subsection, we restrict the value of diagonal pointwise speed νdiag such that we cannot reuse the trick used to prove the 𝖭𝖯-hardness of BaseKururin in Theorem 17. In particular, if νdiag{0,νcard}, then one can no longer create a position offset other than a multiple of νcard. In fact, the graph of accessible center positions with unit-time move neighborhood is a grid graph, with a four-neighborhood if νdiag=0 and an eight-neighborhood if νdiag=νcard. With such neighborhoods, it is not hard to see that the triangle inequality is satisfied. As such, if additionally the helirin does not spin around, then the instance of BaseKururin can be easily turned into such grid graphs and solved efficiently. E.g., by using the visibility graph induced by the corners of the wall tiles [18, 21, 28], we can solve this particular case in 𝒪(N2) time.

Theorem 22.

BaseKururin with νdiag{0,νcard} and ω=0 is polynomial-time solvable.

However, if the helirin is allowed to spin around, then we believe that our problem is again unlikely to be polynomial-time solvable.

Conjecture 23.

BaseKururin is weakly 𝖼𝗈-𝖭𝖯-hard even when νdiag{0,νcard}.

Our leading proof idea is described in Appendix A.4. If true, this would show that both speed offset and rotation independently make our problem difficult.

 Remark 24.

Conejcture 23 would show that BaseKururin is both 𝖭𝖯-hard and 𝖼𝗈-𝖭𝖯-hard. As such, it would be unlikely that it belongs to either class. Indeed if, e.g., it belonged to 𝖭𝖯, then 𝖼𝗈-𝖭𝖯-complete problem DNF-Tautology would also belong to 𝖭𝖯. This would mean that 𝖭𝖯=𝖼𝗈-𝖭𝖯, which would imply a collapse of the Polynomial Hierarchy to the second level [27].

3.3 Base Gameplay with Spring Tiles

If spring tiles are available, then the reduction of Theorem 17 can be adapted by using the mirroring property to create an angle offset in the rotation of the helirin between branching paths. Arbitrary angle offsets can be obtained within constant duration, so this reduction does not require time D to be given in binary in the input.

Theorem 25.

BaseKururin augmented with spring tiles is weakly 𝖭𝖯-hard even when νdiag{0,νcard} and time D is given in unary.

Proof (Sketch).

We reduce from weakly 𝖭𝖯-hard problem SubsetSum [12]. Let a1,,an be the elements and let B be the target. Let A=1inai and L=16(A+2n+1).

We propose a similar reduction to the proof of Theorem 17, except we rely on rotation angle offsets instead of position offsets. We set D=6n+1, qω=L/2 and pω=1+qω/8. We set the helirin properties to (,νcard,νdiag,ω)=(L,2L,0,pω/qω) and we set 𝒮0=(L,L,0,1). We set wall tiles to form the instance illustrated in Figure 8. For each choice of element ai in SubsetSum, we have two branching paths: one, which we call Pi,0, where you go south, then east for 2 time units, then north, and another, which we call Pi,1, where you go north, then east for 2 time units, then south. Both paths are then merged. Plus, there is a single 2L×2L goal tile at position ((4n+1)2L,0).

Figure 8: Layout of the 𝖭𝖯-hardness reduction with spring tiles. The isolated square at the left of the goal tile is a wall tile which is part of the angle check gadget, which only allows for angle (B+2n)π/qω.

Now, let 𝒫={0,,qω/2}. Given p𝒫, let (xp,yp) be the coordinates of the right extremity of the helirin at angle pπ/qω. Since L>2qω/2, function (p(xp,yp)) is injective over 𝒫, and sequences (xp)p𝒫 and (yp)p𝒫 are respectively non-increasing and non-decreasing. Plus, for each p𝒫, couple (xp,yp) is merely a rational approximation of the cosine and sine of angle pπ/qω, and thus can be computed in polynomial time.

Knowing this, we can use these values to position our spring tiles accordingly. In bottom paths Pi,0, we rely on numerator (p=qω/4+1) to align the edges with the mirroring property. In bottom paths Pi,1, we rely on numerator (p=qω/4+1ai) instead. And, once both paths are merged, we rely on numerator (p=qω/8). Finally, right before the goal tile, we set two wall tiles in order to block positions (xp,yp) for every p𝒫\{B+2n}. Then the correspondence between valid base helirin walks and solutions of the SubsetSum instance unfolds similarly to the proof of Theorem 17. Finally, one can easily adapt the reduction to case νdiag=νcard.

Still, the algorithm from Theorem 19 can be adapted if, on top of time D, the denominator qω of angular speed factor ω is given in unary in the input. Then the number of vertices in the equivalent point temporal graph is in 𝒪(D4qω).

Theorem 26.

BaseKururin augmented with spring tiles is pseudo-polynomial-time solvable.

3.4 Base Gameplay With Pistons and Spiked Balls

If pistons or spiked balls are available, then the algorithm from Theorem 19 can be easily adapted with minor time overhead. Indeed, these elements are time-indexed so, at each time, their location can easily be determined and taken into account when computing the set of accessible center positions.

Theorem 27.

BaseKururin augmented with pistons and spiked balls is pseudo-polynomial-time solvable.

However, having these moving elements makes our problem difficult independently from all previous gameplay mechanics – namely speed offset, rotation and spring tiles. Indeed, note that spiked balls with standstill base moves and pistons with unit-time base moves essentially act as periodic on/off switches, with periods written in binary. So, these periods can be given exponential values within logarithmic working space [7, 24], which is the key ingredient in our reductions. For instance, this allows us to test all valuations of a boolean formula – and thus encode both Sat and DNF-Tautology.

Theorem 28.

BaseKururin augmented with pistons or spiked balls is weakly 𝖭𝖯-hard and weakly 𝖼𝗈-𝖭𝖯-hard even when νdiag{0,νcard}, ω=0 and half-length , cardinal speed νcard and tile sizes si are given in unary.

Proof.

We focus on the 𝖭𝖯-hardness proof with spiked balls and νdiag=0. All other proofs are discussed in Appendix A.5.

We reduce from 3-Sat. Let φ=1im(li,1li,2li,3) be a 3-CNF formula with m clauses and n variables, w.l.o.g. with exactly three literals per clause. We set the helirin properties to (,νcard,νdiag,ω)=(1,2,0,0) and base helirin state 𝒮0 to (x,y,α,b)=(1,1,0,0). Plus, all spiked balls will have radius 1, μ= in their base move, and ν=1. So, all relevant elements will be set along a grid of 2×2 squares.

We encode the formula as an obstacle course going from left to right. Figure 9 represents the base layout, which can be easily obtained with square wall tiles. Each vertical layer represents a clause and has three available ways, each associated to a literal in this clause. And we set a single goal tile of side length 2 at (x,y)=(4m+4,0). Then, going from the start area (in red) to the goal tile (in yellow) with no wait takes time at most T=6m+6.

Figure 9: Layout of the 𝖭𝖯-hardness reduction with spiked balls, illustrated with input formula φ=(x1x2x4)(x2x3¬x4). We are at time Δ+1, i.e., about to check valuation (x4,x3,x2,x1)=(0,0,0,1), which makes φ true by choosing literals x1 then ¬x4.

The plan is to dedicate time T for each of the 2n valuations of the variables to give them a chance to reach the goal tile from the start, which will correspond to making φ true. First, we only allow the helirin to leave the start area at periodic times (1modT). We do so with a spiked ball at (x,y)=(2,0) with τ=T,t0=2 and d=T1. Plus, once the helirin leaves the start area, we force it to reach the goal tile by the end of the time period. We do so by setting spiked balls for every 2i2m+2 and 0j4 at (x,y)=(2i,2j) with τ=T,t0=0 and d=1.

Now, for 1kn we tie variable xk to spiked balls of time period τ=T2k. More precisely, given 1im and 1j3, we set a spiked ball Si,j at x=4i+2 and y=4j4, with move duration d=T2k1 and:

  • if li,j=xk is a positive literal: τ=T2k,t0=0,d=T2k1,

  • if li,j=¬xk is a negative literal: τ=T2k,t0=d=T2k1.

In other words, spiked balls tied to literal xk (resp. ¬xk) block their respective path during periodic times (0,,T2k11modT2k) (resp. (T2k1,,T2k1modT2k)).

We now piece everything together. Let us consider valuations (xn,,x1) by lexicographic order. Given 0h2n1, let vh be the hth valuation by lexicographic order. Then, vh matches with the binary representation of h from the right (e.g., the value of x1 in vh is the last digit). Knowing this, consider time units Th,,T(h+1)1. During them, by the definition of spiked balls Si,j, the latter block their respective path if and only if:

  • li,j=xk and the (k1)th digit of h from the right is 0, or

  • li,j=¬xk and the (k1)th digit of h from the right is 1.

Thus the missing spiked balls Si,j exactly correspond to the literals which are made true by valuation vh. As a result, starting from time Th, we can reach the goal tile by time T(h+1) if and only if vh makes φ true. Finally, we have that φ is satisfiable if and only if, starting from base helirin state 𝒮0, there is a base helirin walk reaching the goal tile by time D=T2n.

 Remark 29.

It is worth noting that the proposed pseudo-polynomial time algorithms heavily rely on the inclusion of time threshold D in the input. In fact, if we ask for a valid base helirin walk to a goal tile without specifying a time threshold, then the proofs of Theorem 28 can be adapted to show strong 𝖭𝖯-hardness and strong 𝖼𝗈-𝖭𝖯-hardness. This involves using prime numbers instead of powers of two as our time periods. More on this in Appendix A.6.

 Remark 30.

(Restless)ForemostTemporalWalk on interval temporal graphs can be reduced to BaseKururin augmented with spiked balls. More on this in Appendix A.7.

 Remark 31.

Similarly to Remark 24, since the problem is both 𝖭𝖯-hard and 𝖼𝗈-𝖭𝖯-hard, it is unlikely that it belongs to either class.

4 Algorithmic Techniques

In this section, we provide algorithmic techniques aimed at tackling real instances of Kuru Kuru Kururin.

4.1 State Space

Recall that a base helirin state features a center position (x,y), an angle α, and a boolean b indicating whether the helirin is turning counterclockwise. In the actual implementation of Kuru Kuru Kururin, these are stored as follows:

56 bits

position: 32 bits for x, 32 bits for y, with the 4 most-significant bits unused in practice. The 16 less-significant bits are sub-pixel precision – the position in pixels can be retrieved by only reading the 16 most-significant bits,

16 bits

angle (evenly captures the [0,2π[ interval),

1 bit

rotation direction (clockwise / counterclockwise).

In addition, when colliding with walls, the helirin gets repelled111For the sake of simplicity, in Section 2 we did not model this knock-back mechanism, and instead focused on a variant where collisions with walls are not allowed. Though it is clear that it would make the base problem more difficult, at least by considering angle offsets in the helirin rotation similarly to springs.. This mechanism is modeled by adding the following components to the state:

40 bits

bump speed: 32 bits for x, 32 bits for y, with the 12 most-significant bits unused in practice. Bump speed is added to the helirin when hitting a wall and decreases with time,

12 bits

rotation speed: 16 bits, with the 4 most-significant bits unused in practice. Rotation speed is added to the helirin when hitting a wall, and stabilizes towards the base rotation speed with time.

This amounts to a total of 125 bits, i.e., roughly 61037 states, which would be too massive to explore exhaustively. Encoding base helirin states with a temporal graph as in Theorem 19 would help in shorter levels, though not nearly enough. Indeed, Kuru Kuru Kururin level durations typically range from a couple seconds to a minute, so consider a level which can be finished in ten seconds. Since the game runs at roughly sixty frames per second, this would still amount to 600425261026 states. Consequently, looking for optimal resolution by exhaustive search seems impractical. In response, we propose a custom implementation of the A* algorithm, which we detail in the next section.

Note that, for some levels and applications, even more components must be added to the state (e.g., hearts and invulnerability frames for non-damageless gameplay as in Section 5.2, or the position of the moving objects for maps that contain some). More information about the state and how it evolves can be found in the notes of our first tool-assisted speedrun [16].

4.2 Custom 𝗔 Algorithm

In order to find short walks in spite of the very large state graph, we propose a custom implementation of the A* search algorithm. First, a heuristic function is computed by computing distance of every point to the target in an approximated variant of the problem (we call this heuristic function the “cost map”, Section 4.2.1). Then, this heuristic function is used to guide a custom A* search algorithm (Section 4.2.2).

4.2.1 Cost map

The heuristic function used to guide the A* search is computed using a Dijkstra algorithm that starts at the end of the level and computes, for each state, its distance to the end. However, the state space used for this heuristic function is harshly approximated: it assimilates the helirin with a point (thus making all angle-related state irrelevant), and ignores movements due to the collision with walls (thus eliminating the state related to bump speed). Depending on the application, walls can either be considered impassable, or passable under certain conditions and at a certain cost (cf. Section 5). In this context, as walls are aligned on pixels, the precision of the position can be reduced to the pixel unit, thus saving 32 bits of state. The state is thus only composed of the x and y position of 12 bits each, yielding 224 states (which is perfectly fine to explore exhaustively).

This yields a cost map that associates to each pixel of the map a distance to the end of the level (or to a custom target). It is then used to guide the A* algorithm for the resolution with the full state. This cost map is not necessarily an under-approximation of the real cost, as considering the helirin as being punctual allows turning closer to the walls. Consequently, we cannot guarantee that the A* search that find an optimal path. Also note that the cost map can be multiplied by a constant factor to parametrize the influence it has on the search: a factor higher than 1 will often explore fewer states, resulting in a faster resolution but a solution that is less optimal.

Refer to caption
Figure 10: Map of the first level: Grasslands 1 (start area, ending area).
Refer to caption
Figure 11: Associated cost map (unpassable walls).

4.2.2 Reducing the search space

The algorithm we use to find a minimal path is based on the A* search algorithm [11] with the heuristic function h induced by our cost map:

  1. 1.

    Let Q be a priority queue. For each starting state s, the pair (s,0) is added to Q with priority h(s).

  2. 2.

    The pair (s,l) of minimum priority is extracted from Q.

    • If this is a final state, then the algorithm terminates: a path of length l has been found.

    • Otherwise, the successors of s are computed, and for each such successor s, the pair (s,l+1) is added to Q with priority l+1+h(s). This step is then repeated.

In practice, this algorithm does not terminate even for simple levels. Thus, we implemented two main strategies for reducing the search space.

Equivalence classes

A first way to reduce the search space is to define equivalence classes regrouping states that are sufficiently similar. This is done by defining a state normalization function n(s) that truncates some of the state components to the desired precision (that can be configured depending on the application, cf. Section 5). Two states s1 and s2 are in the same equivalence class if and only if n(s1)=n(s2).

Refer to caption
Figure 12: Equivalence classes for position (smaller near the wall on the right).
Figure 13: Path finding: node S2 is disabled because S1 has been reached first.

The searching algorithm is then amended to never explore two states of the same equivalence class. For that, it maintains a set of normalized states S: when a state s is extracted from the priority queue Q, n(s) is added to S – if it was already present, then s is removed from Q without exploring it. This is illustrated by Figure 13.

Also note that we may want a dynamic resolution for the search: states that are close to a wall may benefit from a higher resolution because of the complex dynamic of collisions (in particular when solving for unrestricted gameplay, cf. Section 5.2). Thus, our normalization function n implements adaptive precision: the closer to a wall a state is, the fewer digits are truncated. This is illustrated in Figure 12.

Piecewise solving

Another way to reduce the search space is to perform a piecewise solving: checkpoints are inserted in the level, fragmenting the map into segments that are solved successively. Once a checkpoint has been reached, no other path to this checkpoint will be explored, and the search for a path to the next checkpoint starts.

This strategy can be achieved in two ways. First, it can be achieved by manually performing multiple searches: a first one from the starting state to an arbitrary area (checkpoint 1), then another search from the resulting state to another area (checkpoint 2), and so on. Second, it can be achieved in an automated way by modifying the cost map so that reaching a checkpoint area induces a huge decrease of the estimated cost. This is illustrated in Figures 14, 15 and 16 where checkpoints have been added on healing areas (these are good spots to insert checkpoints as they offer a great mobility: when the helirin is in a healing area, it can easily change its angle by hitting a wall without taking damage).

Refer to caption
Figure 14: Map (start area, healing area, ending area).
Refer to caption
Figure 15: Cost map
(no checkpoint).
Refer to caption
Figure 16: Cost map
(with checkpoint).

5 Applications

5.1 Implementation: KuruBot

The exact physics of the game Kuru Kuru Kururin as well as the path finding algorithm described in Section 4 have been implemented in KuruBot [13], a C# application of about 4000 lines of code. It can also communicate with the emulator BizHawk in order to retrieve the current map and state from a live session, find a path, and play it on the emulator. Several configurations can be loaded to achieve different goals that we present in this section.

Refer to caption
Figure 17: Interface of KuruBot.
Refer to caption
Figure 18: KuruBot while searching for a path.

5.2 Categories

Levels can be solved with different constraints (“categories”). The main categories are presented below. Solving each category requires using an adapted configuration for KuruBot, which are summarized in Figure 19.

Category Cost map Resolution (base, near walls) Checkpoints
Damageless No wall crossing 2 px, 2 px Automated, at healing areas
Regular intended No wall crossing 2 px, 1 px Automated, at healing areas
Regular unrestricted Wall crossing if hearts > 1 1 px, 1/8 px Manual, short segments
Figure 19: Configuration adapted for each category.
Damageless completion

The damageless completion category consists in finishing every level without taking any damage. Note that hitting a wall may still be permitted if the helirin is in a healing zone (thus, the bump speed and rotation speed components of the state cannot be neglected). A tool-assisted speedrun of this category made using KuruBot is available on TASVideos.org [14].

Regular completion, intended gameplay

For regular completion, the helirin is allowed to hit walls, which can be used to walk through narrow spaces, to have a boost due to the speed bump, and to change the angle of the helirin. When hitting a wall outside a healing area, the helirin looses a heart and becomes invulnerable for 20 frames. Thus, the following bits must be added to our state:

2 bits

remaining hearts (max: 3),

5 bits

invulnerability frames (max: 20).

Regular completion, unrestricted gameplay

The unrestricted category allows exploiting the physics of the game, in particular the way collisions are handled, to break through walls. However, such manipulations are only possible for some wall placements, and require a very precise combination of position, angle, and bump speed to be performed. Consequently, for this category, the resolution of the solver (cf. Section 4.2.2) must be increased (in particular the resolution near walls).

The cost map computation is also modified: crossing walls is allowed, but at a constant cost to account for the number of frames it takes to cross a wall in average (e.g. 10 frames), and only if the helirin has at least 2 hearts (otherwise, hitting a wall will lose the level). Consequently, two cost maps must be computed: one that will be used when the helirin has at least 2 hearts left, and one when it has only one heart (cf. Figures 20 and 21). Positions that are inside walls also get a constant cost reduction to account for the fact that these are advantageous areas inside which the helirin should stay as long as possible (in particular, the helirin can move faster when it is inside a wall). A tool-assisted speedrun of this category made using KuruBot is available on TASVideos.org [19].

Refer to caption
Figure 20: Unrestricted gameplay cost map (with extra hearts).
Refer to caption
Figure 21: Unrestricted gameplay cost map (no extra heart).
Other incentives

We may want to search for solutions that minimize measures other than the total number of frames. For instance, minimizing the number of input changes (i.e. the number of times a button must be pressed or released) can also be of interest in order to find humanly-viable ways to cross a wall for speedrunners. Such paths have already been found by using KuruBot with an adapted configuration [20].

6 Conclusion

In this work, we presented an algorithmic and complexity study of Kuru Kuru Kururin, a puzzle-action game whose distinctive mechanics naturally give rise to rich shortest-walk problems. By formalizing the game’s behavior and progressively extending the model with additional mechanics, we revealed how each gameplay element (rotation, speed asymmetries, spring tiles, moving objects, etc.) introduces its own source of computational hardness. Our results show that even the base problem is weakly 𝖭𝖯-hard, and that various mechanics independently raise the difficulty to 𝖭𝖯-hard or even 𝖼𝗈-𝖭𝖯-hard levels. Despite these hardness results, when time or mechanical constraints are restricted, several variants admit pseudo-polynomial-time or even polynomial-time algorithms.

In the second part of this article, focusing this time on approximate resolution, we introduced practical algorithmic techniques, including a state-space reduction strategy and a custom A* search guided by approximate cost maps, that enable efficient solving of real game levels despite an astronomically large underlying state space. Finally, we implemented these ideas in KuruBot, a full physics-accurate path-finding framework capable of exploring a wide variety of gameplay settings. Overall, this work bridges complexity theory, temporal graph reasoning, and game physics modeling, showing how a charming 2001 Game Boy Advance title can serve as a surprisingly deep computational playground.

Going forward, in the short term we plan to benchmark the performance of our path finding algorithm in the presence of the different elements introduced in the complexity analysis. Using a level editor that we created [15], we plan to generate multiple levels, each focusing on a specific mechanic: base gameplay without diagonal moves, base gameplay with diagonal moves, springs, moving objects, etc. The performance on these benchmark levels will then be evaluated using a specific configuration of KuruBot, and compared to the conclusions of our complexity analysis. Moreover, such levels could also serve as an amusing playing field to compare state-of-the-art pathfinding algorithms.

Finally, in the future, our complexity analysis could be extended to model the whole game, including knock-back, the life system and healing areas, as well as the sequels Kururin Paradise and Kururin Squash!, hidden gems which were only released in Japan and feature even more unique game mechanics to explore.

References

  • [1] Nina Amenta, Jesús A De Loera, and Pablo Soberón. Helly’s theorem: new variations and applications. Algebraic and geometric methods in discrete mathematics, 685:55–95, 2017.
  • [2] Matthias Bentert, Anne-Sophie Himmel, André Nichterlein, and Rolf Niedermeier. Efficient computation of optimal temporal walks under waiting-time constraints. Applied Network Science, 5(1):73, 2020. doi:10.1007/S41109-020-00311-0.
  • [3] Jeffrey Bosboom, Josh Brunner, Michael J. Coulombe, Erik D. Demaine, Dylan H. Hendrickson, Jayson Lynch, and Elle Najt. The Legend of Zelda: The complexity of mechanics. CoRR, abs/2203.17167, 2022. doi:10.48550/arXiv.2203.17167.
  • [4] Filippo Brunelli and Laurent Viennot. Computing temporal reachability under waiting-time constraints in linear time. In David Doty and Paul Spirakis, editors, 2nd Symposium on Algorithmic Foundations of Dynamic Networks (SAND 2023), volume 257 of Leibniz International Proceedings in Informatics (LIPIcs), pages 4:1–4:11, Dagstuhl, Germany, 2023. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SAND.2023.4.
  • [5] Binh-Minh Bui-Xuan, Afonso Ferreira, and Aubin Jarry. Computing shortest, fastest, and foremost journeys in dynamic networks. International Journal of Foundations of Computer Science, 14(02):267–285, 2003. doi:10.1142/S0129054103001728.
  • [6] Justine Cauvi and Laurent Viennot. Parameterized restless temporal path. In Artur Jeż and Jan Otop, editors, Fundamentals of Computation Theory, pages 82–93, Cham, 2026. Springer Nature Switzerland. doi:10.1007/978-3-032-04700-7_7.
  • [7] Yiping Cheng. Space-efficient Karatsuba multiplication for multi-precision integers. arXiv preprint arXiv:1605.06760, 2016. URL: https://arxiv.org/abs/1605.06760.
  • [8] Xiao Cui and Hao Shi. Direction oriented pathfinding in video games. International Journal of Artificial Intelligence & Applications, 2(4):1, 2011.
  • [9] Erik D. Demaine, Holden Hall, Hayashi Layers, Ricardo Ruiz, and Naveen Venkat. You can’t solve these Super Mario Bros. levels: Undecidable Mario games. Theoretical Computer Science, 1060:115549, 2026. doi:10.1016/j.tcs.2025.115549.
  • [10] MIT Hardness Group, Erik D. Demaine, Holden Hall, and Jeffery Li. Tetris with few piece types. Theoretical Computer Science, 1059:115581, 2026. doi:10.1016/j.tcs.2025.115581.
  • [11] Peter E. Hart, Nils J. Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE Transactions on Systems Science and Cybernetics, 4(2):100–107, 1968. doi:10.1109/TSSC.1968.300136.
  • [12] Richard M. Karp. Reducibility among Combinatorial Problems, pages 85–103. Springer US, Boston, MA, 1972. doi:10.1007/978-1-4684-2001-2_9.
  • [13] Mickaël Laurent and Maher Mallem. KururinTAS. Software, swhId: swh:1:dir:38c9ece3ce3ee16ef48ecd29d110e056706aa8f2 (visited on 2026-04-24). URL: https://github.com/E-Sh4rk/KururinTAS, doi:10.4230/artifacts.25783.
  • [14] Mickaël Laurent and Maher Mallem. Tool Assisted Speedrun - GBA Kuru Kuru Kururin by mohoc & E-Sh4rk in 06:11.59. Software (visited on 2026-04-24). URL: https://tasvideos.org/3933M, doi:10.4230/artifacts.25784.
  • [15] Mickaël “E-Sh4rk” Laurent and contributors. Repository of ROM-hacking tools for the GBA Kururin games, 2021. URL: https://github.com/E-Sh4rk/KuruTools.
  • [16] Mickaël “E-Sh4rk” Laurent and Maher “mohoc” Mallem. Author notes of the tool-assisted speedrun of Kuru Kuru Kururin on TASVideos.org, 2019. URL: https://tasvideos.org/6314S.
  • [17] Sharmad Rajnish Lawande, Graceline Jasmine, Jani Anbarasi, and Lila Iznita Izhar. A systematic review and analysis of intelligence-based pathfinding algorithms in the field of video games. Applied Sciences, 12(11), 2022. doi:10.3390/app12115499.
  • [18] Tomás Lozano-Pérez and Michael A Wesley. An algorithm for planning collision-free paths among polyhedral obstacles. Communications of the ACM, 22(10):560–570, 1979. doi:10.1145/359156.359164.
  • [19] Maher Mallem. Tool Assisted Speedrun - GBA Kuru Kuru Kururin “100%” by mohoc in 23:51.95. Software (visited on 2026-04-24). URL: https://tasvideos.org/6116M, doi:10.4230/artifacts.25785.
  • [20] Maher “mohoc” Mallem. Kuru Kuru Kururin speedrunning guide - pause frame document, 2024. URL: https://www.speedrun.com/kuru_kuru_kururin/resources/ecdzb.
  • [21] Marcell Missura, Daniel D. Lee, and Maren Bennewitz. Minimal construct: Efficient shortest path finding for mobile robots in polygonal maps. In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 7918–7923, 2018. doi:10.1109/IROS.2018.8594124.
  • [22] Ariel Orda and Raphael Rom. Traveling without waiting in time-dependent networks is NP-hard. Technical report, Dept. Electrical Engineering, Technion - Israel Institute of Technology, Haifa, Israel 32000, 1989.
  • [23] Sara Lutami Pardede, Fadel Ramli Athallah, Yahya Nur Huda, and Fikri Dzulfiqar Zain. A review of pathfinding in game development. CEPAT] Journal of Computer Engineering: Progress, Application and Technology, 1(01):47, 2022.
  • [24] Daniel S. Roche. Space- and time-efficient polynomial multiplication. In Proceedings of the 2009 International Symposium on Symbolic and Algebraic Computation, ISSAC ’09, pages 295–302, New York, NY, USA, 2009. Association for Computing Machinery. doi:10.1145/1576702.1576743.
  • [25] Walter J. Savitch. Relationships between nondeterministic and deterministic tape complexities. Journal of Computer and System Sciences, 4(2):177–192, 1970. doi:10.1016/S0022-0000(70)80006-X.
  • [26] Atle Selberg. An elementary proof of the prime-number theorem. Annals of Mathematics, 50(2):305–313, 1949. doi:10.2307/1969455.
  • [27] Larry J. Stockmeyer. The polynomial-time hierarchy. Theoretical Computer Science, 3(1):1–22, 1976. doi:10.1016/0304-3975(76)90061-X.
  • [28] Tansel Uras, Sven Koenig, and Carlos Hernandez. Subgoal graphs for optimal pathfinding in eight-neighbor grids. Proceedings of the International Conference on Automated Planning and Scheduling, 23(1):224–232, June 2013. doi:10.1609/icaps.v23i1.13568.
  • [29] Tim Zeitz. NP-hardness of shortest path problems in networks with non-FIFO time-dependent travel times. Information Processing Letters, 179:106287, 2023. doi:10.1016/j.ipl.2022.106287.

Appendix A Complexity Proofs

A.1 Remark 18

Figure 22 illustrates a variant of the reduction proposed in the proof of Theorem 17. Only the end part is different, with base helirin walks requiring two extra unit-time moves – south-east then north-east. Walls tiles are positioned such that, after the final south-east move, the only available x-coordinate at y-coordinate (L+1) is (2D+2)L2B1. Then the correspondence between this instance and the input instance of SubsetSum is established the same way as with the original instance.

Figure 22: Layout of the alternative 𝖭𝖯-hardness reduction of BaseKururin.

A.2 Remark 20

The main idea is to keep track of time with the rotation angle. By taking a large enough half-length of the helirin compared to the denominator qω of angular speed factor ω, we can discriminate between angles which are multiples of π/qω, e.g., by setting wall tiles in a similar way as in the proof of Theorem 25. Using this trick, having the time span of the input temporal graph fit within a single half-rotation, we can replicate the layout of the input temporal graph, and only make the start and the end of the representation of each timed arc available at specific angles – and thus at specific times.

A.3 Theorem 21

Proof.

We have eight non-negative integer variables (xμ)μ\{}, representing the time spent going in each of the eight directions. For each goal tile of side length s(i) and bottom-left corner coordinates (x(i),y(i)), we propose the following integer linear program:

minimizeμ\{}xμsubject toνcard(xExW)+νdiag(xNE+xSExNWxSW)x(i),νcard(xExW)+νdiag(xNE+xSExNWxSW)x(i)+s(i),νcard(xNxS)+νdiag(xNE+xNWxSExSW)y(i),νcard(xNxS)+νdiag(xNE+xNWxSExSW)y(i)+s(i),xμ+,μ\{}.

This ensures that we land on the goal tile as soon as possible. We have a constant number of variables and constraints, so the system can be solved in 𝒪(1) time (e.g., see [1]). Thus, by taking the minimum over all goal tiles, we can conclude whether, starting from base helirin state 𝒮0, there is a valid base helirin walk to a goal tile with duration at most D.

A.4 Conjecture 23

The idea would be to reduce from DNF-Tautology similarly to the 𝖼𝗈-𝖭𝖯-hardness proof of Theorem 28 in Appendix A.5. Formula φ would be encoded as an obstacle course going from left to right, with one parallel subpath per conjunction, which then goes back to the start. A unique goal tile is available and only made accessible after 2n loops, i.e., only when all 2n valuations have been tested on formula φ.

The main challenge is to replicate the 𝖼𝗈-𝖭𝖯-hardness reduction with spiked balls using the rotation angle of the helirin and wall tiles. As we explained in the proof of Theorem 25, wall tiles can be used to allow and forbid specific intervals of angle values at each accessible center position. This can be used to enforce a “restless” behavior on the helirin, e.g., by setting angular speed factor ω to 1/T and only allow an angle range of the form [k/Tπ,(k+1)/Tπ) for each center position. Furthermore, we believe the valuation currently at test can be encoded within the rotation angle, with a large enough time period for each newly encoded bit in order to ensure no interference with all previously encoded bits. Think of it like clock hands, starting from midnight: the second hand can go over multiple periods before the minute hand reaches half a revolution; in the meantime, the hour hand has barely moved and thus has kept its initial value. By defining τk=T2k and ωk=1/(τ0τk) for k{0,,n}, and setting ω=(0knωk), we believe that we could make the proof work. This would lead to integer values – i.e., time threshold D, angles, coordinates and speeds – in 𝒪(|φ|n+12n(n+1)/2). However, we expect the proof to be very technical.

A.5 Theorem 28

First, we show weak 𝖼𝗈-𝖭𝖯-hardness with spiked balls and νdiag=0.

Proof.

We reduce from 3-DNF-Tautology. Let φ=1im(li,1li,2li,3) be a 3-DNF formula with m conjunctions and n variables, again w.l.o.g. with exactly three literals per conjunction. Like in the 𝖭𝖯-hardness reduction, we set the helirin properties to (,νcard,νdiag,ω)=(1,2,0,0) and base helirin state 𝒮0 to (x,y,α,b)=(1,1,0,0). Plus, all spiked balls will have radius 1, μ= in their base move, and ν=1. So, all relevant elements will be set along a grid of 2×2 squares.

We encode the formula as an obstacle course going from left to right with parallel subpaths, one per conjunction in φ. Then, instead of reaching a goal tile, we allow the helirin to loop back to the start area. Figure 23 represents the base layout, which can be easily obtained with square wall tiles.

Figure 23: Layout of the 𝖼𝗈-𝖭𝖯-hardness reduction with spiked balls, illustrated with input formula φ=(¬x1¬x2¬x4)(x1x3x4). We are at time T+1, i.e., about to check valuation (x4,x3,x2,x1)=(0,0,0,1), which makes φ false.

The plan is to dedicate time T for each of the 2n valuations of the variables, this time forcing each one of them to loop through the structure, essentially choosing a subpath – i.e., a conjunction in φ. First, we set T=4m+6, D=T2n+2 and set a spiked ball SG at (x,y)=(2,0) with τ=D,t0=0 and d=D2. Then, at the beginning of each period, we force the helirin to leave the start area and head to the right. We do so with two more spiked balls:

  • S0 at (x,y)=(0,0) with τ=T,t0=1 and d=T1,

  • S0 at (x,y)=(0,2) with τ=T,t0=0 and d=2.

Plus, we force the helirin to reach the end of our loop by the end of each time period. We do so by setting spiked balls for every couple (i,j){0,,6}×{0,,2m+1}\{(0,0),(0,1)} at (x,y)=(2i,2j) with τ=T,t0=T1 and d=2. Then, other than time D1, the helirin is necessarily at positions (1,3),(1,1),(3,1) at respective periodic times (T1,0,1modT).

Now, for 1kn we tie variable xk to spiked balls of time period τ=T2k. More precisely, given 1im and 1j3, we set a spiked ball Si,j at x=2j+4 and y=4i4, with move duration d=T2k1 and:

  • if li,j=xk is a positive literal: τ=T2k,t0=0,d=T2k1,

  • if li,j=¬xk is a negative literal: τ=T2k,t0=d=T2k1.

Then, we have the same correspondence as in the previous proof between spiked ball appearances and valuations considered by lexicographic order. So, starting from time Th with 0h2n1, we can reach position (1,3) by time T(h+1) if and only if the hth valuation vh by lexicographic order makes φ true. Thus, we have that φ is a tautology if and only if, starting from base helirin state 𝒮0, there is a base helirin walk reaching the goal tile by time D.

Now, it is clear that the proposed 𝖭𝖯-hardness and 𝖼𝗈-𝖭𝖯-hardness reductions with spiked also work if νdiag=νcard. Furthermore, the role of spiked balls with standstill base moves can be easily achieved using pistons with unit-time moves. Indeed, given such a spiked ball (1,x,y,τ,t0,(,d),1), it blocks the square delimited by cells (x,y) and (x+2,y+2) in periodic times (t0,t0+d1modτ). So, e.g., we can define piston (2,x,2,τ,t0,t0+d,(N,1),y+2) to achieve the same result – i.e., when it is inactive it is completely out of the way, and when it is active it blocks the square delimited by cells (x,y) and (x+2,y+2).

A.6 Remark 29

In the case that time threshold D was not included in the input in the definition of problem BaseKururin, we show that the proof of Theorem 28 could be adapted to show strong 𝖭𝖯-hardness and strong 𝖼𝗈-𝖭𝖯-hardness. We do so by assigning a prime number to each of the n variables x1,,xn in the input boolean formula φ. For the sake of brevity, we focus on the reductions with spiked balls.

First, we compute the first n prime numbers during a preprocessing phase. Let (pi)i be the sequence of prime numbers. By the prime number theorem (e.g., see [26]), there is a constant K such that pnKnlog(n). As such, the first n prime numbers p1,,pn can be computed in 𝒪(log(n)) space by going over all integers up to Knlog(n) and performing naive primality tests. Once prime numbers p1,,pn are computed, we replicate the reductions used in the proof of Theorem 28, except we change the time properties of the spiked balls. Given k{1,,n}, those who are tied to variable xk have time period Tpk instead of T2k; with positive literals, we set t0=0 and d=T; with negative literals, we set t0=T and d=T(pk1).

Let h. If h is a multiple of pk then, at time units (Th,,T(h+1)1modTpk), spiked balls associated to literal xk block their respective path, while spiked balls associated to literal ¬xk do not. If h is not a multiple of pk then the opposite happens at time units (Th,,T(h+1)1modTpk). As such, if pi1,,pi are the prime numbers in (pi)1in which divide h then, at time units (Th,,T(h+1)1modTpk), formula φ is essentially being evaluated on the valuation which sets variables xi1,,xi to false and all the other variables to true. Conversely, this valuation is being tested when, e.g., h=pi1pi. Thus, in the variant of the 𝖭𝖯-hardness reduction, we will eventually be able to reach the goal tile if and only if there exists a valuation which makes formula φ true. In the variant of the 𝖼𝗈-𝖭𝖯-hardness reduction, we propose to replace the single goal-blocking spiked ball SG with n spiked balls SG1,,SGn of time period Tp1,,Tpn in sequence. This ensures that the goal tile is not accessible before time T(p1pn+1), i.e., before all valuations have been tested at least once.

A.7 Remark 30

Instead of using rotation angles and wall tiles to keep track of time like in Appendix A.2, similarly to the proofs of Theorem 28, we use spiked balls with standstill base moves to set intervals of time at which each edge in the underlying static graph is available. Furthermore, we use moving spiked balls along the representation of each edge in order to dictate exactly the travel time of the helirin along this edge. Not only does this allow us to encode interval temporal graphs, it can also be used to restrict the waiting time of the helirin at each vertex.