Overcooked! 2 TAS

Automated high-score gameplays

Showcase (2023)

Showcase (2020)

What is a TAS?

TAS stands for Tool-Assisted Speedrun, but in the context of Overcooked, it means a high-score gameplay with the aid of tools.

This game is challenging for a TAS because it is a multiplyer game. Simply slowing down the game, for example, would not give much of an advantage, and it could only be done with local co-op. Online gameplays obviously cannot be slowed down.

For that reason, the only feasible way to do a TAS for this game is to automate the entire gameplay.

Automation Strategies

There are some quite distinct approaches:

  • Arrange raw keystrokes. This is the simplest but perhaps most annoying approach. The idea is to write a script to send keystrokes at precisely the right time. It’s annoying because it’s very difficult to get the timing right, and it’s also very difficult to test and debug. That being said, the legendary player G_U_A has managed to do this for Carnival of Chaos 3-4.
  • Arrange high-level actions. This is the approach I took. A script is still written, but the script contains higher-level actions such as “pick up this item here”, “chop this item until done”, etc. This requires interpreting the action in the context of the game’s state, and turning it into a sequence of raw game inputs. It’s easier to write, but still suffers from the problem that testing the script takes a long time.
  • Write an AI. Another idea is to write an AI to automatically play the game without scripts. I’m not sure how to do this especially since the game is so complicated, but it would be amazing to see.

Solving the Testing Problem

To test any script, we need to run it from the beginning of a level. We can speed up the gameplay with a well known trick Time.captureFramerate, but still, it is an \(O(N^2)\) time endeavor to arrange a level, so to speak. It would be nice if we can test a script from any point in the level, so we can incrementally write the script and test it as we go.

Offline Simulation (2020)

In 2020, my approach was to write an offline simulator that takes the game state and a list of actions and runs these actions against the game state without using the actual game. The simulator needed to be reasonably accurate compared to the real game, but it didn’t need to be perfect. A special tool was made to arrange the chefs’ actions and simulate it offline at the same time. Once in a while, we can connect to the real game and simulate it from the beginning, to make sure that the script does work in the game. We can then continue from where the real game left off and continue arranging with offline simulation.

The following video demonstrates this offline simulation implementation used for the 2020 TAS:

One big limitation with the offline simulation approach is that behavior that relies on physics (e.g. collision) is very difficult to simulate accurately. This makes it impractical to arrange a script for any level that requires throwing many items onto the floor.

Online Frame Warping (2023)

In 2023, I rebooted my interest in Overcooked TAS and decided to implement a new approach: make the game instantly “warp” to any previously recorded frame.

With this technology, a script can be tested from any point of the level, and all mechanics of the game are supported, because the real game is used. This gets around the limitations of the offline simulation approach, most importantly, physics are simulated accurately.

This is extremely challenging. The game is not built for suddenly changing the game state (unlike some other games where it’s possible to join a game in the middle), and although I’m doing TAS as a local co-op, the game’s architecture is written in a way that local games also use the online networking code. So the game may be in the middle of synchronizing some changes from server to client while I want to issue a warping command to suddenly transition to a completely different state.

Nonetheless, with enough effort I managed to implement this. Here is a video demonstrating the technology:

And here’s a more complete video explaining how the 2023 TAS was done:

Source Code

The project is currently in development at https://github.com/hpmv/overcooked-supercharged.


Join my Discord server if you would like to use the TAS tool and/or contribute to the project!