You are viewing the MafiaScum.net Wiki. To play the game, visit the forum.

Serial Night Action Resolution Framework

From MafiaWiki
Jump to: navigation, search
Type:
Author:

Serial Night Action Resolution Framework (SNARF) is a system of resolving night actions designed by Kagami.

This framework is designed to formalize the system already used by many mods as an alternative to NAR and to make it more transparent to both the players and mods. It also eliminates ambiguity by providing a mechanical basis for action resolution.

This article is a work in progress.

The Golden Rule

All night actions have an "order" value in square brackets [] that determines in what order they are resolved. Actions are resolved from lowest value to highest value. Actions of the same order occur simultaneously and independently.

Standardization of Priority

While a mod could choose any arbitrary set of order values for their night actions, doing so may inform players of how many actions are in the game and could make it impossible for players to fake-claim night action. Best practice is to determine order values relative to the guidelines below.

Standard Priorities
Order Value Action Category
0 Beginning of the Night
20 Redirection effects
40 Blocking/Commuting effects
60 Protection effects
80 Killing effects
100 Investigation effects
200 End of the Night

Almost all Normal roles can be represented using only these recommended values.

Simultaneous Action

If two actions are of the same order (often in the case of two instances of the exact same action), they are resolved simultaneously and independently. This means that each action behaves as if the others don't exist.

Example: a roleblocker [40] targets another roleblocker (also [40]) who targets a doctor [60]. In NAR, the first roleblocker in the chain would successfully block the second roleblocker, who would then fail to block the doctor. In SNARF, both roleblocks occur simultaneously, and are thus unable to influence each other. As a result, the second roleblocker would successfully block the doctor.

Note, however, that the first roleblockers action was successful, though it had no bearing on the end result. If the second roleblocker also performed another action of higher order, such as a Night Kill, that action would fail.

Non-standard Orders

While it is often possible to use only standard orders, it may be necessary to use non-standard orders. Non-standard orders are also recommended in cases where the result is identical if everything resolves simultaneously, but it eases understanding to use a different value. E.g. in a setup with both a commuter and a roleblocker, the mod may choose to give the commute an order slightly lower than 40 to make it clear that the commute will succeed even if the player is roleblocked.

Best practice is to use differences of 5 to indicate "slightly" below or above the standard, and differences of 10 when an action goes "in between" two standard values. In the prior example, the commute would have order 35 to indicate it occurs just before roleblocking.

In closed setups with unusual roles, mods should keep in mind how they would want their roles to interact with normal roles, and place them accordingly even if the normal roles don't exist in the game.


Special Rules/Definitions

The following rules cover specific features of the framework in a mechanical fashion. Understanding these rules may be necessary to resolve certain more unusual cases, but for most situations the results of these rules should coincide with the mod's and players' intuition.

States

Many actions and passive abilities have effects that last throughout the night. Each such ability creates a "state." These states may influence subsequent actions, but will not influence actions that took place before the state came into effect.

Example: The action of a Doctor generates the state "Attempts to kill target player will fail until the end of the night." The Bulletproof passive generates an identical state, though it does so with order 0.

Beginning and End of the Night

The beginning of the night is a special event that occurs as soon as the lynch results are posted unless otherwise specified in the setup rules. All actions with order 0 and most passives will begin to take effect at this time. Any action with order 1 or greater will be evaluated during action resolution just before the End of the Night.

The End of the Night occurs immediately after action resolution, and marks the time at which most night actions' results are announced or reported and at which most states come to an end. Actions with order 200 (or greater) will occur immediately after results are reported and the new day is announced.

Day Abilities

Day actions will resolve as soon as they are submitted, unless otherwise specified. Day abilities will come into effect after the End of the Night, or at the beginning of the game, and terminate just prior to the Beginning of the Night.

Passive Abilities

Passive abilities may include [passive] in the role PM for clarity, but that is not required. Any ability without an order value is a passive ability. Passive abilities generate a state at order 0 (at the Beginning of the Night).

Failure/Success

The key word "fail" indicates that the failed action does not occur. Failed actions generally do not target, since the targeting sub-action should typically also fail. An action that does not fail succeeds and is labeled "Successful." If an action would fail because of some state, but a higher order state exists that would cause it to instead succeed, the action will succeed.

Reporting/Announcing

The key word "report" is shorthand for receiving a PM from the mod containing some information. Unless otherwise specified, reporting occurs at the End of the Night.

"Announcing" indicates that the mod posts information in the main game thread.

Instant

The key word "instant" means that an ability does not follow the typical SNARF rules. It instead occurs whenever the player submits the action to the mod. Instant actions still occur after the Beginning of the Night, and thus can interact with passive abilities.

Tonight

The key word "tonight" is shorthand indicating that the state generated by this ability expires at the End of the Night.

Triggered Actions

Unless otherwise specified, a triggered action will occur immediately after the resolution of the action that triggers it. If multiple actions are triggered by simultaneous actions, the triggered actions also occur simultaneously.

Compound Actions

Some actions may be composed of multiple sub-actions which have different order values. In these cases, each sub-action is treated as if they were separate actions in the resolution queue. If the sub-actions share a target, then the player targeted is only considered to have been targeted once, and the targeting occurs relative to the lowest ordered sub-action.

Example: some mods choose to consider Jailkeeper as a compound action, identical to performing both a roleblock and a doctor action on a single target. In this interpretation, if a jailkeeper is roleblocked, the jailkeeper will successfully roleblock his target, but fail to protect him.

Targeting and Choosing

Targeting is a special mechanic that is featured in many night actions. When a player submits an action that calls for a target, that player must submit the name of a player who is a valid recipient of the action, to the best knowledge of the player performing the action. All targeted actions are functionally compound actions, where the "targeting" sub-action occurs infinitesimally prior to the main actions resolution. As a result, actions that are triggered by the targeting sub-action will occur before the resolution of the initial action.

Example: if a Doctor performs a protective action on a player who reflexively commits suicide, the suicide attempt is triggered prior to the resolution of the doctor action, and thus the player dies.

In some cases, it may be desirable to select players without targeting them (typically to avoid confusing situations with trackers). In this case, the term "choose" should be used instead of "target." Choosing player(s) is functionally identical to targeting, but does not interact with actions that specifically refer to targeting.

Example: in Tales of You, AngryPigeon fakeclaimed an action in which he selected three players, and the scumteam chose one of them, for whom he'd get a cop investigation result. In SNARF, the action would be worded something like: "Choose three players, the mafia will choose one player among them whom you will target. Target player's alignment will be reported to you at the End of the Night." If this player were tracked, the tracker would only be told that he visited the targeted player, and not the other two players.

Invalid Targets

While players should not be permitted to knowingly choose an invalid target, it may be the case that a target is invalid without that player knowing he is, or he may become invalid through the resolution of lower order actions. In these cases, the action fails. This may often occur in the case where the target needs to be alive, but is killed that night prior to the action resolving, or if an action cannot self-target, but is redirected to oneself. If the action text specifies an alternative resolution in the case that the target becomes invalid, the action does not fail and instead the alternative resolution occurs.

If the action calls for a target, but the result of the targeting sub-action results in more or fewer targets than the action intended, the action also fails as if the target were invalid.

Being Dead

Unless otherwise specified in the action text, a player being killed on the night that he/she submits an action will not prevent the action from succeeding, even if the action is of higher order than the kill.

Failsafe Rules

The following rules should only be relevant if the setup designer chooses to use poor wording in ability text and/or poor choices for order values. Nevertheless, how these instances should be resolved is outline here for completeness.

Contradictory Non-simultaneous States

If two states contradict each other directly, the newest one takes precedence. Usually, this can be avoided by choosing less ambiguous wording within the ability texts.

Example: A vanillaiser has the following ability "Vanillaize [40]: target player is a Vanilla Townie," while an inventor has the following ability "Give Gun [90]: target player is a one-shot Vigilante." If they target the same player, that player becomes a one-shot vigilante because the "Give Gun" ability happens later. This contradiction would be easily avoided by using "becomes" instead of "is," or by changing the vanillaize text to "Target player loses all active and passive abilities," which is much clearer.

One notable case where it's not poor form to have contradictory states is the strongman ability, which should have text like "When you target a player with a night kill, it cannot fail." It's well understood how strongman works, and would mean a lot of excessive text to deal with the contradiction otherwise. Note that the text specified works because it sets up a trigger that occurs just prior to the resolution of the kill, and thus it will always be the newest state at the time of the kill.

Contradictory Simultaneous States

In the event where the mod really screwed up and put two directly contradictory states into effect simultaneously, a shrodinger's cat mechanic takes place. All actions that would interact with the contradictory states "splits" and interacts independently with each contradictory state as if there were two instances of the action. If both the split actions are unaffected by the contradictory states, they rejoin into a single action. Otherwise, they proceed as if two actions had been performed. This calls for examples.

Example: Two bus-drivers have the ability "Choose two players, attempts to target the first player instead target the second player and vice versa." One bus driver targets Alice and Bob, the other targets Bob and Carol. The mafia chooses to kill Bob. A contradictory state has been established where actions targeting Bob instead target Alice and actions target Bob instead target Carol. The targeting sub-action of the mafia Night Kill interacts with this contradiction and splits, with one branch resulting in a target of Alice, while the other results in a target of Carol. Thus, the night kill has two targets when it expects one target, and fails.

If the mod really wants two bus drivers, best practice would be to give one higher order than the other, to adjust the wording of the ability in a way that avoids such contradiction, or to make the ability fail if either player is chosen by another busdriver.

Example: A player is simultaneous targeted with two effects: "Attempts to kill target player will fail" and "Attempt to kill target player will succeed." If that player is targeted with a kill, the kill action will split. One branch of the kill will fail, the other will succeed. As a result, the player dies.

Infinite Loops

Poorly designed abilities, especially triggered abilities, may result in infinite loops. In most cases where this might occur, the actual number of times the looping actions occur doesn't substantively affect the gamestate beyond a certain number. In such a case, the loop should be terminated at whatever point further iteration no longer makes a difference.

Example: Two players have the ability "Reflexive Fruit Vending: When you are targeted with an action, target the player who is targeting you. Target player will be told that you sold them fruit at the End of the Night." If one of these players also has another ability that can target, and targets the other player, they would infinitely reflexively vend fruit to each other. Each reflexive vending beyond the first is irrelevant, however, so the loop would be terminated after each player has vended one fruit.

A safer implementation of this ability would be to remove the triggered aspect, "Compulsive Fruit Vending [110]: Each night, you target all players who targeted you. Target players will be told that you sold them fruit at the End of the Night." Another implementation could simply make the fruit vending non-targeted, though that would make the role behave differently if there is a tracker in the game.

In the case where there is no point at which further iteration does not matter, whichever ability is the last unique ability in the loop simply fails that night. This is basically the rules throwing their hands up in the air because the setup must contain a critical bug.

Example: One player has the Reflexive Fruit Vendor ability above, the other has "Reflexive Money Giving: When you are targeted with an action, target the player who is targeting you. Target player gets 1 dollar." [assume dollars are something that is relevant to the game, and getting more always makes a difference]. If the fruit vendor targets the money giver with another ability, the fruit vendor's reflexive ability will fail; he will receive only 1 dollar and not vend any fruit. If the money giver targets the fruit vendor, the money giving will fail and the vending will succeed.

Sample Normal Role PMs

Scum Factional Kill

Kill[80]: Each night you may target a player, target player will die. Only one player in your faction may perform this action tonight.

Cop

Investigate [100]: Each night you may target a player, target player's alignment will be reported to you at the End of the Night.

Doctor

Protect [60]: Each night you may target a player, attempts to kill target player tonight will fail.

Vigilante

Kill [80]: Each night you may target a player, target player will die.

Roleblocker

Kill [40]: Each night you may target a player, actions performed by target player will fail.

Mason

Informed: You know that XXX is aligned with the Town. Communication [passive]: At night you may talk <here>.

Innocent Child

Innocent: At the beginning of the game, your alignment will be announced. or Innocent [day, instant]: At any time, you may PM the mod. At this time, your alignment will be announced.

Jailkeeper

Jail [45]: Each night you may target a player. Actions performed by target player will fail. Attempts to kill target player tonight will fail.

or

Jail [compound]: Each night you may target a player. [40] Actions performed by target player will fail. [60] Attempts to kill target player tonight will fail.

or

Jail [40]: Each night you may target a player. Actions performed by target player will fail. Attempts to kill target player tonight will fail.

The first version is recommended.

Tracker

Investigate [100]: Each night you may target a player. At the End of the Night, the names of all players targeted by that player will reported to you.

Watcher

Investigate [100]: Each night you may target a player. At the End of the Night, the names of all players targeted by that player will reported to you.

Gunsmith

Investigate [100]: Each night you may target a player. Whether or not that player possesses a gun will be reported to you at the End of the Night. Normal roles which possess guns are: all Mafia, Cops, Gunsmiths, Vigilantes, and any Jack-of-All-Trades that can kill.

Miller

Guilty [passive]: When an investigation on you would report that you are town-aligned, it instead reports that you are Mafia-aligned.

Bodyguard

Protect [60]: Each night you may target a player. When target player is targeted with a killing action, that action targets you instead.

Role Cop

Investigate [100]: Each night you may target a player. Target player's non-factional abilities will be reported to you at the End of the Night.

Doublevoter

Doublevoting [day, passive]: Your vote counts as two votes toward a lynch.

Commuter

Commute [35]: Each night you may use this ability. Attempts to target you tonight will fail.

Hider

Commute [30]: Each night you may target a player. If target player is not town-aligned you die. If target player dies tonight, you die. Attempts to target you tonight will fail.