yangyuan/hearthrock

How to collect data?

Closed this issue · 1 comments

zzk0 commented

I have a friend who plays hearthstone very well, he has reached to the top eight. So I want to collect his data, The scene passed to Python Bot has enough information to develop a bot. The main problem is how to collect data in such a form.

After some intern job in a small company, I realized that data is power. I have tried Finite Machine , but failed. Now I want to try machine learning method, but It needs data.

Sorry for my poor English, if my confused you, just tell me.

The scene passed to Python Bot:

{'Self': {'Resources': 3, 'PermanentResources': 2, 'TemporaryResources': 1, 'PowerAvailable': True, 'HasWeapon': False, 'Hero': {'RockId': 66, 'Name': '玛法里奥·怒风', 'CardId': 'HERO_06', 'Class': 5, 'Damage': 0, 'Health': 30, 'CanAttack': True, 'IsExhausted': False, 'IsQuest': False, 'IsSecret': False}, 'Power': {'RockId': 71, 'Name': '恐怖变形', 'CardId': 'AT_132_DRUID', 'Damage': 0, 'Health': 0, 'CardType': 0, 'Cost': 2, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, 'Weapon': None, 'Minions': [], 'Cards': [{'RockId': 23, 'Name': '厄运鼹鼠', 'CardId': 'LOOT_258', 'Damage': 1, 'Health': 3, 'CardType': 4, 'Cost': 1, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 22, 'Name': '团队领袖', 'CardId': 'CS2_122', 'Damage': 2, 'Health': 2, 'CardType': 4, 'Cost': 3, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 9, 'Name': '火羽精灵', 'CardId': 'UNG_809', 'Damage': 1, 'Health': 2, 'CardType': 4, 'Cost': 1, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 17, 'Name': '深蓝刃鳞龙人', 'CardId': 'ICC_029', 'Damage': 5, 'Health': 5, 'CardType': 4, 'Cost': 5, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 27, 'Name': '机械袋鼠', 'CardId': 'BOT_445', 'Damage': 1, 'Health': 1, 'CardType': 4, 'Cost': 1, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 16, 'Name': '凶恶的雏龙', 'CardId': 'UNG_075', 'Damage': 3, 'Health': 3, 'CardType': 4, 'Cost': 3, 'HasTaunt': False, 'HasCharge': False, 'Options': []}], 'Choices': []}, 'Opponent': {'Resources': 0, 'PermanentResources': 2, 'TemporaryResources': 0, 'PowerAvailable': True, 'HasWeapon': False, 'Hero': {'RockId': 68, 'Name': '雷克萨', 'CardId': 'HERO_05', 'Class': 2, 'Damage': 0, 'Health': 30, 'CanAttack': True, 'IsExhausted': False, 'IsQuest': False, 'IsSecret': False}, 'Power': {'RockId': 69, 'Name': '稳固射击', 'CardId': 'DS1h_292', 'Damage': 0, 'Health': 0, 'CardType': 0, 'Cost': 2, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, 'Weapon': None, 'Minions': [{'RockId': 57, 'Name': '血沼迅猛龙', 'CardId': 'CS2_172', 'Damage': 3, 'Health': 2, 'BaseHealth': 2, 'Race': 20, 'IsFrozen': False, 'IsExhausted': True, 'IsAsleep': False, 'IsStealthed': False, 'CanAttack': True, 'CanBeAttacked': True, 'HasTaunt': False, 'HasWindfury': False, 'HasDivineShield': False, 'HasAura': False, 'IsEnraged': False, 'HasTriggerVisual': False, 'HasInspire': False, 'HasDeathrattle': False, 'HasBattlecry': False, 'HasLifesteal': False, 'IsPoisonous': False}], 'Cards': [{'RockId': 52, 'Name': 'UNKNOWN ENTITY [cardType=INVALID]', 'CardId': '', 'Damage': 0, 'Health': 0, 'CardType': 0, 'Cost': 0, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 49, 'Name': 'UNKNOWN ENTITY [cardType=INVALID]', 'CardId': '', 'Damage': 0, 'Health': 0, 'CardType': 0, 'Cost': 0, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 54, 'Name': 'UNKNOWN ENTITY [cardType=INVALID]', 'CardId': '', 'Damage': 0, 'Health': 0, 'CardType': 0, 'Cost': 0, 'HasTaunt': False, 'HasCharge': False, 'Options': []}, {'RockId': 65, 'Name': 'UNKNOWN ENTITY [cardType=INVALID]', 'CardId': '', 'Damage': 0, 'Health': 0, 'CardType': 0, 'Cost': 0, 'HasTaunt': False, 'HasCharge': False, 'Options': []}], 'Choices': []}, 'Turn': 4, 'PlayOptions': [[23], [22], [9], [27], [16], [71]], 'ActionId': 2, 'SessionId': '916e4067-25e6-4cef-815b-890dfc4703a1'}

Data is, for sure, hard to get.
Depends on the method you choose, there are multiple options (and none of them is easy).

  • If you plan to score a scene and apply things like reinforcement learning, you can just collect the data on the fly.
  • If you wants to apply things like deep learning, you probably cannot use this project to collect data. You might need to get the dataset(s) first and check if they are compatible with this project.
  • I also heard that someone use third-party software to save replays and programmatically convert to something compatible with this project, but I don't know which software.

I'll close this as this is beyond the scope of the project.