Finding Shortest Walks in Kuru Kuru Kururin
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, ComplexityFunding:
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:
2012 ACM Subject Classification:
Theory of computation Problems, reductions and completeness ; Theory of computation Shortest pathsSupplementary Material:
Software (Source Code): https://github.com/E-Sh4rk/KururinTAS [13]
archived at
swh:1:dir:38c9ece3ce3ee16ef48ecd29d110e056706aa8f2
Acknowledgements:
We would like to thank the organizers and reviewers of the FUN2026 conference.Editor:
John IaconoSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
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).
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).
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 which represents a half-length a cardinal speed a diagonal pointwise speed and an angular speed , .
Definition 3.
A base helirin state is defined as a tuple representing a center position , an angle , and a boolean indicating whether the helirin is turning counterclockwise.
We treat angles modulo . Like in the unit circle, angles are measured from segment and increase as you turn counterclockwise. By default, we assume that a helirin is turning counterclockwise – i.e., .
Definition 4.
The base moveset is , i.e., a standstill and the eight cardinal and diagonal directions “north”, “north-east”, etc.
A base move is a couple where 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 is a sequence of base moves from an initial state and time . The duration of walk is defined as .
Definition 6.
Let . A tile is a 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 where is the tile kind, is the side length and are the coordinates of the bottom-left corner of the 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 , a base helirin state , times .
- Question:
-
Starting from state at time , is there a valid base helirin walk to a goal tile of duration at most ?
Let 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 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 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 until it no longer intersects with the spring tile edge – say, after an angle . Then the rotation is reverted back by an additional angle , 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 which represents a square of side length , the starting coordinates of the bottom-left corner, a time period , a periodic activating time , a periodic deactivating time , a base move and a (pointwise) speed .
Definition 11.
A spiked ball is defined as a tuple which represents a disk of radius , the starting coordinates of the bottom-left corner of the square which inscribes the disk outer circle, a time period , a periodic starting time , a base move 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 , target .
- Question:
-
Is there a set such that ?
Definition 13.
Let be a set of vertices. A timed arc is a tuple representing a directed arc , a departure time and a travel time . A point temporal graph is of the form where is a set of timed arcs.
An interval timed arc is a tuple representing a directed arc , an earliest and a latest departure time and a travel time . An interval temporal graph is of the form where is a set of interval timed arcs.
Definition 14.
A temporal walk in a (point or interval) temporal graph is a sequence of timed arcs such that, for all , and . In the point model, arcs must belong to . In the interval model, for every timed arc in the walk, there must be an interval timed arc in such that . The walk is called restless if and for all . The arrival time of is .
Definition 15 (Problem (Restless)ForemostTemporalWalk).
- Input:
-
A (point or interval) temporal graph , two vertices , a time .
- Question:
-
Is there a (restless) temporal walk from to with arrival time at most ?
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 , we can find it by guessing moves 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 .
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 .
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 be the elements and let be the target. Let and .
We propose the following instance of BaseKururin. We set the helirin properties to . We set and . We set wall tiles to form the instance illustrated in Figure 7. For each choice of element in SubsetSum, we have two branching paths: one, which we call , where you go east for time units, and another, which we call , where you go north-east for time units, then south-east for time units. Both paths are then merged. Finally, there is a single goal tile at position .
Recall that . As such, by only taking paths of the form , we only have access to -coordinates which are multiples of . So, the goal tile can only be reached by some taking paths of the form , each of which induces an -coordinate offset of modulo .
If our instance of SubsetSum has a solution , we propose base helirin walk where, for all , we take path if and path otherwise. This walk is valid and ends at position . Conversely, if we have a valid base helirin walk , by our choice for speed values and time , 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 with for all . We propose . Then, because is valid and ends at position , we have: .
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 needs to be encoded in binary for our reduction to work. In fact, if time 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 vertices and timed arcs. Each accessible center position can be encoded as a tuple of values in giving a signed number of unit-time base moves in each direction in order to reach it. And timed arcs are of the form , where represents a center position accessible at time and represents a center position accessible from with one of the nine unit-time base moves. If is the number of tiles in our instance of BaseKururin then, in time, we can compute all accessible center positions, including whether they are in a goal tile, and compute an equivalent point temporal graph . Then problem ForemostTemporalWalk can be solved in linear time on 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 time (e.g., see [1]), so we can solve our problem in 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 such that we cannot reuse the trick used to prove the -hardness of BaseKururin in Theorem 17. In particular, if , then one can no longer create a position offset other than a multiple of . In fact, the graph of accessible center positions with unit-time move neighborhood is a grid graph, with a four-neighborhood if and an eight-neighborhood if . 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 time.
Theorem 22.
BaseKururin with and 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 .
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 to be given in binary in the input.
Theorem 25.
BaseKururin augmented with spring tiles is weakly -hard even when and time is given in unary.
Proof (Sketch).
We reduce from weakly -hard problem SubsetSum [12]. Let be the elements and let be the target. Let and .
We propose a similar reduction to the proof of Theorem 17, except we rely on rotation angle offsets instead of position offsets. We set and . We set the helirin properties to and we set . We set wall tiles to form the instance illustrated in Figure 8. For each choice of element in SubsetSum, we have two branching paths: one, which we call , where you go south, then east for time units, then north, and another, which we call , where you go north, then east for time units, then south. Both paths are then merged. Plus, there is a single goal tile at position .
Now, let . Given , let be the coordinates of the right extremity of the helirin at angle . Since , function is injective over , and sequences and are respectively non-increasing and non-decreasing. Plus, for each , couple is merely a rational approximation of the cosine and sine of angle , and thus can be computed in polynomial time.
Knowing this, we can use these values to position our spring tiles accordingly. In bottom paths , we rely on numerator to align the edges with the mirroring property. In bottom paths , we rely on numerator instead. And, once both paths are merged, we rely on numerator . Finally, right before the goal tile, we set two wall tiles in order to block positions for every . 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 .
Still, the algorithm from Theorem 19 can be adapted if, on top of time , the denominator of angular speed factor is given in unary in the input. Then the number of vertices in the equivalent point temporal graph is in .
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 , and half-length , cardinal speed and tile sizes are given in unary.
Proof.
We focus on the -hardness proof with spiked balls and . All other proofs are discussed in Appendix A.5.
We reduce from 3-Sat. Let be a 3-CNF formula with clauses and variables, w.l.o.g. with exactly three literals per clause. We set the helirin properties to and base helirin state to . Plus, all spiked balls will have radius , in their base move, and . So, all relevant elements will be set along a grid of 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 at . Then, going from the start area (in red) to the goal tile (in yellow) with no wait takes time at most .
The plan is to dedicate time for each of the 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 . We do so with a spiked ball at with and . 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 and at with and .
Now, for we tie variable to spiked balls of time period . More precisely, given and , we set a spiked ball at and , with move duration and:
-
if is a positive literal: ,
-
if is a negative literal: .
In other words, spiked balls tied to literal (resp. ) block their respective path during periodic times (resp. ).
We now piece everything together. Let us consider valuations by lexicographic order. Given , let be the valuation by lexicographic order. Then, matches with the binary representation of from the right (e.g., the value of in is the last digit). Knowing this, consider time units . During them, by the definition of spiked balls , the latter block their respective path if and only if:
-
and the digit of from the right is , or
-
and the digit of from the right is .
Thus the missing spiked balls exactly correspond to the literals which are made true by valuation . As a result, starting from time , we can reach the goal tile by time if and only if makes true. Finally, we have that is satisfiable if and only if, starting from base helirin state , there is a base helirin walk reaching the goal tile by time .
Remark 29.
It is worth noting that the proposed pseudo-polynomial time algorithms heavily rely on the inclusion of time threshold 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 , an angle , and a boolean 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 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 bits, i.e., roughly 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 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 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.
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 induced by our cost map:
-
1.
Let be a priority queue. For each starting state , the pair is added to with priority .
-
2.
The pair of minimum priority is extracted from .
-
If this is a final state, then the algorithm terminates: a path of length has been found.
-
Otherwise, the successors of are computed, and for each such successor , the pair is added to with priority . 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 that truncates some of the state components to the desired precision (that can be configured depending on the application, cf. Section 5). Two states and are in the same equivalence class if and only if .
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 : when a state is extracted from the priority queue , is added to – if it was already present, then is removed from 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 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).
(no checkpoint).
(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.
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 |
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].
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 -coordinate at -coordinate is . Then the correspondence between this instance and the input instance of SubsetSum is established the same way as with the original instance.
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 of angular speed factor , we can discriminate between angles which are multiples of , 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 , representing the time spent going in each of the eight directions. For each goal tile of side length and bottom-left corner coordinates , we propose the following integer linear program:
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 time (e.g., see [1]). Thus, by taking the minimum over all goal tiles, we can conclude whether, starting from base helirin state , there is a valid base helirin walk to a goal tile with duration at most .
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 loops, i.e., only when all 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 and only allow an angle range of the form 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 and for , and setting , we believe that we could make the proof work. This would lead to integer values – i.e., time threshold , angles, coordinates and speeds – in . However, we expect the proof to be very technical.
A.5 Theorem 28
First, we show weak -hardness with spiked balls and .
Proof.
We reduce from 3-DNF-Tautology. Let be a 3-DNF formula with conjunctions and variables, again w.l.o.g. with exactly three literals per conjunction. Like in the -hardness reduction, we set the helirin properties to and base helirin state to . Plus, all spiked balls will have radius , in their base move, and . So, all relevant elements will be set along a grid of 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.
The plan is to dedicate time for each of the 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 , and set a spiked ball at with and . 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:
-
at with and ,
-
at with and .
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 at with and . Then, other than time , the helirin is necessarily at positions at respective periodic times .
Now, for we tie variable to spiked balls of time period . More precisely, given and , we set a spiked ball at and , with move duration and:
-
if is a positive literal: ,
-
if is a negative literal: .
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 with , we can reach position by time if and only if the valuation by lexicographic order makes true. Thus, we have that is a tautology if and only if, starting from base helirin state , there is a base helirin walk reaching the goal tile by time .
Now, it is clear that the proposed -hardness and -hardness reductions with spiked also work if . 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 , it blocks the square delimited by cells and in periodic times . So, e.g., we can define piston 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 and .
A.6 Remark 29
In the case that time threshold 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 variables in the input boolean formula . For the sake of brevity, we focus on the reductions with spiked balls.
First, we compute the first prime numbers during a preprocessing phase. Let be the sequence of prime numbers. By the prime number theorem (e.g., see [26]), there is a constant such that . As such, the first prime numbers can be computed in space by going over all integers up to and performing naive primality tests. Once prime numbers are computed, we replicate the reductions used in the proof of Theorem 28, except we change the time properties of the spiked balls. Given , those who are tied to variable have time period instead of ; with positive literals, we set and ; with negative literals, we set and .
Let . If is a multiple of then, at time units , spiked balls associated to literal block their respective path, while spiked balls associated to literal do not. If is not a multiple of then the opposite happens at time units . As such, if are the prime numbers in which divide then, at time units , formula is essentially being evaluated on the valuation which sets variables to false and all the other variables to true. Conversely, this valuation is being tested when, e.g., . 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 with spiked balls of time period in sequence. This ensures that the goal tile is not accessible before time , 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.
