Welcome to Skyrim Gwent, a digital card game project developed for the Programming course at MATCOM, University of Havana. This repository contains a fully functional implementation of a card game inspired by the mechanics of Gwent, expanded with a custom Domain-Specific Language (DSL) and a mini-compiler, all set in the frozen lands of The Elder Scrolls V: Skyrim.
The project was developed in two critical phases that integrate game development with programming language theory:
Development of the main engine using Unity. Implementation of core rules:
- Three-row battlefield (Melee, Ranged, Siege).
- Card types: Silver, Gold (Heroes), and Leaders.
- Round-based scoring system and turn management.
The advanced phase where the game expands. A mini-compiler was created to interpret and load new cards and effects dynamically via an in-game text editor.
While the mechanics are based on Gwent, the soul of this version is dedicated to Skyrim. Every element has been personalized to reflect the lore of the Dragonborn:
- Factions: Choose your side in the civil war (Stormcloaks vs. Imperials) or play as the ancient Dragons.
- Cards & Characters: Iconic units such as the Dovahkiin, Alduin, Serana, and Cicero.
- Thu'um (Dragon Shouts): Special abilities and
OnActivationeffects are themed as shouts (e.g., Unrelenting Force for clearing rows or Dragonrend to ground powerful units). - Visuals: UI inspired by the Skyrim HUD and backgrounds featuring legendary locations like Whiterun, Riften, and Blackreach.
- Board Layout: Two players with 3 distinct rows, including slots for weather and boost cards.
- Game Loop: 10-card initial draw, hand limits, and best-of-three rounds victory system.
- Card Types: Units (Silver/Gold), Leaders with unique abilities, Decoys, Clear Weather, and Weather effects.
The heart of Phase 2 is the custom compiler that processes the language designed for card creation:
- Effect Declaration: Define complex behaviors using
ParamsandAction. - Advanced Selectors: Precise card filtering from the
Board,Hand,Deck, orGraveyardusingSource,Single, andPredicate. - Context Management: Real-time access to the game state (
TriggerPlayer,Power,Owner,Faction). - Post-Actions: Chain effects together to create powerful combos.
A comprehensive test suite is included to ensure the compilation pipeline works correctly:
- Lexical Analysis: Correct tokenization of keywords and symbols.
- Syntax Analysis: Validation of card and effect structures.
- Semantic Analysis: Verification of references to declared parameters and context properties.
- Clone the repository:
git clone [https://github.com/JosuSC/SkyrimGwent-Interprete.git](https://github.com/JosuSC/SkyrimGwent-Interprete.git)
- Open in Unity: Import the project using Unity 2022.3 LTS or higher.
- Run: Launch the
MainScene. - DSL Editor: Use the in-game editor to load your own
.gwentfiles and expand your deck.
"I used to be an adventurer like you, then I took an arrow in the knee."