GithubHelp home page GithubHelp logo

utilforever / rosettastone Goto Github PK

View Code? Open in Web Editor NEW
643.0 22.0 78.0 62.49 MB

Hearthstone simulator using C++ with some reinforcement learning

Home Page: https://utilforever.github.io/RosettaStone/

License: GNU Affero General Public License v3.0

C++ 98.75% CMake 0.18% Python 0.31% CSS 0.11% JavaScript 0.62% HTML 0.03% Dockerfile 0.01%
hearthstone reinforcement-learning cpp17 hearthstone-api rl rl-environment cpp cplusplus python-api simulator-game

rosettastone's Introduction

RosettaStone

License Windows Ubuntu macOS Discord

codecov Codacy Badge CodeFactor

Quality Gate Status Lines of Code Maintainability Rating Reliability Rating Security Rating

RosettaStone is Hearthstone simulator using C++ with some reinforcement learning. The code is built on C++17 and can be compiled with commonly available compilers such as g++, clang++, or Microsoft Visual Studio. RosettaStone currently supports macOS (10.14 or later), Ubuntu (18.04 or later), Windows (Visual Studio 2017 or later), and Windows Subsystem for Linux (WSL). Other untested platforms that support C++17 also should be able to build RosettaStone.

Related Repositories

Key Features

  • C++17 based Hearthstone library
  • Console and GUI simulator program
  • C++ and Python API

To-do Features

  • Upgrade "The Innkeeper" to smart
  • Recommend top-tier decks
  • Deck tracker
  • Web simulator

Cards Implementation

Standard Format

  • 98% Core Set (247 of 250 cards)
  • 81% Forged in the Barrens (139 of 170 cards)
  • 35% United in Stormwind (60 of 170 cards)
  • 35% Fractured in Alterac Valley (61 of 170 cards)
  • 12% Voyage to the Sunken City (22 of 170 cards)
  • 10% Murder at Castle Nathria (17 of 170 cards)
  • 0% March of the Lich King (0 of 1 cards)

Wild Format

  • 100% Legacy (167 of 167 Cards)
  • 100% Expert1 (245 of 245 Cards)
  • 100% Demon Hunter Initiate (20 of 20 Cards)
  • 100% Curse of Naxxramas (30 of 30 Cards)
  • 6% Goblins vs Gnomes (8 of 123 Cards)
  • 100% Blackrock Mountain (31 of 31 Cards)
  • 8% The Grand Tournament (11 of 132 Cards)
  • 100% The League of Explorers (45 of 45 Cards)
  • 5% Whispers of the Old Gods (8 of 134 Cards)
  • 100% One Night in Karazhan (45 of 45 Cards)
  • 2% Mean Streets of Gadgetzan (3 of 132 Cards)
  • 7% Journey to Un'Goro (10 of 135 Cards)
  • 4% Knights of the Frozen Throne (6 of 135 Cards)
  • 5% Kobolds & Catacombs (7 of 135 Cards)
  • 5% The Witchwood (8 of 135 Cards)
  • 2% The Boomsday Project (4 of 136 Cards)
  • 5% Rastakhan's Rumble (7 of 135 Cards)
  • 100% Rise of Shadows (136 of 136 cards)
  • 99% Saviors of Uldum (134 of 135 cards)
    • Except 'Zephrys the Great' (ULD_003)
  • 100% Descent of Dragons (140 of 140 cards)
  • 60% Galakrond's Awakening (21 of 35 cards)
  • 60% Ashes of Outland (82 of 135 cards)
  • 57% Scholomance Academy (78 of 135 cards)
  • 46% Madness at the Darkmoon Faire (79 of 170 cards)

Classic Format

  • 100% Vanilla Set (382 of 382 Cards)

Implementation List

Quick Start

You will need CMake to build the code. If you're using Windows, you need Visual Studio 2017 in addition to CMake.

First, clone the code:

git clone https://github.com/utilForever/RosettaStone.git --recursive
cd RosettaStone

Python API

Build and install the package by running

pip install -U .

NOTE: We are making Python API and related examples.

C++ API

For macOS or Linux or Windows Subsystem for Linux (WSL):

mkdir build
cd build
cmake ..
make

For Windows:

mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64"
MSBuild RosettaStone.sln /p:Configuration=Release

Now run console simulator:

bin/RosettaConsole

NOTE: To run GUI simulator, please check out RosettaStone GUI.

Docker

docker pull utilforever/rosettastone:latest

Now run console simulator:

docker run -it utilforever/rosettastone
[inside docker container]
/app/build/bin/RosettaConsole

More Instructions of Building the Code

To learn how to build, test, and install the SDK, please check out Install.md.

Documentation

All the documentations for the framework can be found from the project website incluing the API reference.

Presentations

Videos

Sprints

Articles

How To Contribute

Contributions are always welcome, either reporting issues/bugs or forking the repository and then issuing pull requests when you have completed some additional coding that you feel will be beneficial to the main project. If you are interested in contributing in a more dedicated capacity, then please check out Contributing.md.

Contact

You can contact me via e-mail (utilForever at gmail.com). I am always happy to answer questions or help with any issues you might have, and please be sure to share any additional work or your creations with me, I love seeing what other people are making.

Sponsors

CppDepend

License

The class is licensed under the Affero GPLv3 License:

RosettaStone is based on part of Sabberstone's code

Copyright © 2017-2023 SabberStone Team, darkfriend77 & rnilva

RosettaStone, Hearthstone simulator using C++ with some reinforcement learning

Copyright © 2017-2023 Chris Ohk

RosettaStone is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License. RosettaStone is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

Hearthstone is an interactive game of Blizzard Entertainment, Inc and all rights reserved. Hearthstone is a registered trademark of Blizzard Entertainment, Inc. in the U.S. and/or other countries. This project is not affiliated with Blizzard Entertainment.

rosettastone's People

Contributors

1cekrim avatar 95d avatar artblnd avatar beuoon avatar cheolwanpark avatar creatorseraph avatar cyj0711 avatar doobee98 avatar frechele avatar fuzer avatar fylsunghwan avatar gitjaesik avatar goltong1 avatar hankyulhyun avatar hell0-world avatar jinddeok avatar jinhajjing avatar kozistr avatar kugorang avatar moreal avatar packkill avatar pyback avatar rayiz3 avatar revsic avatar scottsuk0306 avatar serment7 avatar sj avatar soohanbae avatar utilforever avatar yjcheon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rosettastone's Issues

Create game agent

  • Game step : /Sources/Enums/Enums.h::step
  • Implement function per game steps
  • Interact with deck agent

Apply lcov settings to generate code coverage report

This revision sets lcov to generate code coverage report.

CAUTION
lcov --directory . --capture --output-file coverage.info doesn't work. I added the compiler flag and link flag, and when I built it, the .gcno file was created, but the .gcda file was not created. It seems to be a problem caused by the updated version of gcov. (WARNING: no .gcda files found in .)

Create card search system

  • Find cards with a name
  • Find cards with an attack value
  • Find cards with a health value
  • Find cards with a mana cost
  • Find cards that you own "x" copy/copies of
  • Show all cards you have more than 2 copies of, including golden cards
  • Show only golden cards
  • Show any cards you don't have
  • Show any "New" cards in your collection
  • Implement search tag combination

GUI program

This revision implements GUI program to provide an easy-to-use environment.

  • Login
  • Main
  • Deck
  • Card
  • Game
  • Result

Implementation list for Ver 0.1

  • Read card data from cards.json
  • Parse card data to each class object
  • Create basic console simulator
  • Create basic game agent
  • Create basic card search system
  • Create show card information function
  • Create basic deck system
  • Create basic player system

Implementation list for Ver 0.2

  • Implement basic card logic
    • Aura, Enchantment & Trigger
    • Hero, Hero Power & Weapon
    • Battlecry & Deathrattle
    • Choose One & Combo
    • Spell Power
  • Separate console program code from Hearthstone++
  • Implement simple GUI program using imgui
  • Add unit tests for Hearthstone++ using googletest
  • Support CMake build system
  • Delete Visual Studio files
  • Support Windows Subsystem for Linux (WSL)

Refactor console program

This revision fixes many bugs in console program and refactor some logic to improve performance.

Refactor card structure

Current card data is taken from JSON. In games, card data is copied and used to modify it. This approach is not very readable. Therefore, I introduce a new class called Entity and try to refactor it by applying various enchants to original card data.

Basic card abilities

This revision implements basic card abilities in Hearthstone game.
This implementation will allow you to play games using original cards.

  • Battlecry
  • Card draw effect
  • Charge
  • Choose One
  • Combo
  • Deathrattle
  • Destroy
  • Discard
  • Divine Shield
  • Elusive
  • Enrage
  • Equip
  • Forgetful
  • Freeze
  • Immune
  • Poisonous
  • Put into battlefield
  • Overload
  • Restore Health
  • Return to hand
  • Secret
  • Silence
  • Spell Damage
  • Stealth
  • Summon
  • Taunt
  • Take control
  • Transform
  • Triggered effect
  • Windfury

Update data and enums for The Boomsday Project

The Boomsday Project is 's ninth . Featuring 135 new , the single-player content, and the new , the expansion was released on August 7, 2018.
Set in the shattered, otherworldly region of the in , the science-themed expansion is centered around the famous and his team of elite scientists at Boom Labs working on a mysterious top-secret project, unleashing all manner of strange experiments along the way.
The expansion introduces the , allowing a minion to merge together with another Mech, "Project" spells that benefit both players, "Omega" cards that gain additional bonuses if played while the player has 10, and spells for each of the nine classes.

Implement basic card logic

  • Aura, Enchantment & Trigger
  • Hero, Hero Power & Weapon
  • Battlecry & Deathrattle
  • Choose One & Combo
  • Spell Power

Support original cards

This revision supports original cards (Basic / Classic / Hall of Fame).

  • Basic (133 Cards)
  • Classic (239 Cards)
  • Hall of Fame (10 Cards)

Manual tests

This revision adds manual test. Manual testing is the process of manually testing software for defects. It requires a tester to play the role of an end user whereby they use most of the application's features to ensure correct behavior. To guarantee completeness of testing, the tester often follows a written test plan that leads them through a set of important test cases.

Missing variables in JSON data

We found that we didn't add a few variables in the process of analyzing JSON data.
This revision fixes missing variables in JSON data.

Rearrange folder structures

This revision rearranges folder structures to make Python API.

  • Change Includes/Core, Sources/Core to Cores

Separate Task from GameAgent

This revision separates tasks from game agent such as draw, health and mana modification. It aims to create other systems easily. Task Agent managing those task so that users just return the task vector, not care about GameAgent and managing task.

  • Tasks : Definition of Task class. It contains TaskID and return status.
  • TaskAgent : Managing task, run sequentially or handling exception.
  • TaskMeta : Definition of TaskMeta and meta data serializer.
  • BasicTasks : Basic tasks for implementing base game system, such as draw, mulligan, mana and health modification, summon and combat

Refactor Task interface

In previous work, Task interface consists of some functions returning Tasks like macro. After the last PR, we argue about the Task interface. If we want to add more tasks, then we have to implement macros, Task serializer, interface handler so on. It's too inefficient. As a result, we conclude that we need new Task interface which is simple and easy to maintain.

Update enums for Raven year

  • BlockType
  • BattleNetGameType
  • BattleNetRegion
  • Booster
  • BrawlType
  • CardClass
  • CardSet
  • CardType
  • ChoiceType
  • DeckType
  • EnchantmentVisual
  • Faction
  • FormatType
  • GameTag
  • GameType
  • GoldRewardState
  • Locale
  • MetaDataType
  • Mulligan
  • MultiClassGroup
  • OptionType
  • PlayReq
  • PlayState
  • PowerType
  • Race
  • Rarity
  • State
  • Step
  • Type
  • ZodiacYear
  • Zone
  • NumericModification
  • Action

Support CMake build system

  • Update library
    • json (version 2.1.1 -> version 3.0.0)
  • Make CMakeLists.txt
    • Hearthstonepp
    • Console
    • winix
  • Test CMake build and Console program

Add new ability keywords

  • Recruit : a card ability which summons a random minion from the player's deck.
  • Start of Game : an ability which activates at the start of the game.
  • Echo : an ability whereby the card can be played multiple times in one turn.
  • Rush : an ability allowing a minion to attack the same turn it is summoned or brought under a new player's control.

Code documentation using doxygen

Software documentation is written text or illustration that accompanies computer software or is embedded in the source code. It either explains how it operates or how to use it, and may mean different things to people in different roles. Documentation is an important part of software engineering.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.