Eyes of the Dragon MonoGame RPG Tutorials
Update!
I am in the process of updating the tutorials to the latest version of MonoGame, 3.8.1, as Eyes of the Dragon 4.0! Visit the new MonoGame RPG Tutorials Eyes of the Dragon 4.0 page.
Welcome to the home of my Eyes of the Dragon MonoGame RPG Tutorials! These tutorials are a reboot of my old XNA RPG tutorial series Eyes of the Dragon. They are written for MonoGame 3.8 and Visual Studio 2019. Read the tutorials to understand the content best as they build upon one another.
Eyes of the Dragon is a 2D role-playing game set in the town of Hartsward. It features the common elements of a role-playing game: inventory management, character classes, skill and spell trees and combat. The back story is a daring thief has stolen the sapphire eyes of Graynar, the stone dragon. Without his eyes, Graynar cannot animate to protect the town from the evil denizens of the wilds. A great hero is needed to track down this thief and recover the eyes of the dragon.
The code for the MonoGame RPG tutorials is available on GitHub at https://github.com/Synammon/MG-EyesOfTheDragon.
You can find the tutorial repository on my Google Drive as well.
Part 1 – Getting Started
Like when building a house, when building a game, you need a sturdy foundation. This tutorial lays the foundation for our game by building the state manager and the title screen for our game. It also builds the input handler that will be used for gathering input.
Part 2 – More Game Components
Picking up where the last tutorial left off, this tutorial creates some more game components. In particular creates a control manager and some controls, a label and a link label. It also adds another game state and demonstrates how to move between game states.
Part 3 – Even More Core Game Components
Once again, the focus of this tutorial is core game components. First, I make updates to the control manager and add in the new control, the picture box. I also create the menu structure on the start menu and wire the event handlers to make it work.
Part 3 – Even More Core Game Components
Part 4 – Tile Engine Part 1
Exploring the world is an important part of a role-playing game. For that reason, this tutorial is about creating the tile engine. Because our world is made up of tilemaps, we require a tile engine to render them. So, I create a basic tile engine in this tutorial that will be expanded on as we go.
Part 5 – Tile Engine Part 2
Since it is such an important part of the game, I will be spending a lot of time on the tile engine. For that reason, this tutorial continues to improve the tile engine. It is about having multiple layers on the map and introduces the player component.
Part 6 – Character Generator
Creating your character is an integral part of playing a role-playing game. In this tutorial, I add a character generator to generate the player character.
Part 7 – Animated Sprite
The player needs to be able to control their character. In this tutorial, I ad in an animated sprite for the player to control
Part 8 – Updating Character Generator and Tile Engine
The character generator and tile engine are working. However, there is room for improvement. As a result, I make some changes to the character generator to include a character preview. Changes to the tile engine include improved zooming and the use of a transformation matrix when rendering.
Part 8 – Updating Character Generator and Tile Engine
Part 9 – Item Classes
Having interesting and unique gear is an integral part of a role-playing game. For that reason, the main focus of this tutorial is creating the base classes that will represent items in the game.
Part 10 – Character Classes
The game uses a class-based role-playing system rather than a skill-based role-playing system. For that reason, I implement the bases class for entities and their classes.
MonoGame RPG Tutorials
Part 11 – Game Editors
Creating a role-playing game requires a lot of data. For that reason, this tutorial is on creating editors to create, read, update and delete data for the game.
Part 12 – Game Updates
After that monster tutorial on game editors, this tutorial returns to the game. It modifies the gameplay state to use a player component. It also updates the world-class and updates the tile engine, so it is more efficient in its rendering.
Part 13 – List Box and Load Game Screen
Rendering lists is a common factor in role-playing games. For that reason, I add a list of box control to the controls implemented in the game. Also, I add a screen for loading games. I also refactor the character generator, and gameplay states a little to separate the concerns of duty.
Part 13 – List Box and Load Game Screen
Part 14 – Back to the Editor
Since we still need data, this tutorial goes back to. The editor. It combines parts A and B of the old XNA Eyes of the Dragon tutorial, so it is longer, though not near as long as tutorial 11. I also include my test data, so you don’t have to enter it manually.
Part 15 – Skills, Spells and Talents
In an RPG, the characters know how to do extraordinary things like cast spells. For that reason, this tutorial lays the foundation classes for skills, spells and talents. Also, it lays the foundation for crafting items.
Part 15 – Skills, Spells and Talents
Part 16 – Quests and Conversations
An important part of RPGs is interacting with the world around you. That ranges from doing quests to having conversations with characters in the world. For that reason, this tutorial is focused on quests and conversations. It wires the basics that will be used in the future.
Part 16 – Quests and Conversations
Part 17 – Finding Loot
Finding new and interesting items is a fun part of any RPG. For that reason, this tutorial adds chests to the game that hold money, items and potentially traps!
Part 18 – Finding Loot – Continued
Picking up where the last tutorial left off, this tutorial continues with finding loot. It updates the game editor to allow the creation of chests and keys. Also, it covers adding the editor content to the game and reading it into it at runtime.
Part 18 – Finding Loot – Continued
Part 19 – Skills Continued
Since characters can do things is an important part of an RPG, this tutorial continues with the skills that allow characters to craft and barter.
Part 20 – More on Skills
Since we now have data to work with, this tutorial takes that skill data that has been developed and brings it into the game. Also, it demonstrates how to assign points to skills.
Part 21 – More on Items
This tutorial continues in the game and items. Also, it adds classes for managing items and the party’s backpack that will hold all of the loot that they have found.
Part 22 – Reading Data
So, this tutorial covers reading all of our data into the game. Also, it updates the character creation process to use a character instead of a sprite for the player.
Part 23 – Level Editor
So, having a rich, immersive world is a huge part of a role-playing game. For that reason, this tutorial starts with building the level editor so you can build your world.
Part 24 – Level Editor – Part Two
There was a great start to the level editor. However, there was a key component missing. There was no way to save a map and load it back in. This tutorial adds the saving and loading capability to the level editor. It also makes some changes to the way tiles are painted.
Part 24 – Level Editor – Part Two
Part 25 – Level Editor – Part Three
So, this tutorial makes some improvements to the level editor. Firstly, it changes the painting code to make it more responsive than it was because it was rather sluggish. Secondly, it adds some larger brushes and visual cues as to what is being drawn. Finally, it adds the functionality to be able to import and export layers and tilesets.
Part 25 – Level Editor – Part Three
Part 26 – More on Skills
This tutorial does more work on skills. Also, it adds a transition period when switching between game states.
Part 27 – Updating Components and Talents
In this tutorial, I update a couple of our components. Also, I flesh out how talents will work.
Part 27 – Updating Components and Talents
Part 28 – Spells and Effects
Where the last tutorial worked on talents, this tutorial works on spells. It also works on effects that are applied by spells and talents.
Part 29 – Weaknesses and Resistances
This short tutorial introduces the concept of weaknesses and resistances to different forms of effects.
Part 29 – Weaknesses and Resistances
Part 30 – Updating Weapons
After making the changes to damage types, the next logical step is to update weapons. For that reason, this tutorial adds the ability for weapons to have more than one type of damage associated with them. Again, this is different than the XNA tutorial series.
Part 31 – Tile Engine Update
While the tile engine was good, there was room for improvement. So, in this tutorial, I make some updates to the tile engine to make it more robust in how it handles layers.
Part 32 – Collisions
So, the player can walk around the map, but they can also walk through walls. For that reason, this tutorial adds a collision layer to prevent the player from walking through certain tiles.
Part 33 – Non-Player Character Conversations
Talking with non-player characters can be an important method of moving the story forward. For that reason, this tutorial covers how we will be handling conversation.
Part 33 – Non-Player Character Conversations
Part 34 – Non-Player Character Sprites
The game is much more interesting if the player has characters to interact with. For that reason, this tutorial covers adding a non-player character, NPC, sprite to the map and collision detection. It also wires starting a conversation with that character.
Part 34 – Non-Player Character Sprites
Part 35 – Conversations
Finally, we get to talking to the characters. I first, how how to manually code conversations. Then, in a future tutorial, I will create a conversation editor and read in conversations at runtime.
Part 36 – Animated Tiles
When I originally wrote the XNA tutorials, I requested to add animated titles to the game. For that reason, this tutorial covers how to add animated titles to the game.
Part 37 – Map Editor Revisited
Since there are now animated tiles, the next logical step was to place them on the map. For that reason, this tutorial goes back to the editor to place animated tiles and paint collisions.
Part 37 – Map Editor Revisited
Part 38 – Loading Maps
Since the level editor is now complete as the map format will not change, I add the ability to load levels in the editor and the game.
Part 39 – Characters Revisited
The focus of this tutorial is creating characters in the map editor. It also covers saving them with the map and loading them back into the editor.
Part 39 – Characters Revisited
Part 40 – Characters Revisited – Part 2
So, we could load characters into the editor but not into the game. This tutorial allows for loading maps and characters into the game.
Part 40 – Characters Revisited – Part 2
Part 41 – Spells and Talents Revisited
This tutorial creates some spells and talents that can be used in the game. The battle engine requires them, so they are being handled now rather than later.
Part 41 – Spells and Talents Revisited
Part 42 – Merchants
The player needs gear, and the easiest for them to get it if they have the coin is to buy it from a merchant. For that reason, this tutorial covers creating merchants and adding them to the game for the player to interact with.
Part 43 – Equipment
The player can now get equipment from merchants. However, there is no way to view what they have purchased, or found, or stolen. This tutorial covers rendering the items that the player has found.
Part 44 – Equipment Continued
The player has their backpack, and it renders on the screen. However, they still cannot equip the items they have found. This tutorial covers equipping and unequipping items.
Part 45 – Mobs
An important part of a role-playing game is challenging opponents to overcome. For that reason, this tutorial covers adding in mobs, or monsters, for the player to battle.
Part 46 – Combat Engine – Part 1
We have all of the pieces in place to start on the combat engine. So, this tutorial is the first installment on creating the combat engine.
Part 46- Combat Engine – Part 1
Part 47- Combat Engine – Part 2
The combat engine was missing, dealing damage to mobs and taking damage from mobs. This tutorial covers these topics.
Part 47- Combat Engine – Part 2
Part 48 – Combat Engine – Part 3
Fighting with just weapons is boring so I included spells and talents to be used in combat. This tutorial covers being able to use spells and talents inside the game.
Part 48 – Combat Engine – Part 3
Part 49 – Combat Engine – Part 4
The combat engine needed a few improvements, so this tutorial covers them. It also adds in some new equipment that can be bought from the merchant.
Part 49 – Combat Engine – Part 4
Part 50 – Combat Engine – Part 5
The combat engine works as expected. The one thing that it doesn’t do is drop loot if a mob is defeated. For that reason, this tutorial covers dropping loot when a mob is defeated.
Part 50 – Combat Engine – Part 5
Part 51 – Refactoring Game Items
So, there is an issue where you have to create a game item each time you need one manually. Because this is inefficient, I refactor game items to implement the ICloneable interface and modify the GameItemManager class to use this change.
Part 51 – Refactoring Game Items
Part 52 – Gold and Experience
Two pieces were missing in the game. There was no way for the player to get gold, and there was no way for the player to gain experience. This tutorial addresses those issues. Also, I add in potions for the player to connect to heal themself.
Part 53 – Levelling Up
There is another piece missing. The player can gain experience, but they will always be level one. For that reason, this tutorial focuses on displaying the character’s stats and levelling up.
Part 54 – Levellin Up Revisted
I introduced a bug in the last tutorial. The player could level up fine. However, they did not gain health and mana or stamina, depending on their class. This tutorial fixes that bug, and it redesigns the character stats screen.
Part 54 – Levelling Up Revisted
Part 55 – Going Real-Time
In this tutorial, I start moving to a real-time combat system. In it, you can attack and kill mobs, but they do not attack you yet. They will chase you if you get too close, though, but they will never overlap with you.
Part 56 – Going Real-Time – Part Two
In this tutorial, I continue the journey on the path to real-time combat. It covers mobs attacking the player and the player healing over time if they are injured.
Part 56 – Going Real-Time – Part Two
Part 57 – Going Real-Time – Part Three
This is the third in my four-part tutorials ongoing real-time as far as combat is concerned. This tutorial begins with casting spells and activating talents. Then, it introduces hot-keys for activation and shows how to draw targeting. It also heals mana and stamina over time, the same as health.
Part 57 – Going Real-Time – Part Three
Part 58 – Going Real-Time – Part Four
This tutorial finishes my four-part mini-series on real-time combat. It activates the spell or talent selected with the hot-key and applies its effect.
Part 58 – Going Real-Time – Part Four
Part 59 – User Experience
The user experience for the game needed some updating; this tutorial aims to fix that. For one, it was mainly a keyboard-based game with little mouse support. This tutorial adds mouse support to the keyboard-only areas of the game.
Part 60 – Quests
Finally, we get to quests for the player to accept and finish. This is the first of multiple tutorials on quests because it is such a big topic. Once completed, you can talk to an NPC, get a quest, finish it, and turn it in.
Part 61 – Quests – Continued
I wrap up with quests in this tutorial, fixing a bug from the last tutorial. Also, I update the conversation state to save what conversation you are on with an NPC.
Part 62 – Back to the Future! Uhm, Editors, I Meant editors
This tutorial was long to write and is the first of two parts. This one covers creating spells with the editor. The next part will cover talents.
Wanted to drop a quick note. I just got into Monogame development and your tutorial was immensely helpful. Awesome work! Very impressive.
A few years ago I played with the thought to learn Monogame. At this time I didn’t learn coding first. It was really painfull to follow your tutorials, but now I’m glad I did find your tutorials again. I learn a lot from them 🙂