Author Topic: Simultaneous turns?  (Read 7223 times)

Ari Rahikkala

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 64
  • Karma: +0/-0
    • View Profile
    • Email
Simultaneous turns?
« on: February 28, 2012, 05:54:44 PM »
Just wondering - are there any roguelikes out there with a simultaneous turn system? Well, not a true simultaneous turn system where all actions are resolved fairly - I've seen Diplomacy's resolution rules, and trying to make even a simple game like that work with fair simultaneous turns seems to lead to horrible logical contraptions. But how about roguelikes with an initiative system? That is, every actor chooses an action and rolls initiative, and then those actions get resolved in initiative order.

As far as I can tell, the big downside is that simultaneous turns are harder to program. Instead of just changing the game state from the interface and/or AI code, you actually have to make a representation of actions and separate code to produce actions and resolve them into the game state. And since the world might have changed between when the action is selected and when it's resolved, you have to make the representation and the resolution code flexible enough that they can "guess" the "intent" of an action. For instance, if the player enters a walking action in a direction where there's currently a monster, that definitely has to be represented as a "bump this monster" rather than a "walk in this direction" action, because they mean entirely different things if the monster has moved away by the time your turn is resolved. And it's still not necessarily clear what that means either - what if the monster dies before you can attack it? What if bumping friendly monsters swaps places with them rather than attacking, and the monster becomes friendly before the player's action is resolved? What if the player in fact was expecting the monster to move away and in fact wanted to just move into that tile afterward?

The upside, though? There's a lot of interesting little things you could do with a concept of initiative and a certain sort of concept of simultaneity. You could design gameplay based on controlling initiative. Taking an earlier initiative slot could obviously have a great many uses - dodge out of the way of attacks, get to control your positioning better, hit things before they get a chance to hit you so that they don't get to hit you at all on the turn when they die, etc.. Taking a later slot probably could be useful in some cases, too, for instance for making sure that you moving next to a monster happens *after* that monster's turn so that it doesn't get a chance to hit you that turn. For that to happen there'd have to be some kind of a "reaction" mechanic so that, say, if you were just moving into a tile but a hostile monster takes the place before your action is resolved, you attack that monster instead. It would be kind of breaking the concept, but it would be interesting nonetheless if there were also a  "fast thinking" ability that could also allow the player to actually pick their actions at their time of resolution - no, I don't know how this would work if your initiative depended on what action you were actually taking.

Less importantly (but I'm mentioning it anyway since it amuses me), it would mean you could run your AIs in parallel as long as they're thread-safe and don't modify the game state. I'm pretty sure it doesn't matter for the vast majority of roguelikes, but it might be an appropriate design for the next Dwarf Fortress.

So far though I'm just curious if anyone's got experience of doing this or trying to. It seems more trouble than it's worth, but roguelikes cover a wide range of designs, so there's always a chance that someone's done it. Would be interesting to hear how it worked and try the game out.

Z

  • Rogueliker
  • ***
  • Posts: 905
  • Karma: +0/-0
    • View Profile
    • Z's Roguelike Stuff
Re: Simultaneous turns?
« Reply #1 on: February 28, 2012, 07:05:35 PM »
Regarding your initiative system: I have played an old RPG named Albion (not a roguelike of the same name) which had something like you suggest (you choose an action for every of your character at the beginning of the turn, and then they were resolved in the order of initative). I liked the game for its great story, but this combat solution was IMO a very bad one because of that initiative system. There was one weakling character, I could want him to stand in the back row and fire a gun, but this would be just a waste of ammo since he was extremely slow and the target would move before he acted. (And the game did not even let me to predict where the monster would move, as he had to target a location which contained a monster at the time of targetting.) Maybe it would be possible to think it out better, but Albion's combat system makes me doubt that your idea would play well.

So I would be more interested in true simultaneous turns. Could be a good idea for a 7DRL: the number of combat moves would be limited, so you could define all the possible interactions and program them in a reasonable way.

george

  • Rogueliker
  • ***
  • Posts: 201
  • Karma: +1/-1
    • View Profile
    • Email
Re: Simultaneous turns?
« Reply #2 on: February 29, 2012, 02:39:15 AM »
Yeah, I think the point of an initiative system is to account for non-simultaneity. If you have simultaneous turns you don't need initiative at all, just a reasonable approximation of actor speed and intent. The new tactical shooter Frozen Synapse has a pretty nice simultaneous turn system and while it probably would have to be streamlined for a roguelike I think it has some good ideas.

It's kind of counter-intuitive but I think simultaneous turns slow the game down more than normal turns.

eclectocrat

  • Rogueliker
  • ***
  • Posts: 81
  • Karma: +0/-0
  • Most of your personality is unconscious.
    • View Profile
    • Mysterious Castle
    • Email
Re: Simultaneous turns?
« Reply #3 on: February 29, 2012, 04:56:27 AM »
This reminds me of those secret card duel games, you know, where each player lays down a card and they're revealed simultaneously. There's an element of prediction and resource management to it. Could be very cool.

guest509

  • Guest
Re: Simultaneous turns?
« Reply #4 on: February 29, 2012, 01:01:39 PM »
  Best I've seen is a sort of random initiative system. So that who goes first changes each time. Not quite what you are looking for.

  Truly simultaneous systems happen in some older turn based games like Masters of Orion and Space Empires.

Brigand

  • Rogueliker
  • ***
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Re: Simultaneous turns?
« Reply #5 on: March 02, 2012, 03:42:00 PM »
If you've ever played Vandal Hearts 2 on the original Playstation, they had an interesting take on "simultaneous" turns (and I use the term a little loosely), but it might be worth taking a look. Large part of that game was anticipation of what the enemies would do, and being in the right spot - otherwise there was a lot of attacking empty air.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Simultaneous turns?
« Reply #6 on: March 03, 2012, 11:28:16 PM »
Simultaneous turn-taking and synchronous turns could be managed by making actions consume units of discrete time across multiple states.

For example, in a fighting game, each attack typically has 3 states. Draw, strike, and recover. Each takes a certain amount of time. While we're recovering or drawing we're exposed to a strike. If a strike hits a block then the opponent has to go through a certain amount of recovery (should typically be less than the attacker's, but that just depends).

We don't care about things like initiative or action order, because everyone just makes an action whenever their last action finishes (maybe previous action plays a role in what actions are available next, like in a combo- or there are opportunities to feign at specific points while an action is active- at the end of the draw step, bu we only need to stop action when the player could make a new action). Of course, tie-avoidance depends upon how discrete our units of time are- but for the sake of a turn-based game, we just automatically interpolate until a new action could take place.

Okay- I don't want to rewrite anything I just wrote, but there is absolutely no need to use discrete units of time. We can just jump to the next opportunity to make an action and 'pause' the game until the player makes a decision... nothing about this requires units of time. We just have a priority-queue where action states are placed based upon their duration- some states may effect later states and prompt for a new action (such as being interrupted). That's pretty simple to implement and should give you simultaneous turns-- that is, if you want to incorporate time in that way. It's an untraditional way to make a roguelike.
« Last Edit: March 03, 2012, 11:31:58 PM by requerent »

Xecutor

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 263
  • Karma: +0/-0
    • View Profile
Re: Simultaneous turns?
« Reply #7 on: March 04, 2012, 08:29:10 AM »
In Wizard's Quest most actions are performed after time for this action was spent.
Some actions are split into two phases. Time is spent for first phase, then action is performed, then some more time is spent before unit can schedule new action.
This way it is possible to interrupt some actions and sometimes avoid ranged attacks.
IMO this is closest approximation of simultaneous turns.
If you turn ended just a moment before enemy's action is about to be performed, there is almost nothing you can do about it,
since even in order to drink potion you need to spend time before drinking effect is applied.

Snargleplax

  • Rogueliker
  • ***
  • Posts: 50
  • Karma: +0/-0
  • snargleplax
    • View Profile
    • SnargleQuest dev log
Re: Simultaneous turns?
« Reply #8 on: March 06, 2012, 08:05:51 AM »
@requerent I like where you're going with the different phases of an action.  I could see this leading to a workable system based on rock-paper-scissor type resolution rules for attacker/defender state pairings.  If you choose a strategy that assumes you're faster than your opponent, such as exposing yourself briefly to make a quick, opportunistic strike, this can work out fine if you are in fact faster.  But if your opponent is faster, and seizes the advantage, you'll be attacked while exposed and suffer greater harm.  Similarly, if you suspect you're slower, you could play more conservatively (to avoid embarrassment and failure), deflecting your opponent's blow before striking back while he's off-balance.  The strategies chosen would determine what state each combatant is in at each phase within the turn, and resolution rules describe tactically significant game outcomes.