Where to start? Of course, we need an idea:
I've always been a huge fan of World of Warcraft, and always thought it could make a great top down RPG. So the basic idea is to transmute WoW combat into a Divinity: Original Sin clone. Fair enough.
Now let's imagine how a game in our combat system should be played. Describe it:
First, player TURNS are ordered for each ROUND. When his TURN STARTS, a character can play any ABILITY in his ability bar. In the most basic version, these abilities can DEAL DAMAGE, ADD a CONDITION to a player (good or bad) or both. So, when an ABILITY is EXECUTED, we create an instance of one or more HITs, wich describe hit properties, and then apply them to one or more characters. CONDITIONs can be triggered by various COMBAT EVENTs, and when fired can create their own HITs. Each ability costs a resource, let's call it ABILITY POINTS. They also have other restrictions, like RANGE, TARGET TYPE, CHARACTER STATE or other resources.
Now we need a character. We have a warrior with low level stats and few basic abilities. What kind of interactions these abilities should produce? A few ideas:
- We sure need to move. So we should have a basic movement ability (walk). It shouldn't be for free, so its ABILITY-POINTS cost will increase with target distance.
- We have a sword in our hands. Let's swing it. A basic melee hit, with a single target, dealing damage.
- We are tanks, so a basic surviving ability could be handy. Recharge shields.
- If we are tanks, we need tools to manage aggro somehow. A taunt ability.
- Some kind of self buff would be nice. Maybe a counter hit ability for the next round.
Finally, the character stats. We keep it very simple, later on we can complicate it.
- Hit Points. Of course.
- Shield. Another type of hit points.
- Action Points. Amount of 'things' a character can do in a turn.
- Power. Source of damage.
- Armor. Damage mitigator.
This was my starting point. Instead of jumping into action in Unity, I decided I should be able to play this basic version of combat on a simulator. Later it helped immensely with debugging and depedency managment. In little time, I was able to play a warrior vs warrior scenario:
A gorgeous log based combat
This was a great achievment. This kind of combat engine should make room for animations and user input. As there is so much stuff to cover, I'm skipping the details of the implementation, as it is a complex subject with so many different approaches. After making a lot of systems like this through the years, I always felt like a big step foward having them working.
Great, I could finally launch Unity. I spent some time choosing graphic style until I came with something I liked enough. It was simple and clean, with a toon shader doing all the work for me. I don't have much experience in this field, so I felt that keeping it really basic was going to be a really good idea. Then I needed a place to test the battle system. No better place than an arena. So here is one.
After creating the most basic UI and abusing Unity NavigationAgent for movement capabilities, I finally replaced the combat engine interfaces with their Unity counterparts and... It worked!
But it was ugly and lifeless. Barely a tiny step ahead of the log based combat system. It was missing just one thing to look like a game instead of a form: ANIMATIONS.