I'm looking for a good place to start on a "Tactical" rpg turn-based system. I guess the closest thing I can compare it to is Final Fantasy Tactics.
In essence, combat works like this:
1: Combat is "entered", speed or an equivalent stat is tallied between all units participating to determine what order the units take.
2: Combat starts, and the first unit has a chance to act. If it's the player's unit, he is presented with a list of "static" options. Usually, Attack and Move are in this list. Units can generally move and attack/use an item/cast a spell on their turn. Depending on the system, units have a "Speed" attribute that determines how many tiles they can move on their turn.
3: Combat continues... Units that have attacks select "Attack" and if it happens to have a sword, for example, then he may strike any unit in a cross shaped pattern. Ex:
N = Can't attack, diagonal
+ = Player
- = Viable strike areas
N-N
-+-
N-N
Ranged attacks are done within a certain number of tiles around the unit (radius :P).
Can anyone here point me in the right direction? I've seen a handful of "Turn" systems in the demos/libs section, but I don't believe they cover this whole multiple-units-taking-different-turns-with-only-some-of-them -being-controllable thing.
Accepting any and all help!
ID:272955
Jul 1 2009, 9:53 am
|
|
In response to Garthor
|
|
hey im kinda new here and can you break it down into like an easy-to-understand version plz so i can use it in my games? Im pretty sure this is exactly waht i want
|
I've seen a handful of "Turn" systems in the demos/libs section, but I don't believe they cover this whole multiple-units-taking-different-turns-with-only-some-of-them -being-controlla ble thing.To be clear, my Turns and Phase libraries allow anything. They're just frameworks for handling turns. Who controls what is up to the developer. |
This would all likely go within a datum which would represent each fight, rather than global.
The start of a fight would be populating the actors and actionSchedule lists, by calling scheduleAction(M, 0) for each mob, in order of when you want them to take turns. Then, call advanceTheClock() to start the turn cycle.
The takeTurn() proc handles all turn-taking. For AI, it should immediately do what's needed (sleeping would be acceptable), call scheduleAction() to prepare its next action time, and then return 0. For a player, it should enable the player's actions and then return 1. Once the player takes an action, call scheduleAction() to schedule the next action, then advanceTheClock() to start the turn loop again.
It should be rather unobtrusive, so anything else you need to do should be independent of what's needed. For example, to get a circle range value, you can do this:
Range=1 would return a cross, like you want. Larger values would return more circle-ish circles (for any whole numbers, by the way, there will be "points" in the cardinal directions, but you can use decimals to smooth those). It's not the fastest algorithm, but theoretically you're not going to be calling it too often, so that's okay.