Tool Assisted Speedrun: Kuru Kuru Kururin Link
While mohoc was the expert of the game and main director of the TAS, I was the technical team. If you watched the video of the TAS, you might be thinking "well, this game is totally broken, look how it is easy to clip in the walls!". But if you try it yourself, you might be surprised how difficult it is! Actually, clipping in a wall without the help of a moving object is not humanly feasible: you need a tool that allows you to choose which button to press on every frame if you want a chance to replicate it. And even with such a tool, this is quite complicated: in fact, another TASer, Ryuto, made a TAS years before our, without even noticing such a mechanics was possible.
So, how to achieve it? You can find an explanation of how it works on tasvideo.org, but the conclusion is that there is no systematic way to achieve it! It relies on a very precise combination of position, velocity and collision mask, and the only way we found in order to be able to achieve it in different places is to make a bot that tries a lot of paths. It wasn't possible for that to make a script that communicate with the game in order to test different paths, because it would have been way to slow. Instead, I replicated the exact physics of the game, from the logics of collisions to the computation of trigonometric functions with the good precision!
I implemented it in C#, and you can find the code on Github. In order to search paths, I basically used an A* algorithm with a custom cost map computed with some kind of flooding algorithms. Some optimisations and approximations were necessary in order to reduce the search space, but in the end, it worked! Though, there is no guarantee of optimality in the results produced (not the full search space is explored, and the cost map is just an heuristic). But anyway, that was a great challenge, both algorithmic and technical, and I really like the result 😁!