GithubHelp home page GithubHelp logo

hearthsim / sabberstone Goto Github PK

View Code? Open in Web Editor NEW
246.0 18.0 99.0 47.42 MB

Just another Hearthstone Simulator in C# .Net Core, with some A.I. approaches!

Home Page: https://hearthsim.info

License: GNU Affero General Public License v3.0

C# 99.95% Batchfile 0.01% ANTLR 0.05% Smalltalk 0.01%
hearthstone-simulator hearthstone

sabberstone's Introduction

SabberStone logo

                           Build status Build status master nuget license contributors

SabberStone 2.1

Massive changes and updates are applied! Please check the Changelog: https://github.com/HearthSim/SabberStone/wiki/Changelog

Overview

State of Implementation: 98% (Rise of Shadows 94%, Rastakhan's Rumble 95%, The Boomsday Project 98%, The Witchwood 99%) of current Standard Cards (Year of the Dragon)! (23.07.2019)

SabberStone is just another Hearthstone simulator and implementation, written in C#. The project was started in Nov'16 while trying to implement aura, buffs & triggers into Brimstone. Focused to prototype my so called onion system I created SabberStone, which is using a layer approach to handle entity changing enchantments. Since then I haven't stopped implementing day by day new cards, new tests and new stuff. I created for fun a visualisation and a scoring based tree search a.i. which can be used to play games (SabberStoneGui).

By now this is a one man show, but there is still a lot of work to do, so any help is appreciated. The base code of Brimstone was a great inspiration for this project. Big thanks to @Pattux, @Patashu for helping on hearthstone super science problems ^^ thx @Katy for inspiration. And thx a lot to @Citiral, @BertP for working out on the stove implementation. And thx to @Milva who did a refactoring on the aura & enchantment system, with great value and is working hard for this project! You're welcome!

If you enjoy using SabberStone consider supporting us at buymeacoffee.com/darkfriend77

Join us on Discord!

Sabberstone Simulator has an own visualisation and client/server architecture for AI research! Preview SabberStone connected to the Stove project

Project Structure

  • SabberStoneCore (.NET Core)

    Core simulator engine, all the functions needed for the simulator are in here. Check out the Wiki Link for informations about the core and how to use it.

  • SabberStoneCoreTest (.NET Core)

    UnitTest for the simulator, there is a generated test for each card in the current game.

  • SabberStoneCoreConsole (.NET Core)

    A test project to run simple codeline based games to test outcome.

  • SabberStoneBasicAI (.NET Core)

    A test project to run A.I. simulations with predefinied decks and strategys.

  • (deprectated)SabberStoneGui (.NET Framework) (This is currently reworked in a Unity3D GUI Client with a GameServer)

    A test project that shows off a visual implementation of the SimpleAi project. This is probably where beginners should start looking at. There is a simple GUI which allows different decks to play against each other with different strategys. Check out the Wiki Link for informations about the use of SimpleUi.

Extension Projects

Cards Implementation

Basic & Classic

  • 100% Basic (142 Cards)
  • 100%% Classic (245 Cards)
  • 87% Hall of Fame (24 Cards)

Adventures

  • 100% Blackrock Mountain (31 Cards)
  • 100% One Night in Karazhan (45 Cards)
  • 68% The League of Explorers (45 Cards) (needs to be upgraded to new system)

Expensions

  • 94% Rise of Shadows (136 Cards)

  • 96% Rastakhan's Rumble (135 Cards)

  • 98% The Boomsday Project (136 Cards)

  • 99% The Witchwood (129 Cards)

  • 100% Kobolds and Catacombs (135 Cards)

  • 100% Knights of the Frozen Throne (135 Cards)

  • 100% Journey to Un'Goro (135 cards)

  • 93% The Grand Tournament (132 Cards) (needs to be upgraded to new system)

  • 100% Whispers of the Old Gods (134 Cards)

  • 100% Mean Streets of Gadgetzan (132 Cards)

  • 80% Goblins vs Gnomes (123 cards)

  • 100% Curse of Naxxramas (30 cards)

Not Implemented Standard Cards

Rise of Shadows

  • [DAL_377] Nine Lives
  • [DAL_431] Swampqueen Hagatha
  • [DAL_573] Commander Rhyssa
  • [DAL_729] Madame Lazul
  • [DAL_731] Duel!
  • [DAL_742] Whirlwind Tempest
  • [DAL_800] Zayle, Shadow Cloak

Rastakhan's Rumble

  • [TRL_318] Hex Lord Malacrass
  • [TRL_345] Krag'wa, the Frog
  • [TRL_522] Wartbringer
  • [TRL_532] Mosh'Ogg Announcer
  • [TRL_535] Snapjaw Shellfighter

The Boomsday Project

  • [BOT_436] Prismatic Lens
  • [BOT_914] Whizbang the Wonderful
The Witchwood
  • [GIL_655] Festeroot Hulk

(Standard is beeing prioritized.)

Requirements

Installation

  • tbd

Documentation

  • Wiki Link
  • SabberStoneBasicAI Link
  • Unity3D GUI Client & GameServer Link

License

AGPLv3

SabberStone is licensed under the terms of the Affero GPLv3 or any later version.

Community

SabberStone is being developed by darkfriend77 ([email protected])

sabberstone's People

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

sabberstone's Issues

Could not load file or assembly System.Runtime.CompilerServices.Unsafe

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.ReadOnlySpan1..ctor(T[] array, Int32 start, Int32 length) at SabberStoneCore.Model.Zones.Zone1.GetSpan()
at SabberStoneCore.Model.Entities.Controller.Options(Boolean skipPrePhase)
at SabberStoneCoreGui.Nodes.OptionNode.Options(ConcurrentDictionary`2& optionNodes) in C:\repository\GitHub\HearthSim\SabberStone\SabberStoneGui\src\Nodes\OptionNode.cs:line 113
at SabberStoneGui.MainWindow.<>c__DisplayClass4_2.<worker_DoWork>b__5() in C:\repository\GitHub\HearthSim\SabberStone\SabberStoneGui\src\MainWindow.xaml.cs:line 82
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

=== Pre-bind state information ===
LOG: DisplayName = System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\repository\GitHub\HearthSim\SabberStone\SabberStoneGui\bin\Debug\SabberStoneGui.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe.DLL.
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe/System.Runtime.CompilerServices.Unsafe.DLL.
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe.EXE.
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe/System.Runtime.CompilerServices.Unsafe.EXE.

Cardset for the new Classic mode of Hearthstone

Hi,

I am aware that there is a new classic mode published in the Hearthstone, which allows the players to play using the cards back in 2014. This means that CORE (basic) cards, EXPERT1 (classic), and part of HOF (Hall of Fame) will be mirrored back to their original form in 2014 within the classic mode.

I want to get the cards in their form used in the classic mode for a project. I have tried to replace the CardDefs.xml under SabberStoneCore/resources/Data/CardDefs.xml with the latest version I found in the hsdata repo. Could you please tell me:

  1. if the cards in the classic mode are included in the latest CardDefs.xml.
  2. whether there is a way in Sabberstone to get those cards.
  3. If not (to either 1 or 2), is there a way for me to effectively get those cards.

Thank you very much!

Using Sabberstone for an UI project/bachelor's work...

[I know that message like that probably doesn't belong here, but I wrote you an email, and I am not sure whether it arrived...]

Hi,
I am a student of Software engineering at Charles University in Prague and I am working on a software project themed on AI for Hearthstone. My goal is to develop some AIs, let them play against each other, and then evaluate which one are the "best". There has been a similar work at my school that used Fireplace (https://is.cuni.cz/webapps/zzp/detail/177312/23634918/?lang=en - it's written in Slovakian though :)), but since Fireplace seems really outdated now, I decided to try your simulator.

Is there any module in Sabberstone (or, are you planning to write one), where you can evaluate whole number of games with given decks (and strategies, maybe)? I know that there is a turn-based GUI, but I will probably need something for simulating of a big number of games automatically.
I can even implement something like that based on your project myself, but I haven't got inside Sabberstone that much yet... I would look on wiki, but there is not much info yet :)

Could you also please tell me more about API of SabberstoneCore, if needed?

Anyway, thanks for your reply and keep up the good work!

Bug in playing cards when board is full (CoreAI)

I've been working on training a neural network as a scoring function for CoreAI (in place of the heuristics available). Unfortunately, OptionNode is generating moves that try to play a card when the board is full.

Here is the stack track of where the sim crashes when I play games for training:
Unhandled Exception: SabberStoneCore.Exceptions.ZoneException: Can't move 'Silverback Patriarch[27]' to [ZONE PLAY 'Player']. The Zone is full.
at SabberStoneCore.Model.Zones.LimitedZone1.MoveTo(T entity, Int32 zonePosition) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Model/Zones/Zone.cs:line 319 at SabberStoneCore.Model.Zones.LimitedZone1.Add(T entity, Int32 zonePosition) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Model/Zones/Zone.cs:line 306
at SabberStoneCore.Model.Zones.PositioningZone`1.Add(T entity, Int32 zonePosition) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Model/Zones/Zone.cs:line 489
at SabberStoneCore.Model.Zones.BoardZone.Add(Minion entity, Int32 zonePosition) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Model/Zones/BoardZone.cs:line 46
at SabberStoneCore.Actions.Generic.<>c.<get_PlayMinion>b__71_0(Controller c, Game game, Minion minion, ICharacter target, Int32 zonePosition, Int32 chooseOne) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Actions/PlayCard.cs:line 257
at SabberStoneCore.Actions.Generic.<>c.<get_PlayCardBlock>b__63_0(Controller c, IPlayable source, ICharacter target, Int32 zonePosition, Int32 chooseOne, Boolean skipPrePhase) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Actions/PlayCard.cs:line 79
at SabberStoneCore.Actions.Generic.PlayCard(Controller c, IPlayable source, ICharacter target, Int32 zonePosition, Int32 chooseOne, Boolean skipPrePhase) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Actions/PlayCard.cs:line 28
at SabberStoneCore.Model.Game.Process(PlayerTask gameTask) in /home/tehqin/Projects/HearthStone/SabberStone/SabberStoneCore/src/Model/Game.cs:line 476
at DeckEvaluator.Evaluation.GameEvaluator.PlayGame() in /home/tehqin/Projects/HearthStone/EvoStone/DeckEvaluator/src/Evaluation/GameEvaluator.cs:line 152
at DeckEvaluator.Evaluation.GameDispatcher.runGame(Int32 gameId, GameEvaluator ev) in /home/tehqin/Projects/HearthStone/EvoStone/DeckEvaluator/src/Evaluation/GameDispatcher.cs:line 72
at DeckEvaluator.Evaluation.GameDispatcher.Run() in /home/tehqin/Projects/HearthStone/EvoStone/DeckEvaluator/src/Evaluation/GameDispatcher.cs:line 121
at DeckEvaluator.Program.Main(String[] args) in /home/tehqin/Projects/HearthStone/EvoStone/DeckEvaluator/src/Program.cs:line 117
/opt/gridengine/default/spool/sge_execd/node296/job_scripts/2051164: line 27: 10201 Aborted (core dumped) dotnet bin/DeckEvaluator.dll $SGE_TASK_ID

Game Point of View of Player

I want to represent the game state in binary, but if I just Deserialize the Model.Game object, this will include the opponent's hand zone and ?deck? which should be private. Is there a way to get the Model.Game with opponent data private/unincluded?

Thanks for help and for making this amazing framework.

Standard Cards waiting for implementation.

Not implemented cards from Standard 08.03.2017
OG_311 SPELL Discover a minion. Give it +1/+1.;
KAR_057 MINION Battlecry Discover a spell.Restore Health to your heroequal to its Cost.;
EX1_567 WEAPON Windfury, Overload: (2);
LOE_053 MINION After you cast a spell on another friendly minion, cast a copy of it on this one.;
CFM_631 WEAPON After your hero attacks, give a random minion in your hand +1/+1.;
CFM_670 MINION All targets are chosen randomly.;
AT_067 MINION Also damages the minions next to whom ever he attacks.;
EX1_006 MINION At the start of your turn, swap this minion with a random one in your hand.;
AT_027 MINION Cards you draw from your Hero Power cost (0).;
OG_134 MINION Battlecry Cast a random spell for each spell you've cast this game (targets chosen randomly).;
OG_087 MINION Battlecry Cast a random spell that costs (5) or less (targets chosen randomly).;
CS1_129 SPELL Change a minion's Attack to be equal to its Health.;
OG_291 MINION Battlecry Choose a friendly minion. Add a 1/1 copy to_your hand that costs_(1).;
CFM_672 MINION Battlecry Choose a friendly minion. Swap it with a minion in your deck.;
EX1_564 MINION Battlecry Choose a minion and become a copy of it.;
CFM_815 MINION Damage dealt by this minion also heals your hero.;
KAR_041 MINION Battlecry Destroy a minion. Deathrattle: Resummon it.;
OG_282 MINION Battlecry Destroy a minion. Add its Attack and Health to_your C'Thun's (wherever it is).;
OG_254 MINION Battlecry Destroy all enemy Secrets. Gain +1/+1 for each.;
EX1_350 MINION Double the damage and healing of your spells and Hero Power.;
CFM_806 MINION Battlecry Draw cards until you draw one that isn't a Dragon.;
KAR_712 MINION During your turn, your hero is Immune.;
OG_123 MINION Each turn this is in your hand, transform it into a random minion.;
BRM_012 MINION Battlecry Gain 1-4 Attack. Overload: (1);
CFM_603 SPELL Gain control of an enemy minion with 2 or less Attack until end of turn.;
EX1_334 SPELL Gain control of an enemy minion with 3 or less Attack until end of turn.;
EX1_274 MINION If you control a Secret at_the end of your turn, gain +2/+2.;
KAR_092 MINION Battlecry If you control a Secret, deal 3 damage.;
OG_173 MINION If you control two of these at the end of your turn, merge them into 'The Ancient One'.;
KAR_205 MINION If you discard this minion, summon it.;
AT_117 MINION Battlecry If you have a minion with Spell Damage, gain +2/+2.;
CFM_020 MINION Battlecry If your deck has no duplicates, your Hero Power costs (0) this game.;
CFM_687 MINION Battlecry If your deck has no duplicates, the next spell you cast this turn costs (0).;
EX1_560 MINION Players only have 15 seconds to take their_turns.;
AT_079 MINION Battlecry Put one of each Secret from your deck into the battlefield.;
OG_118 SPELL Replace your Hero Power and Warlock cards with another class's. The cards cost (1) less.;
OG_316 MINION Battlecry Summon a 1/1 copy of each of your other minions.;
OG_102 MINION Battlecry Swap stats with a friendly minion.;
EX1_076 MINION The first minion you play each turn costs (1) less.;
CFM_066 MINION Battlecry The next Secretyou play this turn costs (0).;
EX1_612 MINION Battlecry The next Secretyou play this turn costs (0).;
BRM_018 MINION Battlecry The next Dragon you play costs (2) less.;
CFM_699 MINION Battlecry The next Murloc you play this turn costs_Health instead of Mana.;
EX1_145 SPELL The next spell you cast this turn costs (3) less.;
OG_121 MINION Battlecry The next spell you cast this turn costs Health instead of Mana.;
AT_115 MINION Battlecry The next time you use your Hero Power, it costs (2) less.;
OG_104 SPELL This turn, your healing effects deal damage instead.;
EX1_083 MINION Battlecry Transform another random minion into a 5/5 Devilsaur or a 1/1 Squirrel.;
KAR_028 WEAPON Unlimited attacks each turn. Can't attack heroes.;
CFM_800 SPELL Secret When a friendly minion dies, return it to your hand.;
EX1_130 SPELL Secret When an enemy attacks, summon a 2/1 Defender as the new target.;
tt_010 SPELL Secret When an enemy casts a spell on a minion, summon a 1/3 as the new target.;
AT_022 SPELL When you play or discard this, deal $4 damage to a random enemy. *spelldmg;
CFM_756 MINION Whenever this miniondeals damage, gain that much Armor.;
AT_124 MINION Whenever your hero takes damage, this minion takes it instead.;
CFM_851 MINION Whenever your opponent draws a card, gain +1/+1.;
OG_209 MINION Whenever your spells deal damage, restore that much Health to your hero.;
AT_008 MINION You can use your Hero Power any number of times.;
AT_080 MINION You can use your Hero Power twice a turn.;
OG_044 MINION Your Choose One cards have both effects combined.;
EX1_591 MINION Your cards and powers that restore Health now deal damage instead.;
AT_034 WEAPON Your Hero Power gives this weapon +1 Attack instead of replacing it.;
NEW1_036 SPELL Your minions can't be reduced below 1 Health this turn. Draw a card.;
EX1_315 MINION Your minions cost (2) less, but not less than (1).;

AttackHealthFix enchant

  • Cards such as Barnes or Mirage Caller's effect is treated as a applying AHF enchant
  • When AHF is removed due to Silence, the targeted minion's atk and hp is set to its original card data
  • (*test required) AHF + Aura ??

work on refactoring tasks

there are right now many tasks a few are just build to do the same but a little bit different like for example
HealTask, HealStackTask, HealNumberTask, HealFullTask.

We should work for a more generic approach.

Unix - antlr4 doesn't suceed to parse the HSGrammar.g4

Hello,
When I try to build the project as it is using VisualStudioCode, antlr4 seems to not being able to work properly.
Here are the error I get :

.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: Exception in thread "main" cli.System.NotImplementedException: The method or operation is not implemented.
.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at cli.System.Reflection.MemberInfo.get_Module(Unknown Source)
.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at cli.System.Reflection.Emit.FieldBuilder.get_Module(Unknown Source)
.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at IKVM.Internal.FieldWrapper.ResolveField(Unknown Source)
.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at IKVM.NativeCode.sun.reflect.ReflectionFactory+FieldAccessorImplBase+FieldAccessor1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].lazySet(Unknown Source) .nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at IKVM.NativeCode.sun.reflect.ReflectionFactory+FieldAccessorImplBase+FieldAccessor1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].lazySet(Unknown Source)
.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at IKVM.NativeCode.sun.reflect.ReflectionFactory+FieldAccessorImplBase+ObjectField.set(Unknown Source)
.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at java.lang.reflect.Field.set(Field.java:689)
.nuget/packages/antlr4.codegenerator/4.6.5-beta001/build/Antlr4.CodeGenerator.targets(121,5): error AC1000: Unknown build error: at org.antlr.v4.Tool.handleArgs(Tool.java:226)

Any known issues or must do configuration regarding this ?
Thanks by advance

Hunter secrets

  • Freezing Trap should increase its target's cost by 2
  • Flare should not activate opponent's Cat Trick #60
  • Explosive Trap should be activated regardless of the attacking minion's statues.
  • Freezing Trap and Misdirection should not be activated when the attacking minion died due to earlier activation of Explosive Trap

Build issue

Hello,

I'm new to .NET development but very interested by this project.
I've tried setting up my environment and building, but without success.

About my setup:

  • Windows 10 64 bits
  • Visual Studio Code
  • .NET core 1.1.2 with SDK 1.0.4 (picked a bit randomly according to the .travis.yml conf)
  • .NET Framework 4.6 Targeting Pack
    I also used nuget to install packages in the right folder.

With this, I'm getting the same error inside Visual Studio Code and from running dotnet build in the CLI.
Here is the full log:

C:\Dev\SabberStone>dotnet build
Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.

  SabberStoneCore -> C:\Dev\SabberStone\SabberStoneCore\bin\Debug\netstandard1.3\SabberStoneCore.dll
  SabberStoneCoreAi -> C:\Dev\SabberStone\core-extensions\SabberStoneCoreAi\bin\Debug\netcoreapp1.0\SabberStoneCoreAi.dll
  SabberStoneCoreConsole -> C:\Dev\SabberStone\core-extensions\SabberStoneCoreConsole\bin\Debug\netcoreapp1.0\SabberStoneCoreConsole.dll
  SabberStoneKettle -> C:\Dev\SabberStone\core-extensions\SabberStoneKettle\bin\Debug\netcoreapp1.0\SabberStoneKettle.dll
  SabberStoneCoreTest -> C:\Dev\SabberStone\SabberStoneCoreTest\bin\Debug\netcoreapp1.1\SabberStoneCore.Test.dll
  SabberStonePowerLog -> C:\Dev\SabberStone\core-extensions\SabberStonePowerLog\bin\Debug\netcoreapp1.0\SabberStonePowerLog.dll
src\MainWindow.xaml.cs(166,5): error CS0103: The name 'PgrBarDepth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(170,5): error CS0103: The name 'TxtPlayer1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(180,4): error CS0103: The name 'BtnStart' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(181,4): error CS0103: The name 'SlidMaxDepth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(182,4): error CS0103: The name 'SlidMaxWidth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(187,4): error CS0103: The name 'InitializeComponent' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(189,4): error CS0103: The name 'CbxFormat' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(190,4): error CS0103: The name 'CbxFormat' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(191,4): error CS0103: The name 'CbxClassCard' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(192,4): error CS0103: The name 'CbxClassCard' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(193,4): error CS0103: The name 'CbxDeckStrategy' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(194,4): error CS0103: The name 'CbxDeckStrategy' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(205,4): error CS0103: The name 'DtDeckFiles' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(207,4): error CS0103: The name 'CboxAi1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(208,4): error CS0103: The name 'CboxAi2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(210,4): error CS0103: The name 'CboxDeck1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(211,4): error CS0103: The name 'CboxDeck1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(212,4): error CS0103: The name 'CboxDeck2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(213,4): error CS0103: The name 'CboxDeck2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(217,4): error CS0103: The name 'ViewBox' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(242,4): error CS0103: The name 'ViewBox' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(248,6): error CS0103: The name 'TxtPlayLog' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(252,4): error CS0103: The name 'TxtPlayLog' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(254,47): error CS0103: The name 'BtnStart' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(256,5): error CS0103: The name 'TxtPlayer1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(257,5): error CS0103: The name 'TxtPlayer1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(258,30): error CS0103: The name 'SlidMaxDepth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(258,67): error CS0103: The name 'SlidMaxWidth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(265,39): error CS0103: The name 'CboxAi1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(266,39): error CS0103: The name 'CboxAi2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(267,51): error CS0103: The name 'SlidMaxDepth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(267,76): error CS0103: The name 'SlidMaxWidth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(268,5): error CS0103: The name 'BtnStart' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(272,5): error CS0103: The name 'TxtPlayer1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(275,5): error CS0103: The name 'BtnStart' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(276,5): error CS0103: The name 'BtnStart' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(278,5): error CS0103: The name 'CboxDeck1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(279,5): error CS0103: The name 'CboxDeck2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(280,5): error CS0103: The name 'CboxAi1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(281,5): error CS0103: The name 'CboxAi2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(287,4): error CS0103: The name 'TxtPlayer1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(289,10): error CS0103: The name 'TxtPlayer1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(303,6): error CS0103: The name 'BtnStart' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(304,6): error CS0103: The name 'SlidMaxDepth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(305,6): error CS0103: The name 'SlidMaxWidth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(310,5): error CS0103: The name 'TxtPlayer1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(312,65): error CS0103: The name 'CboxDeck1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(312,99): error CS0103: The name 'CboxDeck2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(314,5): error CS0103: The name 'CboxDeck1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(315,5): error CS0103: The name 'CboxDeck2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(316,5): error CS0103: The name 'CboxAi1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(317,5): error CS0103: The name 'CboxAi2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(318,5): error CS0103: The name 'BtnStart' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(319,5): error CS0103: The name 'SlidMaxDepth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(320,5): error CS0103: The name 'SlidMaxWidth' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(338,8): error CS0103: The name 'CbxFormat' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(338,42): error CS0103: The name 'CbxClassCard' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(341,33): error CS0103: The name 'CbxFormat' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(342,31): error CS0103: The name 'CbxClassCard' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(357,4): error CS0103: The name 'DtGrTest' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(362,21): error CS0103: The name 'DtGrTest' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(369,21): error CS0103: The name 'DtGrTest' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(373,5): error CS0103: The name 'LbCardCountValue' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(374,5): error CS0103: The name 'DtGrDeck' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(380,21): error CS0103: The name 'DtGrDeck' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(382,4): error CS0103: The name 'LbCardCountValue' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(383,4): error CS0103: The name 'DtGrDeck' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(388,21): error CS0103: The name 'DtGrDeck' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(399,5): error CS0103: The name 'ImgCard' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(411,12): error CS0103: The name 'TxDeckname' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(412,19): error CS0103: The name 'TxDescription' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(413,12): error CS0103: The name 'TxDeckLink' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(414,30): error CS0103: The name 'CbxFormat' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(415,28): error CS0103: The name 'CbxClassCard' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(416,26): error CS0103: The name 'CbxDeckStrategy' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(430,25): error CS0103: The name 'DtDeckFiles' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(432,4): error CS0103: The name 'TxDeckname' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(433,4): error CS0103: The name 'TxDescription' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(434,4): error CS0103: The name 'TxDeckLink' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(435,4): error CS0103: The name 'CbxFormat' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(436,4): error CS0103: The name 'CbxClassCard' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(437,4): error CS0103: The name 'CbxDeckStrategy' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(439,4): error CS0103: The name 'LbCardCountValue' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(440,4): error CS0103: The name 'DtGrDeck' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(446,4): error CS0103: The name 'DtDeckFiles' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(451,25): error CS0103: The name 'DtDeckFiles' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(458,19): error CS0103: The name 'CboxDeck1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(461,5): error CS0103: The name 'LblClass1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(462,5): error CS0103: The name 'CboxAi1' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(469,19): error CS0103: The name 'CboxDeck2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(472,5): error CS0103: The name 'LblClass2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
src\MainWindow.xaml.cs(473,5): error CS0103: The name 'CboxAi2' does not exist in the current context [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [C:\Dev\SabberStone\SabberStoneGui\SabberStoneGui.csproj]
  SabberStoneHsReplay -> C:\Dev\SabberStone\core-extensions\SabberStoneHsReplay\bin\Debug\netcoreapp1.1\SabberStoneHsReplay.dll
  HSGrammar -> C:\Dev\SabberStone\core-extensions\HSGrammar\bin\Debug\netcoreapp1.1\HSGrammar.dll
  SabberStoneBuildCardSet -> C:\Dev\SabberStone\core-extensions\SabberStoneBuildCardSet\bin\Debug\netcoreapp1.0\SabberStoneBuildCardSet.dll
  SabberStoneKettleClient -> C:\Dev\SabberStone\core-extensions\SabberStoneKetteClient\bin\Debug\netcoreapp1.0\SabberStoneKettleClient.dll
  SabberStoneKettleSimulator -> C:\Dev\SabberStone\core-extensions\SabberStoneKettleSimulator\bin\Debug\netcoreapp1.0\SabberStoneKettleSimulator.dll

Build FAILED.
```

I'm not sure where the issue comes from.
Any help would be appreciated :)

Some cards from EXPERT1 (classic) are not implemented?

Hi,

I wrote a short script to get some cards I need, but it turns out that the following cards from the EXPERT1 (aka classic) cardset are not implemented (at least their Implemented attribute says so) while the README indicates that all cards from that set should be implemented. Here is the list of cards:

Name: Power of the Wild
Cardset: EXPERT1
ID: EX1_160
Cost: 2
Attack: 0
Health: 0
Text: <b>Choose One -</b> Give your minions +1/+1; or Summon a 3/2 Panther.
Implemented: False

Name: Wrath
Cardset: EXPERT1
ID: EX1_154
Cost: 2
Attack: 0
Health: 0
Text: <b>Choose One -</b>
Deal $3 damage to a minion; or $1 damage
and draw a card. @spelldmg
Implemented: False

Name: Mark of Nature
Cardset: EXPERT1
ID: EX1_155
Cost: 3
Attack: 0
Health: 0
Text: <b>Choose One -</b> Give a minion +4 Attack; or +4 Health and <b>Taunt</b>.
Implemented: False

Name: Keeper of the Grove
Cardset: EXPERT1
ID: EX1_166
Cost: 4
Attack: 2
Health: 2
Text: <b>Choose One -</b> Deal_2_damage; or <b>Silence</b> a minion.
Implemented: False

Name: Nourish
Cardset: EXPERT1
ID: EX1_164
Cost: 6
Attack: 0
Health: 0
Text: <b>Choose One -</b> Gain 2_Mana Crystals; or Draw 3 cards.
Implemented: False

Name: Starfall
Cardset: EXPERT1
ID: NEW1_007
Cost: 5
Attack: 0
Health: 0
Text: <b>Choose One -</b>
Deal $5 damage to a minion; or $2 damage to all enemy minions. @spelldmg
Implemented: False

Name: Ancient of Lore
Cardset: EXPERT1
ID: NEW1_008
Cost: 7
Attack: 5
Health: 5
Text: <b>Choose One -</b> Draw a card; or Restore #5 Health.
Implemented: False

Name: Ancient of War
Cardset: EXPERT1
ID: EX1_178
Cost: 7
Attack: 5
Health: 5
Text: <b>Choose One -</b>
+5 Attack; or +5 Health and <b>Taunt</b>.
Implemented: False

Name: Cenarius
Cardset: EXPERT1
ID: EX1_573
Cost: 9
Attack: 5
Health: 8
Text: <b>Choose One -</b> Give your other minions +2/+2; or Summon two 2/2 Treants with <b>Taunt</b>.
Implemented: False

I am using Cards.FromName() to get the cards and print their attributes.

My questions:

  1. Are these cards actually implemented?
  2. Is there an efficient way to check whether they are actually implemented?

Sabberstone version: 2.1 (latest from master branch)
OS: Ubuntu 20.04

Damage and Armor interaction

I was looking at Character::TakeDamage and noticed the damage to inflict first passes armor after which it's bound to the Predamage property.
Shouldn't it be the other way around; Firsts predamage and then reducing the amount of armor?
Related code

It would be an ideal moment to test with Prophet Velen.

Casting error from Enchantment to ICharacter.

Hello,

We have implemented a .NETCore Evaluator to iteratively run games. When we try to use the Game.Process(PlayTask gameTask) function to process a game, .NET gives us this error after certain iterations

Unhandled Exception: System.AggregateException: One or more errors occurred. (Unable to cast object of type 'SabberStoneCore.Model.Entities.Enchantment' to type 'SabberStoneCore.Model.Entities.ICharacter'.) ---> System.InvalidCastException: Unable to cast object of type 'SabberStoneCore.Model.Entities.Enchantment' to type 'SabberStoneCore.Model.Entities.ICharacter'.
at SabberStoneCore.Model.Game.Process(PlayerTask gameTask) in /Users/yulunzhang/Desktop/Coding/icaros/hearthstone/SabberStone/SabberStoneCore/src/Model/Game.cs:line 486
at DeckEvaluator.Evaluation.GameEvaluator.PlayGame() in /Users/yulunzhang/Desktop/Coding/icaros/hearthstone/EvoStone/DeckEvaluator/src/Evaluation/GameEvaluator.cs:line 165
at DeckEvaluator.Evaluation.GameDispatcher.runGame(Int32 gameId, GameEvaluator ev) in /Users/yulunzhang/Desktop/Coding/icaros/hearthstone/EvoStone/DeckEvaluator/src/Evaluation/GameDispatcher.cs:line 72
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica1.ExecuteAction(Boolean& yieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction1 action, ParallelOptions options, Boolean stopOnFirstFailure)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body)
at DeckEvaluator.Evaluation.GameDispatcher.Run() in /Users/yulunzhang/Desktop/Coding/icaros/hearthstone/EvoStone/DeckEvaluator/src/Evaluation/GameDispatcher.cs:line 127
at DeckEvaluator.Program.Main(String[] args) in /Users/yulunzhang/Desktop/Coding/icaros/hearthstone/EvoStone/DeckEvaluator/src/Program.cs:line 119
[1] 78423 abort dotnet bin/DeckEvaluator.dll 1

This error exposes a casting error in Game.cs, but when we look through the source code of SabberStone it doesn't seem to have such a casting on the specified place (line 486 of Game.cs). We will appreciate if you can help us with this.

SabberStone version: 2.1.0 (we pull the code from master and compiled it)
.NETCore version: 2.1

How to simulate the game board state, and run for analyze

Currently, I want to simulate this game in 5th turn.
https://hsreplay.net/replay/EPYWPdrBBaELpVVq3aiBEc#turn=5b

After check the sample code in SabberStone\core-extensions\SabberStoneCoreConsole\src\Program.cs
My problem is:
1.How can I set the cards in hand for each player
2.How can I set the minions already on board for each player
3.How can I start the analyze when I finish the above two steps
I have checked the start game method, it contains the following code

// first turn
			Turn = 1;

Actually I want to simulate the 5th turn when I have only one mana left.
I can summon a totem first, then play the sea giant. Instead of playing the sea giant directly.
image

I want to check if SabberStone intelligent enough to give the correct move for the above game state.
This is one turn analyze, actually I only want to set the minions for each player and the mana left for me and the cards on my hand. Maybe the hero skill should be calculated.

Thread unsafe (access to to) objects

As noted by @rnilva there are instances where non thread-safe operations are performed. These operations need to be detected and solved.

More detected issues will be added to the list below. Solved issues will be marked.
Please refer to this issue within your PR message if you solve one of the items on the list.

The following related issues are detected:

  • Random source (Core/Model/Utils.Random) [ref]

PowerLog ANTLR Grammar

I worked this out on an other day ... maybee we can use it ...

`grammar HSGrammar;

/*
.... Parser Rules
*/

compileUnit
: (hsPowerLine)* EOF
;

hsPowerLine
: hsCreateGame
| hsFullEntity
| hsTagChange
| hsBlockStart
| hsShowEntity
| hsHideEntity
| hsBlockEnd
| hsMetaData
| hsEntityChoices
;

// *** CREATE_GAME ***
hsCreateGame
: CREATE_GAME hsCreateGameGameEntity
hsCreateGamePlayer
hsCreateGamePlayer
;
hsCreateGameGameEntity
: GameEntTag hsEntityIdAssign hsTagValueExpr+
;
hsCreateGamePlayer
: PlayerIdTag hsEntityIdAssign hsPlayerIdAssign hsGameAccIdAssign hsTagValueExpr+
;
hsEntityIdAssign // EntityID=1
: EntityIdTag EQ (INT|VALUE|GameEntTag|hsEntityObject)
;
hsEntityObject // [name=UNKNOWN ENTITY [cardType=INVALID] id=28 zone=DECK zonePos=0 cardId= player=1]
: LB 'name=' (VALUE+|'UNKNOWN ENTITY' LB 'cardType=INVALID' RB) hsIdAssign 'zone=' VALUE 'zonePos=' INT hsCardIdAssign 'player=' INT RB
;
hsPlayerIdAssign // PlayerID=1
: PlayerIdTag EQ INT
;
hsGameAccIdAssign // GameAccountId=[hi=144115198130930503 lo=95364660]
: GameAccTag EQ LB 'hi' EQ INT 'lo' EQ INT RB
;

// *** FULL_ENTITY ***
hsFullEntity
: FULL_ENTITY DS 'Creating' hsIdAssign hsCardIdAssign hsTagValueExpr+
;
hsIdAssign // ID=4
: IdTag EQ INT
;
hsCardIdAssign // CardID=
: CardIdTag EQ VALUE?
;

// *** TAG_CHANGE ***
hsTagChange
: TAG_CHANGE hsEntityIdAssign hsTagValueExpr
;

// *** BLOCK_START ***
hsBlockStart
: BLOCK_START hsBlockTypeAssign hsEntityIdAssign hsEffectCardIdAssign hsEffectIndexAssign hsTargetAssign
;
hsBlockTypeAssign // BlockType=TRIGGER
: BlkTypeTag EQ VALUE
;
hsEffectCardIdAssign // EffectCardId=
: FxCardIdTag EQ
;
hsEffectIndexAssign // EffectIndex=-1
: FxIndexTag EQ INT
;
hsTargetAssign // Target=0
: TargetTag EQ (INT|hsEntityObject)
;

hsBlockEnd
: BLOCK_END
;

// *** SHOW_ENTITY ***
hsShowEntity
: SHOW_ENTITY DS 'Updating' hsEntityIdAssign hsCardIdAssign hsTagValueExpr+
;

// *** HIDE_ENTITY ***
hsHideEntity
: HIDE_ENTITY DS hsEntityIdAssign hsTagValueExpr+
;

// *** META_DATA ***
hsMetaData
: META_DATA DS 'Meta=' VALUE 'Data=' INT InfoTag EQ INT hsMetaDataInfo+
;
hsMetaDataInfo
: InfoTag LB INT RB EQ (INT|hsEntityObject)
;

// *** ENTITY_CHOICES ***
hsEntityChoices // id=1 Player=cro TaskList=4 ChoiceType=MULLIGAN CountMin=0 CountMax=5
: hsIdAssign 'Player=' VALUE 'TaskList=' INT 'ChoiceType=' VALUE 'CountMin=' INT 'CountMax=' INT 'Source=' GameEntTag hsEntities*
;

hsEntities // Entities[0]=[name=UNKNOWN ENTITY [cardType=INVALID] id=5 zone=DECK zonePos=0 cardId= player=1]
: 'Entities[' INT ']=' hsEntityObject
;

// *** tag & value ***
hsTagValueExpr : TagTag EQ hsTagExpr ValueTag EQ hsValueExpr ;
hsTagExpr : (INT|VALUE) ;
hsValueExpr : (INT|VALUE) ;
/*
... Lexer Rules
*/

CREATE_GAME : 'CREATE_GAME' ;
FULL_ENTITY : 'FULL_ENTITY' ;
BLOCK_START : 'BLOCK_START' ;
SHOW_ENTITY : 'SHOW_ENTITY' ;
TAG_CHANGE : 'TAG_CHANGE' ;
BLOCK_END : 'BLOCK_END' ;
HIDE_ENTITY : 'HIDE_ENTITY' ;
META_DATA : 'META_DATA' ;

// PROTECTED WORDS
GameEntTag : 'GameEntity' ;
PlayerIdTag : 'Player' 'ID'? ;
EntityIdTag : 'Entity' 'ID'? ;
CardIdTag : 'cardId' | 'CardID' ;
IdTag : 'ID' | 'id' ;
GameAccTag : 'GameAccountId' ;
BlkTypeTag : 'BlockType' ;
FxCardIdTag : 'EffectCardId' ;
FxIndexTag : 'EffectIndex' ;
TargetTag : 'Target' ;
InfoTag : 'Info' ;
TagTag : 'tag' ;
ValueTag : 'value' ;

DS : '-' ;
LB : '[' ;
RB : ']' ;
EQ : '=' ;

VALUE : [A-Za-z][A-Za-z0-9_'-]+[:!]?
;

INT : DS? [0-9]+
;

WS : [ \r\t\n]+ -> skip
;`

GamePlay Update 9.2 check if implemented

Gameplay & Updates

Hearthstone Mechanics Update – We've changed some underlying rules to prevent Wild Pyromancer from triggering off of Mindgames, and Djinni of Zephyrs from triggering off Entomb. Please check out the Upcoming Mechanics Update blog for details!
Several Friends List options have been bundled into a sub-menu.
Spells that are canceled by Counterspell will now trigger any “Whenever you cast a spell” and “After you cast a spell” effects.
Lord Jaraxxus no longer triggers Repentance, Sacred Trial, and Snipe.
Unlicensed Apothecary now reads: “After you summon a minion, deal 5 damage to your hero.” It will no longer activate from any Evolve effects.
It is no longer possible to cancel Choose One cards before the choices appear, this should resolve issues where the Choose One effect could be canceled too easily.
Hearthstone’s engine has been updated to Unity version 5.6.
Animations for Mimic Pod, Chromaggus, Shifting Shade, Ghastly Conjurer, and Cutpurse should no longer have a long pause.
Mana-cost reductions on cards such as Dragon’s Breath, Solemn Vigil, Everyfin is Awesome, and Obsidian Shard will now apply after all other mana cost changes, such as the effects from cards like Naga Sea Witch.

Add a Enchant to a silenced Minion

Currently, most of the Enchants have EnableCondition = SelfCondition.IsNotSilenced .
Which works well when already buffed minion is silenced but It makes us impossible to add new enchant to a silenced minion.

novice overhaul

While working on the kettle integration I noticed there is a high entry barrier when starting out with the project, at least for me.
That's why I suggest overhauling the code (and especially interfaces of models) to have a more intuitive and documented design. The intention is to transform, not to rebuild.
To commence this operation i have created tasks which will guide the process. Any additional suggestions will be edited into THIS message to track it's progress.

The following invariants are important to the process:

  • Discussions about interface changes will be held in a separate issue, which will be linked from this thread.

  • This overhaul should not fail any existing test cases. Changing test code in this context MUST be preceded by a discussion!

Development will happen inside a separate branch until most/all tasks are completed.

  • Setup CI - Travis/AppVeyor.

  • Revert targeted frameworks (of each project) to MAJOR-MINOR versions. In the case of .NET Standard the lowest version possible.

  • Group enums under SabberStoneCore.Enums namespace.

  • Move all Kettle related code (SabberStoneCore.Kettle namespace) from the core project.

  • Fix all errors occurring in compilation/testing.

  • For all interfaces, pick the most general interface type to hold public properties.

  • Document interfaces of the most crucial components (Models).

  • Overhaul model interfaces to be more intuitive.

Asynchronous games

Hi,

First of all, I am not used to TPL/PLINQ syntax but still working learning and practicing about them.
I tried making several copies of a game using Game.Clone() method and making tasks for each. Then I attempted async method and await Task.WhenAll(), or Just tried Monitor.TryEnter / Finally statement.
Definitely neither of them works. Even in locking syntax I was not sure which object I should lock.

Questions:

  1. Is there any way to run N games asynchronously?
  2. Is the internal structure of the Class Game not allow asynchronous tasks?

I am on #Hearthsim most of the time so if you guys could provide any kind of help that would be awesome.
Milva#2618

Help needed for AI implementations ...

Anyone interested in helping in implementing some AI's

for example a Behaviour AI would be interesting ...

also I need some other opinions in how to sync a running hearthstone game with sabberstone ...

What happened to Stove?

Hi all,

I wanted to run SabberStone with the "real" HS client and noticed that the URL to Stove is down.

Has it moved or was it discontinued?

Thanks in advance!

Can't run a game on GUI.

Made a deck with 30 cards for Druid. Ran the deck, sometimes when I click the "Start Game" button, it crashes, or other times it crashes when I click the "'Player[2]' Move!" button. It's usually this error:
In "OptionNode.cs"
image

But sometimes other random errors occur.

When I run the deck with "Strategy" tab to "None," it gives this error instead:
In "GuiHelp.cs"
image

bug of SabberStoneGui

  1. make a deck
  2. select its deck
  3. push "Start Game" button
  4. System.ArgumentNullException

Multi-thread unsafe cards

Taking a card(s) from the deck

  • Patches the Pirate
  • Madam Goya
  • Finja, the Flying Star
  • Quick Shot
  • Slam
  • Cult Master
  • ...

Choice generating cards

  • Shadow Visions
  • Kazakus
  • Adapt cards
  • ...

Reason Unknown

  • Ethereal Arcanist, Alarm-o-Bot (MaxExecution / crash also happens on single thread)
  • Rarely a minion is contained in BoardZone and GraveyardZone simultaneously => infinite loop of death process (this also happens on single thread) (Observed source : Maelstrom Portal / Totems from Wicked Witchdoctor / games where DK card appears)

I tried to change the language of the card and made a mistake

.How to correct the language,

 Tags = (from tag in r.Descendants("Tag")
                        select new Tag(
                            gameTag: (GameTag) Enum.Parse(typeof(GameTag), tag.Attribute("enumID").Value),
                            tagValue:
                            tag.Attribute("value") != null
                                ? (TagValue) int.Parse(tag.Attribute("value").Value)
                                : (tag.Attribute("type").Value == "String"
                                    ? (TagValue) tag.Value
                                    : (tag.Attribute("type").Value == "LocString"
                                        ? (TagValue) tag.Element("zhCN").Value
                                        : (TagValue) 0
                                    )))).ToList(),
                    Requirements = (from req in r.Descendants("PlayRequirement")
                        select new
                        {
                            Req = (PlayReq) Enum.Parse(typeof(PlayReq), req.Attribute("reqID").Value),
                            Param = (req.Attribute("param").Value != "" ? int.Parse(req.Attribute("param").Value) : 0)
                        }).ToDictionary(x => x.Req, x => x.Param),
                    Entourage = (from ent in r.Descendants("EntourageCard")
                        select ent.Attribute("cardID").Value).ToList(),
                    ReferenzTag = (from rtag in r.Descendants("ReferencedTag")
                        select new Tag(
                            gameTag: (GameTag) Enum.Parse(typeof(GameTag), rtag.Attribute("enumID").Value),
                            tagValue:
                            rtag.Attribute("value") != null
                                ? (TagValue) int.Parse(rtag.Attribute("value").Value)
                                : (rtag.Attribute("type").Value == "String"
                                    ? (TagValue) rtag.Value
                                    : (rtag.Attribute("type").Value == "LocString"
                                        ? (TagValue) rtag.Element("zhCN").Value
                                        : (TagValue) 0
                                    )))).ToList()
                }).ToList();

PlayerTask infinite loop

I was trying to implement a simple RandomGreedyAI using Sabberstone:
sabber

I used it like that in a loop:
sabber2

However, the games randomly loops inifinitely (usually on MinionAttackTasks), the player still produces Tasks, the game still processes them, but nothing happens...
capture8

Is there something I am missing in using CurrentPlayer.Options?
Thanks :)

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.