View on GitHub

MafiaManager

A data managing software to create characters for the popular game Mafia

MafiaML

MafiaManager provides the definition of MafiaML, an XML datastructure in which characters, items and events for the popular roleplaying game Mafia can be defined. This provides a unified XML standard for sharing Mafia decks among computers. The standard will be introduced in the following sections:

Gameset

MafiaML defines a gameset to include the following attributes:

<gameset gamesetid="56c7af97-9e68-4980-95d9-433933ff2326" title="Mafia"
fromPlayers="0" toPlayers="0" img="de_mafia" backimg="back">
    <introtext introtitle="Beginning of the night">The night falls.
    All players go to sleep.</introtext>
    <outrotext outrotitle="End of the night">A new day begins</outrotext>
</gameset>

The purpose of a gameset description is to describe metainformation about the set of cards being used and might be expanded in the future.

Groups

Every game of mafia consists of at least two factions which are eager to win the game. Usually those factions consist of at least the Mafiosi and the Citizens. In MafiaML, the following information about factions in the game are defined:

     <group name="Mafiosi" gid="M" id="7000902e-499c-489c-a3c5-6a3dcd3ca621"
     icon="5e59e8af-709a-4ccd-be47-da2d8d32cc18" canwin="true" dietogether="false">
        <description>The Mafiosi win the game by killing all non-Mafiosi.</description>
    </group>

Character Definition

A character in a Mafia gameset defines the role of a player in the game. Roles may or may not be called at different times during the game to execute specific abilities in order to influence the flow of the game for their own or their groups interests. New character roles are defined frequently by online Mafia communities. It is therefore important to extract key attributes which many characters have in common in order to express as many characters definitions as possible in MafiaML. In its current version the following attributes have been defined:

    <Karte cardid="87d0cb39-fd39-455a-9a85-2912f52addb4" name="Barkeeper" 
    group="M" round="0" img=" " minamount="1" maxamount="1" position="2" 
    position2="-1" extra="0" fixeddeath="0" nopoints="false" calleveryone="false"
    winsalone="false" winningalive="2" winningdead="1" balance="0">
<description>The barkeeper can once prohibit an ability to be executed during the night.
He wins along with the Mafiosi.</description>
</Karte>

Abilities

Abilities can by used by characters in the game in order to influence the game for their interest. Abilities are subject to specific constraints, e.g. a limit amount of uses, a specific round to use the ability, or a force to use abilities on several time occasions. In the current version of MafiaML the following attributes have been defined:

Choose victim
### Actions
Actions are hints for the game master to explain his role when an ability is executed during the game. The gamemaster often needs to keep track of various things during the game and is often the cause of criticism if important aspects of the game have been forgotten.
In the current version of MafiaML the following attributes have been defined:
- id: An id for the action
- position: The position of the action to be executed
- round: The round in which this action is executed (0=every round)
- ondead: Indicates if the action is to be executed when the character dies
- title: The title of the action
- gamemaster: The action of the gamemaster to be taken during execution of the ability
- player: The action the player needs to do in order to execute the ability

```xml
    <actions>
        <action id="1"  position="2" round="0" ondead="false" title="Choose victim">
            <gamemaster>Note the character which cannot perform actions during the night.</gamemaster>
            <player>Point out the victim</player>
        </action>
    </actions>

Items

Items can be used by players of the game in order to gain privileges during the game. In essence items grant abilities temporarily or non-temporarily to characters and may or may not be unusable after their usage.

  <item id="1" name="Hauptmannsorden">
  <description>Der Hauptmannsorden wird nach 
  durchgeführter Wahl an den Hauptmann übergeben.</description>
  </item>

Events

An event in Mafia occurs after a night has been terminated. It has a temporary of permanet effect on certain aspects of the game. Depending on the agreed rules, events occur at random or at the gamemasters’ choice.