Turn based battle system question
by Antonios Dimitrelis · in Torque Game Engine · 11/12/2007 (3:18 am) · 5 replies
Hello again dear Torques. :)
For the project I'm working on, I would need a turn based battle system in which
4 characters fight 4 enemies (without the time/speed bar the FF series used).
Depending on who got the advantage to attack first, the enemies or the characters would make their moves first after the player gave the appropriate commands for the characters is controling, picked from the menu (basic attack, defend, skill, combo, item) of actions available.
I heard before (it was the version 1.4 I think) that it was difficult or not possible to do so
I thought I'll ask myself in case that someone ever did such a battle system that could
give me some infos about the procedure. Most of all since we already have the version 1.5.2
now and time has passed since then when 1.4 was totally new. ;)
Any infos would be greatly appreciated. :)
Thanks in advance!
For the project I'm working on, I would need a turn based battle system in which
4 characters fight 4 enemies (without the time/speed bar the FF series used).
Depending on who got the advantage to attack first, the enemies or the characters would make their moves first after the player gave the appropriate commands for the characters is controling, picked from the menu (basic attack, defend, skill, combo, item) of actions available.
I heard before (it was the version 1.4 I think) that it was difficult or not possible to do so
I thought I'll ask myself in case that someone ever did such a battle system that could
give me some infos about the procedure. Most of all since we already have the version 1.5.2
now and time has passed since then when 1.4 was totally new. ;)
Any infos would be greatly appreciated. :)
Thanks in advance!
#2
Also a while back I found some code done in C++ for FF sytle combat system. I dont have the link but I just kept searching for ATB systems. Active Timed Battle systems or FF combat engine.
11/12/2007 (3:49 am)
:) Look up post by Ramen-Sama he has accomplished a pretty slick turn base attack system for his project and have a few video post showing it in action. Also a while back I found some code done in C++ for FF sytle combat system. I dont have the link but I just kept searching for ATB systems. Active Timed Battle systems or FF combat engine.
#3
To Henry:
we are working on a sci fi rpg and the characters will be using melee and ranged weapons in a battle depending on the character in the players party or the npc (Boss/Monster/robot) on the other side.
The player will be able not only to use basic attacks and skills, also combos that will involve between 2 to 4 characters to go at a target. The reason I didn't wanted to have the active time base like in the FF series is because of the combos. With the active time based system would mess up the combo system since it wouldn't allow slower characters to join faster ones in a combo because of npcs that you come in between due to their speed.
That would frustrate the player instead of having fun so.... I rather want the system being the more "traditional way" (old 2d RPGs and some 3ds too). ;)
The camera will have to be tested so we can see which way would be the best since I would prefer to have the player see the character from various perspectives depending on the attack. :)
To Johnny: thanks a lot for the infos. :)
If you should find the links (I'll check myself too but just in case you are faster or so. ^^) please post them.
Thanks in advance!
11/12/2007 (4:15 am)
Cool! Thank you both so much. :)To Henry:
we are working on a sci fi rpg and the characters will be using melee and ranged weapons in a battle depending on the character in the players party or the npc (Boss/Monster/robot) on the other side.
The player will be able not only to use basic attacks and skills, also combos that will involve between 2 to 4 characters to go at a target. The reason I didn't wanted to have the active time base like in the FF series is because of the combos. With the active time based system would mess up the combo system since it wouldn't allow slower characters to join faster ones in a combo because of npcs that you come in between due to their speed.
That would frustrate the player instead of having fun so.... I rather want the system being the more "traditional way" (old 2d RPGs and some 3ds too). ;)
The camera will have to be tested so we can see which way would be the best since I would prefer to have the player see the character from various perspectives depending on the attack. :)
To Johnny: thanks a lot for the infos. :)
If you should find the links (I'll check myself too but just in case you are faster or so. ^^) please post them.
Thanks in advance!
#4
This is the FF model.. by which I mean old school FF, before active battle timers and all that crazy stuff, when it was still a standard turn-based model. This model is also basically what's used in Fallout/Fallout2.
In other words, if it's A's turn, B (friend) and Z (enemy) are near him, and you pick "do combo attack 1 with guys A and B against enemy Z," first we do (or already did to even get the option) all the checks: Is A close enough to Z? Is B close enough to A to combo attack with him? If this is okay, we have A and B run up and do their attack. Let's say they take out rocket launchers and fire at Z. Maybe for this attack, since it's a big combo, it actually consists of 4 separate attacks. Each time they fire at Z, we roll some die, check some stats, and decide if the attack hits, how much damage it does, and so on. After the 4 attacks, A and B return to their actual positions, the places on the battlefield they were when the combo attack started. During this entire sequence, no other units have moved; time only passed for A, B, and Z. A and B "moved" to carry out the attack, but it was just a show for the user -- in game terms, they didn't even move.
Turn order is likely decided by some kind of stat or D&D-like roll for initiative. You could also use some kind of "speed" stat to generate ratios of turns, like: A has 40 initiative and Z has 60. Z gets 3 turns for every 2 A gets. If a new enemy enters with initiative 400, he gets 10 turns for every 1 A gets, and clearly must be a boss or something. Slotting those bonus turns into the order fairly is somewhat complicated, but not that bad. I don't personally like this one as much as the action points setup, which gives a "fast" player more possible actions during his one turn.
Tweak the specifics to your liking; in this example, there's a range the players can move to perform actions, much like FF, but you could make it super-controlled as well, like Fallout.. allowing the player to move using "action points" and only attack when they're actually in range, assuming they have enough points left.
Now here's the pause model, very popular with computer RPGs during the era when Bioware and Black Isle were big shots.
Everything goes at real time, very much like an RTS but with a focus more on specific units and small-group tactics. The difference is that you don't actually live control them.. the game freezes every turn, you set an action for each character, and then it unfreezes long enough for them to do whatever you told them to. The action goes forward at real time, using the real game physics, but the player is micro-managing it by saying, "This turn guys A and B will run over there to flank while C and D fire at the enemies for cover. Go!" This happens, everything freezes again, and you say, "A and B toss grenades while C and D continue cover fire." Next turn it's, "everyone rushes in to finish them," though that may take more than 1 turn. This model is really cool when it works, because the player feels very effective when they can control multiple characters to perform complex simultaneous actions like the flanking scenario. When not done well, it's just annoying or confusing.
Anyway, I'm just throwing some different ideas out there. How you actually want to accomplish it is a matter of your game's style, but it's totally doable with TGE. Even with stock TGE and just the AIPlayer class, you could probably set up a working prototype using only script. It's pretty easy to get them to do simple things like go to a location, aim at something, perform an attack, play an animation, etc.
11/12/2007 (5:14 am)
I think that in this type of game you can get away with having the characters just run all over the place to get where they need to to perform an action, while noting their actual position on the battlefield (if you have that kind of movement in battle). The character can jump in to perform his combo, then return to wherever he actually is. You're basically only using their actual player physics for show.. the characters move and act like chess pieces, but when an attack is made, the guys involved act it out with full physics, sound, etc. That actually sounds more confusing than intended, so here's a more straight-forward version..This is the FF model.. by which I mean old school FF, before active battle timers and all that crazy stuff, when it was still a standard turn-based model. This model is also basically what's used in Fallout/Fallout2.
In other words, if it's A's turn, B (friend) and Z (enemy) are near him, and you pick "do combo attack 1 with guys A and B against enemy Z," first we do (or already did to even get the option) all the checks: Is A close enough to Z? Is B close enough to A to combo attack with him? If this is okay, we have A and B run up and do their attack. Let's say they take out rocket launchers and fire at Z. Maybe for this attack, since it's a big combo, it actually consists of 4 separate attacks. Each time they fire at Z, we roll some die, check some stats, and decide if the attack hits, how much damage it does, and so on. After the 4 attacks, A and B return to their actual positions, the places on the battlefield they were when the combo attack started. During this entire sequence, no other units have moved; time only passed for A, B, and Z. A and B "moved" to carry out the attack, but it was just a show for the user -- in game terms, they didn't even move.
Turn order is likely decided by some kind of stat or D&D-like roll for initiative. You could also use some kind of "speed" stat to generate ratios of turns, like: A has 40 initiative and Z has 60. Z gets 3 turns for every 2 A gets. If a new enemy enters with initiative 400, he gets 10 turns for every 1 A gets, and clearly must be a boss or something. Slotting those bonus turns into the order fairly is somewhat complicated, but not that bad. I don't personally like this one as much as the action points setup, which gives a "fast" player more possible actions during his one turn.
Tweak the specifics to your liking; in this example, there's a range the players can move to perform actions, much like FF, but you could make it super-controlled as well, like Fallout.. allowing the player to move using "action points" and only attack when they're actually in range, assuming they have enough points left.
Now here's the pause model, very popular with computer RPGs during the era when Bioware and Black Isle were big shots.
Everything goes at real time, very much like an RTS but with a focus more on specific units and small-group tactics. The difference is that you don't actually live control them.. the game freezes every turn, you set an action for each character, and then it unfreezes long enough for them to do whatever you told them to. The action goes forward at real time, using the real game physics, but the player is micro-managing it by saying, "This turn guys A and B will run over there to flank while C and D fire at the enemies for cover. Go!" This happens, everything freezes again, and you say, "A and B toss grenades while C and D continue cover fire." Next turn it's, "everyone rushes in to finish them," though that may take more than 1 turn. This model is really cool when it works, because the player feels very effective when they can control multiple characters to perform complex simultaneous actions like the flanking scenario. When not done well, it's just annoying or confusing.
Anyway, I'm just throwing some different ideas out there. How you actually want to accomplish it is a matter of your game's style, but it's totally doable with TGE. Even with stock TGE and just the AIPlayer class, you could probably set up a working prototype using only script. It's pretty easy to get them to do simple things like go to a location, aim at something, perform an attack, play an animation, etc.
#5
At least I know now that its definately duable and without huge problems.
In our case, I designed the turn based battle (we have also action based with real time movement for the story related mini games that can be partially unlocked.) like the old standards.
That means not in a strategical manner like the cool ones you posted above. I mean the typical rpg ones where every character stays on their "mark" and the animations play from there.
How far the character goes depends on the action the player chooses for the character to do.
According to that attack, the character plays a melee or a ranged animation alone or if it connects (Combo) to the attack of the other characters it makes a combo and both or 4 of them attacks depending on the animation and the type of the combo either simultanesly or first 1, 2 or 3 the others the enemy to increase damage.
Anyway, thanks a lot again for all the info, I'll repost here or write (at last! :P ) a blog I can point you to after we came that far.
In case that you are still working on your project then I wish you all the best with it!
If not and you would be interested to join a team let me know under: fm95master@hotmail.com
Another coder or two would be more than welcome in our team at the moment. :)
Take care
11/12/2007 (6:13 am)
That's indeed great news, thank you so much! :)At least I know now that its definately duable and without huge problems.
In our case, I designed the turn based battle (we have also action based with real time movement for the story related mini games that can be partially unlocked.) like the old standards.
That means not in a strategical manner like the cool ones you posted above. I mean the typical rpg ones where every character stays on their "mark" and the animations play from there.
How far the character goes depends on the action the player chooses for the character to do.
According to that attack, the character plays a melee or a ranged animation alone or if it connects (Combo) to the attack of the other characters it makes a combo and both or 4 of them attacks depending on the animation and the type of the combo either simultanesly or first 1, 2 or 3 the others the enemy to increase damage.
Anyway, thanks a lot again for all the info, I'll repost here or write (at last! :P ) a blog I can point you to after we came that far.
In case that you are still working on your project then I wish you all the best with it!
If not and you would be interested to join a team let me know under: fm95master@hotmail.com
Another coder or two would be more than welcome in our team at the moment. :)
Take care
Torque Owner Henry Todd
Atomic Walrus
Since I know nothing about how your game works, I can only give you generic information. There's no significant element you'll need to change to make a turn-based system, you just need to implement the idea of turns. If you're talking about something kind of like generic JRPG combat, then you really just need to keep track of which character's turn it is and the turn order. If it's an NPC's turn, have them take whatever action they should take immediately. If it's a player's turn, prompt them for an action and wait until they pick something (whether you want to limit turn time is a factor to consider, at least for multiplayer), then perform the action. There's no reason to actually halt the simulation between actions; the characters will just play their idle animations (much like FF) until they're told to move by your turn manager.
Depending on the style of your game, you would likely just be using your own formulas to determine hits, misses, damage, and so on, so you won't be relying on things like actually firing projectiles at other characters. You still want your characters to carry out the actions for show, so you're probably best working with simple bots, even for the player-controlled characters. This way you can have your characters move around and attack each other, even though the actual game calculations are done separately.
The main thing you'll need to do is learn how to control some AIPlayers by script to have them carry out actions, or at least play the right animations. Then you'll want to set up the actual player as a floating camera.. unless you want to actually snap to each character's perspective as its turn comes up. Actually sounds like the RTS kit might be a good base for what you're doing, as it sets up both control of multiple simple AI units and a free camera; you'd just need to add the turn system. I don't know what it's status vs. 1.5.x is, but I assume it can be made to work if it doesn't out of the box.