Skip to content
Jerome Leclanche edited this page Sep 3, 2016 · 3 revisions

The following is the 5-point plan discussed with @smallnamespace. We want to get to the first four items for "Fireplace 2.0". It's ambitious, but it'll also result in an extremely powerful framework for Hearthstone simulation.

Game Ticks

A tick-based core game loop, as laid out in #329, is needed for some mechanics (such as mid-flight input, eg. Discover) and advanced simulation introspection (eg. what happens exactly when you play Onyxia with a Knife Juggler on the board; introspecting the board state after every knife).

One of the more promising approaches so far is a breakpoint syntax using context managers.

Copy-on-Write

A copy-on-write approach to game ticks would create a revert-friendly framework for AI work and debugging.

DSL reimplementation in lisp

The Python DSL is approaching its limits. Although it is an interesting experiment in python declarativeness, its implementation is extremely complex and is due for a rewrite.

Before it was in Python, Fireplace was in Clojure. Lisp's "data as code, code as data" paradigm is extremely useful in the context of game rules in general. Additionally, having the card implementations in an easily-parsed DSL makes it far friendlier to other simulators.

The design is in two parts:

  • "Finley", a simple Lisp variant for the purpose of Hearthstone.
  • "Soot", the game rule and card implementations in Finley

hearthstone.entities

The python-hearthstone library now implements generic Hearthstone entity logic. Moving the core entity logic from fireplace to there would make fireplace only deal with the game logic, rather than the game's tree and tags. This would make it much easier to move entity objects around between HSReplay, Power.log, Fireplace and whatever else uses that library.

Cython

Rewriting the computing-heavy parts of the simulator in Cython to improve performance.