OpenWorld ~ Loading OpenWorld Attributes from WDL - uchicago-cs/chiventure GitHub Wiki

Loading OpenWorld from WDL

Note: This feature is currently in the design stage.

This page contains information of the WDL format for "Openworld" related attributes.

The following fields are slated to be supported:

"Itemspecs":

These are the specifications for items that may spawn within a room. It is formatted as a list of individual itemspec objects, which contain the following attributes: "name" (name of the item), "spawnchance" (the chance that the item spawns), "min" & "max" (the minimum and maximum number of items of that type that can spawn in the room), "hash_handle" (the hash_handle for the item).

"Roomspecs":

This contains a list of individual specifications per each room. It contains the following attributes: "room_name" (name of the room), "short_desc"/"long_desc" (a short and long description of the room), "num_rooms" (the number of rooms of the same type that have already spawned), "items" (a list of items in the room), hash_handle (hash handle for the list of roomspecs).

"Gencontext":

"Gencontext" contains information about the game context of a given room. Its attributes include the following: "open_paths" (paths by the room which are open), "num_open_paths" (the number of open paths available), "level" (the level associated with the room), "hash_handle" (the hash handle for the Gencontext).

"Roomlevel":

"Roomlevel" contains more information related to the level of each room (beyond what is given by "Gencontext") It contains the following attributes: "room_name" (name of the room), difficulty (difficulty level of the room), "hash_handle" (the hash handle for the "Roomlevel" struct).

"Levelspec":

This object contains all of the information necessary for level oriented room generation. It contains the following attributes: "num_thresholds" the number of total thresholds, "thresholds" (a list of player thresholds).

Example WDL File for OpenWorld module

{
  "OPENWORLD": {
    "Itemspecs": [
      {
        "name": "ITEMSPEC1",
        "spawnchance": 0,
        "min": 0,
        "max": 0,
        "hash_handle": 0
      },
      {"...": "..."},
      {"...": "..."},
      {"...": "..."}
    ],
    "Roomspecs": [
      {
        "room_name": "room1",
        "short_desc": "room1 short",
        "long_desc": "room1 long",
        "num_rooms": 0,
        "items": ["item1", "item2", "item3"],
        "hash_handle": 0
      },
      {"...": "..."},
      {"...": "..."},
      {"...": "..."}
    ],
    "Gencontext": 
      {"open_paths": "_",
      "num_open_paths": 0,
      "level": 0,
      "hash_handle": 0
      },
    "Roomlevel": [
      {
        "room_name": "room1",
        "difficulty": 0,
        "hash_handle": 0
      },
      {"...": "..."},
      {"...": "..."},
      {"...": "..."}
    ],
    "Levelspec": {
      "num_thresholds": 0,
      "thresholds": [0,2, 3, 4]
    }
  }
}