The complexity of speedrunning video games
Manuel Lafond, Marc Herbstritt
Fun with Algorithms
Speedrunning is a popular activity in which the goal is to finish a video game as fast as possible. Players around the world spend hours each day on live stream, perfecting their skills to achieve a world record in well-known games such as Super Mario Bros, Castlevania or Mega Man. But human execution is not the only factor in a successful speed run. Some common techniques such as damage boosting or routing require careful planning to optimize time gains. In this paper, we show that optimizing
... hese mechanics is in fact a profound algorithmic problem, as they lead to novel generalizations of the well-known NP-hard knapsack and feedback arc set problems. We show that the problem of finding the optimal damage boosting locations in a game admits an FPTAS and is FPT in k + r, the number k of enemy types in the game and r the number of health refill locations. However, if the player is allowed to lose a life to regain health, the problem becomes hard to approximate within a factor 1/2 but admits a (1/2 − )-approximation with two lives. Damage boosting can also be solved in pseudo-polynomial time. As for routing, we show various hardness results, including W -hardness in the time lost in a game, even on bounded treewidth stage graphs. On the positive side, we exhibit an FPT algorithm for stage graphs of bounded treewidth and bounded in-degree. ACM Subject Classification Theory of computation → Design and analysis of algorithms, Theory of computation → Approximation algorithms analysis, Theory of computation → Parameterized complexity and exact algorithms Keywords and phrases Approximation algorithms, parameterized complexity, video games, knapsack, feedback arc set Digital Object Identifier 10.4230/LIPIcs.FUN.2018.27 1 The author acknowledge the Natural Sciences and Engineering Research Council of Canada (NSERC) for the financial support of this project. 2 All products, company names, brand names, trademarks, and sprites are properties of their respective owners. Video game screen-shots and sprites are used here under Fair Use for educational purposes.