Giter VIP home page Giter VIP logo

hsdeckideas's Introduction

Hearthstone Deck Ideas

Description

Hearthstone Deck Ideas is a random deck generator for Hearthstone built with React. It's a hobby project that helps me put into practice what I learn about JavaScript and React. I also use it as an excuse to play Hearthstone while "testing" new features on the ladder.

Visit the live application

Live Demo

How it works

The algorithm selects a card as a starting point and then adds cards that work well with the starting card. Then does the same thing for each of the added cards. Think of it as a tree. If the added cards don't have any requirements (i call them priorities) the algorithm selects a different card with priorities and then repeats the process. At some point the app tries to figure out what type of deck (archetype) we have so far in order to add some critical cards for that archetype. If the deck is still not complete, we add completely random good cards until is full. Also note that we always try to select the best card available to make the deck as competitive as possible. Hearthstone can be really frustrating when you lose.

Run it locally

  • You'll need Git and Node.js.
  • Open you favorite terminal.
  • Clone the repository into your machine git clone https://github.com/MarkosKon/hsdeckideas.git It may take a while because of the images.
  • cd into the directory cd hsdeckideas
  • Install dependencies and start the application yarn install && yarn start
  • Run tests yarn test

hsdeckideas's People

Contributors

markoskon avatar dependabot[bot] avatar

Stargazers

 avatar Frans Twisk avatar

Watchers

James Cloos avatar  avatar

Forkers

jodeciii

hsdeckideas's Issues

Add state / side-effect hooks

Pros:

  1. practice hooks
  2. cleaner code
  3. maybe fix some bugs or remove unnecessary state / side effects.

Cons:

  1. Introduce new bugs and performance issues? (hope not)

Setup mdx for docs.

Improve the developer experience while writing help/info pages by adding support for mdx for just markdown.

Setup type checking

Setup type checking with flow or typescript. After that you can remove some type-related unit tests.

Refactor react code in Filters/Home components

The state in those components is a mess.

  • "hide" some the input state inside the input and only keep the state we need. For example, we only need the interestingCards in Home not selectInterestingCards.
  • make some state global with context/reducer hooks or redux.

Fix linting errors

Fix linting errors and setup a pre-commit hook with husky and lint-staged.

Sorry to bother in case I'm bothering, but I would like to ask.

Hello, I hope I'm not bothering you, markoskon. Actually, I've never opened an issue on GitHub before. I'm not familiar with programming, I've only dabbled with Python a bit, but would it be very difficult to update this code with the cards and new expansions of Hearthstone, markos?

I really enjoyed the program and tested it with some wild decks. Anyway, I appreciate the availability of the tool.

Algorithm improvement

Instead of only trying to add cards in the tree format, at some point stop and analyze the existing deck and add cards that their priorities are already satisfied in a good percentage.

Do the opposite in other words of what we're doing with the tree and something similar of what we're doing with the archetype priorities.

In order to choose a card we may have to calculate a score that will result from the card rating, the percentage of the satisfied priorites and the total cards needed for that priority.

If that works well, we could even try to remove the archetype priorities from the algorithm or at least give the user a choice.

Choose relevant archetype based on a score not only on card count

Based on this comment:

Problem

When we decide for an archetype we check each of archetype's priorities that are satisfied by the deck and we sum them up.

For example for the following Druid deck:

x2 The Forest's Aid
x2 Mecharoo
x2 Acornbearer
x2 Savage Roar
x2 Defender of Argus
x2 Crystal Power
x2 Wrath
x2 Power of the Wild

x1 Violet Teacher
x1 Zilliax
x1 Cenarius

We have for the Control Archetype 22 cards that are satisfied:

aoe: 0
hard removal: 0
small removal: 4
value: 3
card draw: 2
heal: 2
cost is 2: 5 (They are 6 but we only need 5)
cost is 3: 2
cost is 4: 3
cost is 5: 1

and for flood the total count is 16.
Seeing the cards one would expect that this deck would get label as flood not control.

Solution

A solution is to flag some priorities as important and double their score. For example for the control archetype we have 11 important (aoe, hard/small removal, value, card draw, heal) and 11 that are related to the mana curve.

Setup CI

Setup CI with Travis at some point because why not.

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.