Skip to content

Changelog

Milva edited this page Feb 12, 2018 · 19 revisions

Changelog

2018-02-12 2.0.0

Summary

  • Now Sabber uses the latest version of .NET Core
  • Refactoring of some fields (You should fix some of your own codes)
  • Entirely new Trigger / Aura / Enchantment system, which uses events and the actual ENCHANTMENT entities
  • Implementation of long-forgotten tricky cards including:
  • Spellbender
  • Mayor Noggenfogger
  • Yogg
  • and more!
  • Far more accurate gameplay simulation with new task system including the recent gameplay changes
  • Insanely optimised performance
  • Changed card implementation syntax

1. Refatored names:

Old Name Refactored Name
SabberStoneCore.Enchants.Enchantment SabberStoneCore.Enchants.Power
SabberStoneCore.Enchants.Enchantments SabberStoneCore.Enchants.Powers
SabberStoneCore.Model.Entities.Hero.Power SabberStoneCore.Model.Entities.Hero.HeroPower
SabberStoneCore.Enchants.Enchantment.SingleTask SabberStoneCore.Enchants.Power.PowerTask

2. Enchantment / Trigger Reworks

2.1. Triggers

Previously we checked every tag changes to trigger effects. The new trigger design uses events. This way we can reduce the number of tags that used for checking triggers and have no other uses (e.g. JUST_PLAYED, SUMMONED, ...), and can simulate the actual situation more precisely. Secondly, the new trigger system helps us to implement new cards with trigger more conveniently because the new implementation syntax doesn't require us to provide an exact tag or value increment. Finally I hope that this new system would help us to implement precise History Blocks

2.2 Enchantments and Auras

I decided to revive the dead Enchantment cards, to simulate all things accurately. From now on, most of cards that make changes of tags value of itself or other entities actually gives "Enchantment" entity to the target entities. (e.g. Abusive Sergeant, Preparation, Mana Wyrm, Potion of Madness, Crazed Alchemist, and so on) So we should implement both the enchantment giver and the enchantment card itself. I recommend you to check one of the CardSet file to comprehend how things are changed; I think they are really readable :p

3. Performance improvement

Personally, besides the other things I've done, I am really proud of myself that... I optimised Sabber more than 2X faster with this commit. Not only the changed mechanism makes the engine faster, but also I've introduced custom hash table for tags, which allows super faster cloning. I benchmarked with random games between players using the same mage expert deck (https://www.hearthpwn.com/decks/66047-mage-expert-ai-deck). I separately measured two cases; to see the performance of cloning, I cloned each time PlayerTask is processed and measured the duration of Game.Clone(). Secondly, I processed random decisions and measured the duration of Game.Process() I Ran 20000 Games to completion in each round and averaged results from 10 rounds.

for 20,000 full games Sabber before this commit Sabber with this commit
Game.Process() 13.4127 s 6.7383 s (199% faster)
Game.Clone() 56.827 s 26.2228 s (217% faster)

4. State of Implementations

Basic => 100% from 142 Cards Classic => 100% from 239 Cards Whispers of the Old Gods => 99% from 134 Cards One Night in Karazhan => 100% from 45 Cards Mean Streets of Gadgetzan => 99% from 132 Cards Journey to Un'Goro => 95% from 135 Cards Knights of the Frozen Throne => 92% from 135 Cards Kobolds and Catacombs => 25% from 135 Cards Total Standard => 89% from 1097 Cards

5. Known Issues

5.1 Hash

I have yet to write hash functions for new structure so It is not possible to check the integrity of the clone for now, but I tested stability of cloning with 100,000 random games with random cards.

5.2 Working with Kiln (Stove)

I have yet to test with any kind of servers ... but I expect the calibration would be easy than before. There are lot of things to implement to simulate precise history such as CHANGE_ENTITY or REVEAL_ENTITY, and METADATA.

5.3 Wild card implementations

I have yet to convert cardsets in wild format. so wild cards cannot be used for now.

5.4 Slow Controller.Options()

I've been developing a faster Options() algorithm and I will commit it soon