Gwent support in DeckLock has been on my ToDo list for some time as it currently is my favorite game. The artwork is stunning, it is well balanced and rewards skill. Though it being a digital-only card game makes it somewhat different from KeyForge and Magic: the Gathering. As the latter have printed, physical cards the cards themselves can’t be changed. Occasionally, an errata is issued or cards that are to powerful are banned from competitive play. In Gwent however, there are no physical cards, and cards can change from one update to another making them stronger, weaker or changing them entirely. As the official website does allow users to share their decklists, it only has data for the latest version. Therefore I opted to add decks using a decklist that contains information on the version and get card data from The Voice of Gwent which contains data for all cards for all versions.

Adding a deck works very much the same way as for a Magic: the Gathering deck which was described in part 2. Though as there is no standard format to represent a similar one to M:tG was used. The first few lines contain extra information, most importantly the version of Gwent the deck is compatible with, followed by the actual deck list.

// NAME : Soldiers Ball
// CREATOR : Team Leviathan Gaming
// GWENT_VERSION : 6.2.0
// FACTION : Nilfgard
1 Imperial Formation
1 Magic Lamp
1 Masquerade Ball
1 Vincent Van Moorlehem
1 Joachim de Wett
1 Ramon Tyrconnel
1 Maraal
1 Yennefer's Invocation
1 Affan Hillergrand
1 Ffion var Gaernel
1 Sweers
1 Albrich
1 Van Moorlehem's Cupbearer
1 Roderick of Dun Tynne
2 Ard Feainn Crossbowman
1 Ard Feainn Tortoise
1 Tourney Joust
2 Alba Spearman
2 Magne Division
1 Recruit
2 Fangs of the Empire
2 Van Moorlehem Hunter

This is the example of the Soldiers’ Ball deck from Team Leviathan Gaming. This needs to be stored as a text file with a .gwent extention in the content folder and the Gwent Pelican plugin included in the new version of DeckLock will process it. If you’ve read part 1 and part 2 of the DeckLock posts, there is nothing remarkable about the implementation.

Handling images

One consequence of having digital cards that can change over time is how they are stored on The Voice of Gwent. You can download the images of the cards, but as other properties (like the power, the abilities, …) can change from one version to another, additional information is cleverly added using CSS.

The Voice of Gwent cleverly combines parts with CSS


All the code for DeckLock is up on GitHub and you can check out the demo with the Decks I have and enjoy playing across the different games.