nthByte-LLC / iron-craft

A Spigot plugin for the German research institution, Max Planck Society. This project has been moved to GitLab as of early 2022.
2 stars 1 forks source link

Collecting Action / Inventory Trace of worker #44

Open LBrinkmann opened 2 years ago

LBrinkmann commented 2 years ago

In order to debug the feature collection we need to collect from each worker a trace of his/her actions and the inventory.

The trace should be list of timesteps. Each timestep is 0.05s. Each timestep should have the following structure:

{
"action": {
    "attack": True/False,
    "back": True/False,
    "camera": [float, float],
    "craft": one of: {crafting_table,none,planks,stick,torch},
    "equip": one of {air,iron_axe,iron_pickaxe,none,stone_axe,stone_pickaxe,wooden_axe,wooden_pickaxe},
    "forward": True/False,
    "jump": True/False,
    "left": True/False,
    "place":  one of {cobblestone,crafting_table,dirt,furnace,none,stone,torch},
    "right": True/False,
    "sneak": True/False,
    "sprint": True/False,
 }
"inventory": {
            "coal": int,
            "cobblestone": int,
            "crafting_table": int,
            "dirt": int,
            "furnace": int,
            "iron_axe": int,
            "iron_ingot": int,
            "iron_ore": int,
            "iron_pickaxe": int,
            "log": int,
            "planks": int,
            "stick": int,
            "stone": int,
            "stone_axe": int,
            "stone_pickaxe": int,
            "torch": int,
            "wooden_axe": int,
            "wooden_pickaxe": int,
    },
},
"timestep": int (number of timesteps, starting with 0 when a round is starting),

The action section does indicate weather a particular action has been used by the worker within the last timestep (i.e. within the last 0.05 second). The inventory is the current inventor at the particular time step.

The trace should be stored as a json file.

LBrinkmann commented 2 years ago

The trace should be directly derived from the game state and should NOT include any complicated logic.

If certain actions are not avaible, then the most usefull alternative should be provided.

For instance: back, forward, jump, ... can be replaced by playerLocation + playerDirection