Aurora Combat Part 1 — Creating a Combat System
Posted on July 22nd, 2012 at 5:19 pm
This blog is being set up to document my various independent game projects as I work on them. I tend to have a small collection of side projects that each progress as I feel inspiration to work on them. Having a small collection of different projects means that I’m unlikely to find myself stuck on all of them and thus do no work at all.
The current project that is tickling my fancy is meant to be a flexible combat design tool. I enjoy working with combat systems, but one of the things I don’t like is the overhead required to get one working at the most basic level. Having to do that just to play with a concept or a control scheme is exceptionally irritating. Thus, the purpose of this project is to create a tool that will allow me to build a combat system relatively quickly, and then be able to expand and iterate on that system easily and painlessly with minimal code changes. If this works out, I may extend it to be able to work in an actual game environment.
Planning Out the Execution
I’m going to be working in Unity 3d. Unity is a great prototyping tool because of its very user-friendly editor and editor extensions, and it’s an environment that I’m quite comfortable in.
I don’t know precisely what the actual code structure of this system is going to be yet. Any seriously detailed plans I make at this point are going to be little more than educated guesses. For that reason, I’m going to start from the smallest bits of functionality (a character swings a sword) and move on to more complicated interactions (a character swings a sword and hits something) and upwards until the system has the features that I want.
So what are those features? Here are some of the broad concepts and features I want this system to have:
- Stance-based Combat — Collections of attacks will be grouped up into “Stances.” Stances will have different relationships to one-another. For example, the “Guard” stance might automatically block the “Heavy” stance, whereas the only way to block attacks from the “Fast” stance will be to cancel them out with other “Fast” stance attacks.
- Swordplay Focused — Though I will try to make the system itself as abstract and non-specific as possible, my first iteration will be for one vs one sword combat.
- Dynamic Movement and Animation — I’m not an artist, so I don’t want to have to make countless animations for this system to work. I want to be able to set what characters are going to do from within Unity’s editor.
- Physics-based Interactions — There’s no point in creating a dynamic animation system if it plays the same way every time. I want the character’s swords to interact in a physical and generative way.
- Stat-based Interactions — I also want to support character statistics that will modify how the characters fight. Examples of this would be the strength or speed of an attack.
- Encapsulated Controls — The input methods for combatants will be separated from the actual systems. The input will only see a list of attack “types” (Attack 1, Attack 2; horizontal, vertical, lunge; etc) and Stances.
Now, this list is quite intense, and the system it details is rather expansive. I expect this to take a long time, but the journey is half the point. As I said before, I’m going to start with very basic functionality and work up from there, with the goal of having the final structure evolve naturally.
Let’s get to it.