Hi, I’m Morita, a programmer.

For this blog I’d like to talk about how we automated bug checking in Bayonetta 2.

Before a game is released and actually reaches your hands, there’re a lot of little things called bugs that we have to take care of. Here’s a refresher course on some of the types of bugs there are:

Freeze Bugs
The game stops responding to controller input, the game freezes, and the player’s only available option is to manually shut down the console.
These are serious bugs, even mid-development. If you don’t take care of them quickly, production of that section of the game comes to a halt.

Collision Bugs
These bugs occur when the player falls through an invisible hole in the ground, gets pushed by an enemy into some area they’re not actually allowed to go (and shouldn’t exist), or stuck inside the walls of a building somehow, etc. If you continue to mess around once these bugs happen, the game might freeze.

When you get close to the end of development, there’s a period called bug check where you try to find and fix all the remaining bugs in the game that you can. This check usually involves the whole internal team, plus dedicated professionals outside the company as well.

There are a few different methods people use to check bugs. For example:
– Full playthrough (seeing if the whole game can be played from start to finish without freezing)
– Playing the game extended periods of time
– Trying to go back after doing something and seeing what happens
– Trying to do something different from intended design
– (Etc…)

Now, do we need every aspect of bug checks to be handled by actual people? My policy is: if a machine can do it, let’s make a machine do it. In this instance, we determine a set of actions for Bayonetta to perform, and make the console play the game over and over and over again.

For example, our first method for bug checking, the full playthrough—if we’re just going to play through the game’s main story, we know what that route is, and what we need to do along the way, so shouldn’t this be possible?

Then there’s bug checking by playing the game for extended periods of time. People need to sleep, eat, and take breaks, but we can make a machine play the game as long as we want and it’ll never even have to use the restroom! This is where automated bug checking really shines.

There also happen to be these kinds of bugs that have a very low chance of reoccurring, sometimes even as low as only a 1/50 chance. If there’s a bug that we randomly came across at one point and want to find the exact conditions for reproducing it, we can program the game to try something in the most precise way possible, and experiment around until we figure out what’s causing the problem.

Looking at all that, you realize there’s a lot that a machine can take care of. If you let a machine handle part of the bug check, you slim down what the rest of the team has to do, meaning they can do a much more specific and faster check, and everything ends up being more efficient.

I started thinking about this autoplay tool around the time development for the first Bayonetta ended. Finally, with Bayonetta 2, I was able to try it out.

In total, the tool has accomplished beating Bayonetta 2 40 times in a row. In actuality, it could probably go a lot further, but by the time it’s played that long, we’re ready to add fixes and update old data, so we have to turn it off once, refresh our data, and then start it up again.

Okay, you’ve dealt with a long enough wall of text. Let’s try looking at a video.

*This video was taken during development, so it looks different from the actual game.
auto01

In the image above, you can see some red cones connected by lines. This is the autoplay course for the game. I had to sit down and write in all this data piece by piece.

The overall setup is simple. Whenever Bayonetta gets to a cone, she performs a pre-determined list of actions for that cone in order. When she’s done with everything, she moves on to the next cone.

This doesn’t involve adding any special actions for Bayonetta. For movement, I started from the intended destination and camera angles and worked backwards determining what direction would need to be pressed on the controller.
It was important for me to make the tool so Bayonetta moved as if the controller had moved her.

The tool could control the following:
– Move to destination
Walk, jump, double jump, warp (this was a special debug-only feature)
– Controller input
Capable of full-circle spins and more.

auto02

– Standby for certain conditions

Besides the basic features, it also has a variety of complex functions, such as “auto-battle,” or operations that are only used for debugging, like outputting a data log, taking screenshots, and so on.

Auto-battle is pretty cool. Bayonetta acts as if she has an Immortal Marionette equipped and pretty much fights as if someone was just mashing the buttons, randomly performing Torture Attacks and Umbran Climaxes when she fills her gauge.
*This video was taken during development, so it looks different from the actual game.
The commands can actually get pretty complex. We can have Bayonetta perform actions while moving between cones, and lots of crazy stuff. Some of the command patterns I programmed were like, “punch three times and then move,” or “do X,Y, and Z while warping in an infinite loop.”

Sorry… looks like I got carried away. I think I’ve written too much already. I’ll talk about the tool’s actual implementation another time.

The tool was used in various ways. I used it for repeating specific actions under individual staff members’ development environments, and I would refresh the data and put the game on autoplay before going home, so basically I was going around asking everyone: “Hey, if you’ve got a PC/dev kit to spare, can I use it?”

Then, when we came back to work the next day, we’d find the game frozen after trying to do this or that, thus helping us discover a lot of bugs that might’ve taken a long time to find otherwise. Next project I hope to make an even more improved version.

Thanks if you’ve read this far. I know it didn’t really have that much to do with Bayonetta 2 itself, but I hope you found it interesting.

I hope it gets across that I’ve tried my best to make sure your Bayonetta 2 experience is as bug free as possible 🙂
I look forward to getting to speak to you all again in the future.

If you ever want to message me on twitter, follow me @PG_morita!