gambitproject / gte

Game Theory Explorer: Build, explore and solve extensive form games.
GNU General Public License v3.0
86 stars 40 forks source link

File format for storing games #8

Open stengel opened 10 years ago

stengel commented 10 years ago

A new XML format for saving games, otherwise we have three formats floating around. The main thing to change is to have a playerId 0,1,2 (or more if we have >2 players) stored with the player's NODE rather than the player name. In the game tree, player are DISPLAYED by their names. These are set at the beginning (if not, "1" and "2" as default names). Here we CURRENTLY HAVE

<players>
    <player playerId="1">1</player>
    <player playerId="2">2</player>
</players>

and it SHOULD BECOME (in order not to overload "player")

<players>
    <playername player="1">Alice</playername>
    <playername player="2">Bob</playername>
</players>

and in the rest of the data the only reference to a player for a node is via player, not the name of the player. This is how the game tree is logically processed. Example:

<node iset="2" player="2" prob="1/2">
      <outcome move="l">
        <payoff player="1">5</payoff>
        <payoff player="2">2</payoff>
      </outcome>
      <outcome move="r">
        <payoff player="1">3</payoff>
        <payoff player="2">1</payoff>
      </outcome>
    </node>

Player names are irrelevant for the algorithms.

Whenever we refer to a player in the FILE, it should only be via the player NUMBER which is 0 for chance 1 for player 1 2 for player 2 3 for player 3 etc. once more than 2 players are implemented.

This player number is what is used when assigning players to nodes and payoffs. Examples:

 <node player="1" prob="1/2">
    <outcome move="A">
      <payoff player="1">0</payoff>
      <payoff player="2">0</payoff>
    </outcome>
stengel commented 10 years ago

tried to implement but xml storage of game is used at other places (and re-loaded!) which creates a bug of empty strategic form when saving and other problems. Format change does work well for extensive form. See XMLExporter.as and XMLImporter.as locally on Bernhard's system