Bot Brawlers Devlog #01 - Fighting Game Foundations
Updated: 4 days ago
Bot Brawlers is a fighting game that I am working on in my free time with a colleague. I have no prior fighting game development experience but I am a big fan of the genre. I do not expect it to be an easy task, but I believe it will be an educational experience (and hopefully an enjoyable one too).
Before I get started, I am leaving a link to The Fighting Game Glossary by Infil. It is a fantastic resource for fighting game terminology and I would recommend looking there for any terms that you don't know.
The game is being developed in Unity and I will be doing the majority of the programming for the project. It is a 2D fighting game and our plan is to take aspects from various different fighting games which we enjoy. It is leaning more towards being an "anime game" in terms of its gameplay, with fast and strong movement options such as a run and an air dash. Our goal is to create a fully-functional experience with just one character to see if our concept works before continuing further.
We started this project about 3 months ago and have been working on it on and off as a side project. Recently, I realized that I wanted to document my progress throughout its development so that I can look back at it in the future. And now, here we are. So firstly, some quick recap :
This is one of the first commits that I made on the project after I had implemented basic motion input detection. Early on, I decided I wanted to use Unity's new Input System, so I could easily test it with either my controller or keyboard. Of course, a controller is ideal for testing as well as playing a fighting game. That being said, there are times when I don't have my controller and want to work on and test the game.
Now I'll start getting into the scripts that I've written. For this post, I will be focusing on the InputManager class which of course, handles the player input. Eventually, it may be used as a base class for different character classes to derive from. But so long as there is only one character in the game, there is no need to do so.
In the Awake method I am subscribing methods to the Action Delegates Movement, KeyboardMovement, and Button. These are called every time the player moves their thumbstick, presses a key on their keyboard, or pushes a button on their controller.
The first step to determining the player's directional input is translating their input into a Vector2.
Then depending on the value of the Vector2, it is assigned a string such as "DownBack", "Neutral", "Forward", etc. This string format is used going forward to determine the direction the character will move in, what attack will come out if they press a button, as well as checking for motion inputs.
Motion inputs are used for powerful moves such as specials or supers. Some people believe they are a barrier to entry and should be removed from fighting games and other people argue they increase the skill ceiling in the form of execution. I am all for simple motion inputs such as quarter circles, semi circles, double quarter circles, and dragon punch (DP) motion. Any more complicated inputs than that and I may disagree, but for these inputs I would argue that they are there for a reason. For example, say a character has a special move with invincibility. If their opponent jumps at them and attacks, they will want to use this move as an anti-air. If the move is activated by holding down and a button, the time it takes for a player to identify their opponents attack and input the special move is in my opinion, too lenient to provide an adequate challenge. However, if they are required to input 3 different directions in succession in order to activate their invincible special, then this feels fairer to me. With this setup, they may not be able to react to their opponent and input the full motion in time. It is far easier to correctly input a dp motion in training mode than it is react to your opponent's jump and input it in time. This is known as mental stack, or how the more options your opponent has, the slower your reactions will be because there is more you need to think about.
Another important aspect of fighting games is that the game is typically locked to running at 60 frames per second to provide a consistent experience for all players. Just about everything in fighting games is connected to frame rate to the point where all matters of timing are measured in frames. For example, the startup of attacks is measured in how many frames after pushing the attack button until the move is active.
Okay, now that my tangent has finished, allow me to explain how I check for motion inputs. When the player inputs the first direction of a motion input, a coroutine is run which checks for the next consecutive inputs within a 12-frame window or one fifth of a second. If the player inputs each input within that amount of time and then pushes the correct button (also within a 12-frame window) they will then use the special move.
This is what the SpecialMove data type looks like in the Inspector, which I will go over more in depth in my next devlog. As you can see it contains a list of each directional input and a button input. The first directional input, however, actually contains two directional inputs split by a slash. The special move coroutine parses this string and splits it into a string array using the slash as a divider. I implemented this to allow for leniency in my motion inputs, this way a player can activate this special starting with either a forward or down forward motion.
Well that is all for my first devlog, I hope you enjoyed and maybe learned something too. For my next devlog I plan on talking about how and why I setup the different data types in the game as well as an overview of frame data in fighting games.