Hello, and welcome to what will hopefully be the first of many dev logs I make for my solo developed, currently untitled turn based RPG game. I am currently developing the game using Unity and C#, and hope to release it to the world sometime soon. These dev logs are going to be where I talk about what I have been working on this week, and offer some insight into the game creation process. This first blog is about the turn based combat system in games, and a look into the thought process that went into it.

(This is the current look of the game, but it will most likely change as I continue to work on it.)
At first glance turn based games are a simple concept. A character, either player controlled or an enemy gets to preform an action, and then the system moves down a list and lets the next character gets to preform an action until every character gets a turn. From there enemies and players have different moves, strengths, weaknesses, and other stats to allow variation throughout the game. This allows for strategy, power levels and other interesting mechanics to be added into a simple system. When programming a system like this it is all just numbers flying back and forth, until animations get added it doesn’t feel much like a game. As well as it mostly feels like players will just be clicking the attack button each time it is their turn without any added mechanics. This is where the struggle of creating a turn based game comes in, as the concept of the game itself might be simple, the interesting part comes from the mechanics.
Simple Right?
The code to build a turn based game starts off simple, something like checking the characters in combat and setting them to an order based off whatever stat you would like.
for (int i = 0; i<players.Count; i++)
{
//this allows me to activate and deactivate combatants before the combat order is decided
if (players[i].activeInCombat)
{
Combatant item = new Combatant(players[i].Cname, players[i].speed, players[i].combatIcon);
combatants.Add(item);
Debug.Log("Added: " + item.CName);
}
else
{
players[i].gameObject.transform.localScale = new Vector3(0, 0, 0);
}
}
for (int i = 0; i < enemies.Count; i++)
{
//this allows me to activate and deactivate combatants before the combat order is decided
if (enemies[i].activeInCombat)
{
Combatant item = new Combatant(enemies[i].Ename, enemies[i].speed, enemies[i].CombatIcon);
combatants.Add(item);
Debug.Log("Added: " + item.CName);
}
else
{
enemies[i].gameObject.transform.localScale = new Vector3(0, 0, 0);
}
}
//this is the combat order list
combatants = combatants.OrderByDescending(o=>o.speed).ToList();
for(int i = 0; i < combatants.Count; i++)
{
Debug.Log("Combat order: " + i + ". " + combatants[i].CName);
}
nextTurn();
}
After creating the list you then send it to the next characters turn, and give them an action list. Where the player can pick their action, or the enemies select their action and target a player.
public void nextTurn()
{
actionWindow.SetActive(false);
actionWindow.GetComponentInChildren<TMP_Text>().text = "";
Debug.Log("Going to next combatants turn!");
string temp;
if(orderInTurns < combatants.Count)
temp = combatants[orderInTurns].CName;
else
{
orderInTurns = 0;
temp = combatants[orderInTurns].CName;
Debug.Log("Reset combat order");
}
CL.rotateOrder(this);
if (combatants[orderInTurns].isActiveInCombat == false)
{
Debug.Log("That character is dead, going to next");
playerTurn = false;
enemyTurn = false;
orderInTurns++;
nextTurn();
return;
}
orderInTurns++;
if (players.Find(i =>i.Cname == temp) != null)
{
CactiveTurn = players.Find(i => i.Cname == temp).Cname;
playerTurn = true;
}
else
{
CactiveTurn = enemies.Find(i => i.Ename == temp).Ename;
enemyTurn = true;
}
Debug.Log("It is " + CactiveTurn + "'s turn!");
if (playerTurn)
playerActions(CactiveTurn);
if (enemyTurn)
enemyActions(CactiveTurn);
}
That is the simple basis for a turn based combat system, however like I said above this mostly results in the player just clicking the attack button to deal damage and nothing else, which isn’t very interesting. This is where game design begins to shine, and one of the harder portions of creating a turn based game. I’m not going to get in depth to the systems of my game yet, but I will take a look at some other ones. Pokémon is a simple version of turn based games. It features strengths, weaknesses, and neutral damage numbers when an attack hits, as well as character/Pokémon buffs and debuffs allowing for more interesting strategies. This design is so good that its become the most popular turn based game in the world. Expanding on the simple turn based system games like Final Fantasy 7 and 13 take the system and add a time mechanic to it. Making both players and enemies wait till a gauge fills up before the characters are allowed to attack, or do certain actions. There are many ways to create new and unique systems for turn based games, but it requires good design space, and fresh ideas to make something completely unique.
But why turn based?
So in the time that I have spent developing my game I thought about making it a real time combat system as well, similar to how many of my favorite action RPG’s do (Kingdom Hearts, Nier: Automata). This system at first glance may seem harder to create, however I would argue that it is simpler. The mechanics like strengths and weaknesses still come into play, however they aren’t as pivotal to the success and fun of the game as they are in a turn based system. In a turn based game, that is all you have to make it interesting and unique. In real time you can make different weapons, combat styles, enemy movement patterns, attacks, and more. Its a lot easier to visualize what the strategy is for those games, then it is to create a turn based strategy system. Taking all of this into account, I’m sure real time games have their own share of difficulties to tackle when creating them.
Game of the week
At the end of each of these posts I would like to highlight a game I am currently playing/ am interested in/am excited for, as well as a clip of music from games that I feel should be appreciated. With the Last of Us: Part 2 winning game of the year, I would like to highlight one of the other games nominated, Hades. It is an action roguelike game made by the fantastic indie team Supergiant games. I love all of their games and can’t recommend them enough, so if you get the chance to play any of their games do so. My favorite is Transistor because of the Sci-fi theming, as well as the vocal tracks within the game. It also creates a unique spin on the turn based system, allowing players to pause time and plan out very quick actions to be preformed in succession, where all the other enemies act in a typical action RPG style. It is fantastic game design, and I hope supergiant continues to make fantastic games!
Until next time,
Ryan o/
