TextStone: HearthStone Text Edition

TextStone is a fan-made text-based port of the popular game “HearthStone: Heroes of Warcraft” by Blizzard Entertainment. In the text edition of the game, players compete in multiplayer against an opponent with their browser by entering commands into a terminal. All the card interactions of the original game are faithfully recreated in a thrilling text-only game.

The game was modeled after vintage “Multi-User Dungeons (MUD)” style text-based adventures played with others.

Design

In TextStone, players are matched against an opponent (either a friend or through matchmaking) and then pick a deck from a selection of premade decks. The players then go through the standard mulligan phase of the original game before being sent to the central game prompt.

On the player’s turn, they can play cards from their hand, review the cards on the board, look at specific cards, or use minions on the board to attack other minions or the enemy hero. All the commands are available by typing “help” at the console. When it is an opponent’s turn, the player can still review the board and look at cards while they wait. Actions their opponent perform are sent back to them in real time.

All the cards from the base game are available, and behave identically to their base game counterpart. Additional descriptions of each card’s action are added in to make up for the lack of card art and interaction animations that normally accompany the game.

The player’s health and mana are displayed in the “prompt” part of the game. The game ends when one player reaches 0 health.

Inspiration

TextStone is based on Multi-User Dungeons, or MUDs that were popular in the 90s. MUDs were a precursor to the popular “MMORPG” games of today, where players band together in a text-based environment to go on medieval adventures. The virtual cards and their interactions are from the Blizzard game HearthStone.

Technical Implementation

TextStone is written in Node.JS, with a back-end server handling all the commands and returning all the game data to a dumb JavaScript terminal. Each component of the game was written as a Node.JS module, with special attention being paid to turn lifecycles and card actions. Each phase of the player’s turn allows card actions to be injected into it, for example:

  • Cards that have actions at the start or end of the player’s turn, when another card is played, or a minion on the board dies.
  • Battlecries and deathrattles that happen when a card enters or leaves play.
  • Spell cast actions and secret triggers.

The HearthStone data comes straight from user generated data files based on the game. These JSON files contain card names, descriptions, health, mana, and card text. Card actions however are manually coded in based on the description of the card.

Card and player actions are calculated and resolved server side, then communicated to each player. The server manages each game independently, and gives each game a unique identifier allowing it to be resumed if a player leaves. Friends can find each other by entering the same game name, or matchmaking can dynamically create games based in a first-in-first-out ordering.

Play TextStone online here