Condorra – Game Update 206/10/2016
In spent the last 2 weeks creating the battle-system for Condorra from scratch. It’s a turn-based system that gives players as much time as they need to decide on their action.
Here is a list of things that are already working + details:
- Turn Order
Because the system is turn-based, you have to somehow determine a way who’s turn it will be next. At first I implemented a modified version of Final Fantasy X’s CTB system. I won’t go into detail here, but it’s a system that allows the player to plan ahead his actions.
It turned out though this system was not a good fit. Condorra’s system put’s counters at center stage. Having a mixed turn-order (hero1 -> monster2 -> hero2 -> hero3 -> monster1) with counters thrown in just seemed random and confusing. So now the system is round based: first the heroes will take their action, then the enemies, then the heroes, etc.
- Selecting an Action
I just put all available actions for a character into a menu panel. They then select what they want to do.
- Selecting a Target
For now you can select everyone with every action. That might change in the future.
- Executing the Action
I would say this took the most time to get done. Players can counter all actions, enemies on the other hand only counter them under certain conditions. There is also what I call the “sweetspot” system: whenever a hero attacks an enemy, you have the chance to hit the sweetspot for extra damage. When an enemy attacks the player, you again get the chance to hit the sweetspot: If successful you can counter the enemy action. Hitting the sweetspot is as simple as hitting a key at the right time.
- Damage Calculation
I will admit that I
stoleborrowed most of my ideas from this FFX stat guide on gamefaqs (thanks). Once you execute an action, damage is based on your stats (attack, defense, magic, magic-defense), weaknesses against elements (fire, water, wind, earth) and the power of the action itself.
The state of this system is still very much in flux right now, but I think it’s a good foundation.
Condorra will have lots of content: Monsters, Actions, Battles, Maps, Animations, … So it’s important to create a structure that supports easily adding new content. Ideally without touching the code.
The answer to this is to make your content data-driven. Instead of hardcoding how things work and how they look, you allow a bit of room for customization. This is the folder structure in Condorra:
It’s a reoccurring theme: Each “thing” has it’s own folder.
Let’s take the attack action as example: It has it’s own folder in actions/. In there are 2 files: config.ini and script.mc. The config.ini contains details about attack, such as power, element, info. The script.mc is a script file. The game will call the script to know if the animation has finished, if a sweetspot was hit or simply to update it’s animation. So when I want to add that awesome screenshake effect (and I will) this is the file to write it in.
Interestingly this way of structuring works very well for a lot of things. The maps are structured this way as well. The config has the map-data, the script the behavior. Monsters will decide which action to take by calling it’s script. The Battles config.ini stores monsters, their position and the background image.