In what order are multiple Djinn swaps resolved in?

In some games of Werewolv.es, there can be multiple Djinn roles within a Coven faction.

Sometimes in an attempt to increase confusion, the Djinns will both end up having the same person as one of their targets (so that they get swapped twice), but it's not clear what order these swaps actually happen in.

I've seen people assume that the swap order is based on the order the swaps were activated (A queue of swaps as it were) and that it was the opposite (A stack of swaps) - but it doesn't seem to always work out that way.


Solution 1:

This was recently discussed at the werewolv.es in person meetup.

The Djinn is a special role, that historically was a "One-Of" role (eg, like PuppetMaster or VoodooDoctor) and doesn't make any "visits" when it performs it's swaps.

When the swaps are recorded, they are stored "With the Role" and not recorded as normal NightTarget visits.

At day break when the swaps occur, the game iterates over the known roles and performs these special visits (Djinn Swaps).

As such, The swaps happen in the order the Djinns were assigned their roles - so based on the order of the "I am a Djinn" messages at the start of the game.

This also impacts players who are Transmuted into Djinns, or Drunks who are sobered up into Djinns, the order that these events happened is important.

Solution 2:

After further investigation into this, @Shane Mc Cormack's answer isn't quite the full story...

It's true that the swaps would be resolved in the same order as the "I am a Djinn" messages that the Coven receive at the start of the game, but it is not because of the order that the Djinn was assigned, but because of the order of the players joining the game.

When roles are distributed, all of the roles for the setup are put together, randomised and then distributed to players in the order that they joined the game.

When night ends, each player's EndNight trigger is called ,in the order that they joined the game. This is the trigger that initiates the Djinn swaps.

So to clarify about Djinns assigned after transmutes, you would be able to work out the order they occur based on the "I am a XYZ" in the opening Coven text.

This known ordering of player actions is probably undesirable, and I may look into a better way of determining the resolution of such actions, it will require discussion with the community to decide on the best I action I feel.