Video Game AI

History of the Game Engine: Part 4 – RPGs Step Up to the Plate

For anyone who has even the briefest encounter with computer games, mention Role Playing Games (RPGs) and two words usually spring into their heads; Dungeons & Dragons! Despite the fact that it was a mechanical game played out laboriously on a tabletop, it the title that people think of when the genre became immortalized in pixels.  D&D—the fanboys term for this complex table-top system—was well known before anyone had the notion that the same type of gameplay would work well on computers, and boy did they ever get that right.


What is an RPG?

RPG stands for Role-Playing Game. It’s the genre of game in which players advance through a complex story-driven quest, and often have to deal with many side quests while doing so, for which their character will gain experience of the environment that improves various attributes and abilities and allows them to take on the final foe.  RPGs are most usually played by small teams of internet-connected gamers and typically each player will take some strategic role, such as a healer, warrior, or wizard, to help the whole group battle the embodiment of evil that represents their ultimate goal. Most RPGs follow the sword and sorcery fantasy genre and are driven by cooperation within the group to achieve a common goal; rather than just being a stand-alone player who shoots people in the face as with first-person shooters, with RPGs you are more likely to be a team who will stab people in the face en-mass!

Like their table-top predecessors, computer RPGs are immersive and story-driven with specific goals laid at the feet of the playing team, who will go about their task and reap the rewards if they manage to complete their trials. If they happen to come across other groups, or some other computer-driven species such as orcs or goblins while they proceed, then it can descend into a bit of a free for all punch-up, but this is mostly a strategy-heavy game style rather than just endless combat. 

From a game’s physics point of view, RPGs also represented a new direction compared to other types of games in that they involved multiple players interacting rather than just one player dealing with a number of game-generated sprites. Plainly, RPGs are a unique form of gaming experience, and one that runs via a special variation of the core game engine, and that’s worth looking at in detail.

As we have already said, the origins of the Role-Playing Games were in the Dungeons & Dragons board game. When the table-top game was launched by Dave Arneson and Gary Gygax in 1974, its sales were a bit slow-burn, probably as a consequence of its advertising being mostly through specialist outlets and simple word of mouth, but it soon gained a solid fan-base. Unlike anything else on the market at the time, it was a genre that was screaming out for computer graphics, if only the technology existed.

Actually, the first attempt to create a computer game from the content came just a year later when Digital Equipment Corporation (DEC) launched the unlicensed take on D&D as a single-player experience in the form of Dungeon in 1976. The game was scripted by up-and-coming American game developer, Don Daglow, who would go on to become one of the Mattel Intellivision programmers during the First Console wars. Dungeon was a loose take on the D&D boardgame, for which Daglow had an affection, and was designed to run on the DEC PDP-10 microcomputer, so it was never going to be a mainstream game.

19765 Dungeon Logo Art

Fans of D&D and computer games went unfulfilled for another four long years until something a bit more official hit the shelves, and that came in the form of Ultima, in 1981, quickly followed by Wizardry a few months later. Both coded for the Apple II home computer, these two titles quickly gained a huge following and prompted the developers to swiftly develop follow-up titles. RPGs had successfully made the jump to computers, and the public wanted more.  But what are the major differences in RPG game engines compared with other genres?

Features of an RPG Engine

RPGs have a number of characteristics that set them aside from other games, and are fundamental to the operation of them:

  • Side Quests.  During the journey, it is essential that an RPG has a series of smaller side-quests that are used for character building and to obtain extra weapons, skills, or items that may not be essential to the main story, but may help the player as they progress. Side quests do not usually have to be completed but the feeling is that if they are not completed then the player hasn’t got the most out of the game that they have paid what may be a serious amount of money for.  Side quests are an easy way to extend the gameplay, give the player a more satisfying experience, and make the overall game seem a much more quality and value-for-money experience.
  • A strong story. While almost all games have a story-telling aspect, the pursuit of the storyline is at its most intense. Usually set in either a historical, a fantasy, or a Sci-Fi realm, RPGs give the player skills, weapons or powers that they would not have if the game were set in more mundane surroundings.  Stories are generally about questing, where the main characters are driven to complete smaller tasks to ultimately win at the main task.  That main task may be to defeat the evil wizard, stop an Orc army, save the princess, or find some McGuffin in order to save humanity/village/way of life. With RPGs, the ultimate task maybe some long, physical distance away, involving a journey, which becomes one of self-discovery as well as being a means to connect with new characters and to collect better weapons.
  • Free-Roaming. One of the defining features of RPGs is the ability to move around anywhere—bar locked out areas—on a map that may encompass several kingdoms and different geographical features such as mountains, deserts, cities, and waterways. Being able to go to other parts of the fantasy world, even if there is nothing, in particular, to do there, adds to the feeling of realism and makes the overall experience more rewarding and fun.  You may need particular flowers for your spells, there could be hoards of money secreted around, or you may just fancy exploring. Free-roaming makes finding all of those possible.
  • Multiple players. The RPG structure doesn’t just ask for, but usually demands that a group of physical players team up and form a clan so that they can approach the many problems and combat opportunities as a team rather than individually. Think of them as the nerdy way of teambuilding. The tasks assigned to the various team, based on their skills and special abilities help the whole team meet the short term and long-term game goals. Players need to pick their roles—and their teammates—carefully so that they have the right mix to deal with everything the game throws at them.
  • Upgrades and inventory. Levelling up is one of the great things about RPGs and it is a system that makes people want to carry outside quests and the like to be able to increase their strength, fortitude, skills and magical ability. Inventory items are also essential to your journey. Most game storylines generally force the players to interact with the surrounding world and other non-player characters within it. These interactions are usually in the form of some sort of exchange, but whether this exchange is done through narration and clues to the way forward, to provide the player with a better sense of the quest, or real exchange, in terms of items depends on the game itself. Either way, as you interact, you will get something in return, and if it is a physical item, like a new sword or a potion, then it goes into the inventory. See that horde of Zombies over there? You’re gonna need a bigger sword to deal with them, and luckily you have one on your inventory.
  • Character attributes. When you start your quest, you are usually presented with a character-creation system that defines your personal preferences, within the confines of a Medieval heroic fantasy character. You could be a Mage or a warrior, or a healer or maybe a dragon master. The character attributes let you pick fundamentals—boy/girl, Mage/dwarf, Skills/powers, physical characteristics etc—which become set and unchangeable as the game progresses. But you will also have other changeable items like your clothing, your weapons, selecting different skills, etc. Customisation is the key here, so you could have two people based on the same initial character selection who have completely different looks and attributes.  

Besides these fundamentals, there could be a host of other settable or changeable items that help define the game and the path to its ultimate goal. Many of these are dependent upon the programming that has gone into the game and how the designers perceived it working.

The key element that sets RPGs aside from other game engines is the complex and dynamic interactions between all of the above features, and more besides. RPGs are immersive and expansive, with characters growing within the game as they progress. Okay, so that may not be so different from a standard FPS, but what does become more complex is the way in which the game engine and physics systems alter the capabilities and effectiveness of a group of players depending on their individual skills. The effectiveness of a group of warriors, wizards, and assorted other characters are the sum of their own individual skills and that relies on highly complex algorithms that are intelligent in nature.

Suppose, during the main storyline or a side quest, a band of collaborative fighters go head-to-head with a rival group; they could have the same number of players on each faction, and have a balanced distribution of skills, but if one team has stronger wizards, but weaker warriors, or archers or whatever, then the skills may not be evenly matched, and that may leave one of the teams in a subordinate position, despite being stronger in some areas. This kind of diversity is a key characteristic of an RPG engine, and it is what sets the genre aside from others.

This ability to make teams operate as per their abilities requires an Artificial Intelligence (AI) system that is able to manipulate the inputs to create continuity in the game. Perhaps more than any other genre, RPGs would not work in the same way without a sturdy AI system to drive them. So, the history of game engines in the RPG arena is also pretty much the history of AI in gaming.

How the Game Engine’s AI Helps

AI in computer games is a pretty complex subject that is highly distinct from other forms of computer AI in as far as it operates in specific ways but still allows a high degree of autonomy within the game. Generally, computer game AI seeks to enrich the game experience rather than to enhance machine learning or to facilitate data mining as it is with more conventional AI systems. The use of AI in RPGs is much more about driving the story forward through techniques such as pathfinding and decision trees to guide the actions of the player and to allow for alternative paths to be taken depending upon actions.

So, AI in RPGs isn’t a new subject.  In fact, computer gaming and AI are inextricably entwined, and have been since the use of intelligent features were integrated into the Nim mathematical computer game in 1951. The AI in Nim was pretty lightweight—as was most computing of the time—but it demonstrated that AI was an integral part of gaming. However, it wasn’t really demonstrated again for another 20 years, until Pong hit the consoles in 1972, but from then on, the need for intelligent features in gaming was apparent. 

Video Game AI Artwork

As the thirst for sword and sorcery games grew following the success of Ultima, many developers wanted a piece of that particular pie. The next few years saw sequels to Wizardry, coded to run on the Commodore Amiga, the Sega Saturn, and the PlayStation. Meanwhile, Ultima sequels came out progressively on the Amiga, Apple’s Mac OS, Microsoft Corporation’s Windows OS, and video game consoles from Atari, Nintendo, Sega, and Sony. 

Ultima was one of the real driving forces behind the growth of RPGs. Developed by Richard Garriott —computer-fascinated son of astronaut Owen Garriott—Ultima remains one of the most important series of games not just amongst RPGs but for computer gaming in general. Right from the very start, Garriott developed the game to be as large as possible, given the constraints of computer technology. The player could explore openly across lush grassland, swamps, oceans, and mountains, discovering everything the world had to offer, and rarely were parts gated to prevent access until certain parts of the game had been completed.

While Ultima was perceived as the first in a long line of hit RPG titles, but it was actually a progression from the little-known Akalabeth: World of Doom (1979), developed by Garriott as a hobbyist project for the Apple 2. Considered to be groundbreaking in its design, Akalabeth had a number of features that enhanced the gameplay and the feel of the game, including:

  • The use of first-person gameplay when in dungeons
  • The player needing to periodically find food to survive
  • A top-down overhead world view in normal gameplay.
  • Hotkeys used for different commands.
  • The use of Elizabethan English in text instructions

All of these elements gave the game a feeling of actually living the action and made the overall experience far more enjoyable. Flushed with his programming and financial success—Garriott sold the game for $5 a go, ultimately earning over $30,000—he went on to develop his next game, based on the same game engine.

Ultima shares many of the game engine characteristics of Akalabeth, and established many of the characteristics that are now entrenched in RPGs. Ultima I: The First Age of Darkness (1981 saw the unnamed protagonist (termed The Stranger) summoned to the land of Sosaria to defeat the evil wizard called Mondain, who aims to enslave its population. Mondain possesses the Gem of Immortality, which makes him invulnerable, so the Stranger has to undertake a journey to find a way of defeating him. Like Akalabeth, this title was also a success, and prompted Ultima II and Ultima III, following very similar storylines, over the next three years, gaining aficionados all the time. The next three episodes took a different turn and became less focused on simple good vs evil, giving players more complex situations, and ultimately dealing with issues of racism and fascism.

Ultima went on to become a long series of RPG games initially using proprietary coding for its engine, but it is notable that to date there have been two fan homages to Ultima, both coded using the Dungeon Siege engine. The Ultima series was a good money-spinner in its own right but is more notable as a demonstration of what was possible with RPGs and how AI has developed to create more immersive stories.


In the context of game engines, RPGs use a variety of proprietary base coding, including the Creation Engine, Unreal Engine, Anvil, Unity, and the CryEngine.  These and others are used to power some of the best games around, but RPGs—perhaps more than any other genre—have a large collection of freeware authoring tools that allow just about anyone to sit down and create their own RPG. Of these, GameMaker is one of the biggest, and easiest to use. The fact that RPGs can be made so successful on a huge range of fundamental game engines helps make the genre so diverse in terms of final output and means that an RPG developed using the Unreal Engine will have markedly different features and a whole new feel than one developed on the CryEngine, which is an equally good tool. The real winners here are the players, who get to experience perhaps more content provision than any other sub-section of gaming.

Now, plainly something knocked together on Gamemaker certainly isn’t going to be as polished as Elder Scrolls or any of the other major titles and probably will never be commercially viable but at a base level, they employ similar AI to make the gameplay work properly. As we have already discussed, the AI employed in RPGs is the defining element of the genre and the power behind their success, and RPGs are so successful thanks to the background intelligence that drives their content.

AI in modern RPGs is taking has two major roles; it allows playable characters to modify their characters and meet challenges that are appropriate to each collective band of brothers (that includes sisters, by the way), and it allows how non-playable characters interact with the human-driven characters in the game. Non-playable characters are an essential part of RPG and are used not just to give an area a feeling of being filled by a crowd, but also offer a means of giving the human players information or artefacts that they may need to continue their quest. 

Making Non-Playable Characters Count

A non-player character is any character in a game that is not controlled by a player. These, when used in the context of RPGs are a throwback to the original board games such as D&D, where the GameMaster would essentially be the only non-playable character and would have a role of feeding essential information to the players as well as defining their path.  In computer games, this term means a character controlled exclusively by the computer that has a predetermined set of behaviours that potentially will impact gameplay. A non-playable character may have some inherent ‘intelligence’ but normally works within a ring-fenced way.  It may have a defined area that it can work in and won’t stray out of there.  Abnormal behaviour by the playable character—such as stabbing or otherwise harming a non-playable character—may promote a negative response in other non-playables, and allow them to extend out of their normal ring-fenced area as they chase you.  Just look at the cops in GTA V; it’s a perfect example of this.

However, there is a propensity to increase the AI function and intelligence within games like this as it will ultimately give a greater user experience.  Imagine that you, as a band of players, enter a town and the inhabitants treat you as though they were real people or the army of zombies that you meet high on a mountain pass are sufficiently smart to give your team a real pasting. The possibilities are endless, but slightly scary too. An anecdote has it that while Eric Baptizat, Ubisoft’s Director of Games, was testing Assassins Creed: Valhalla, two AI-driven characters would follow him around everywhere, not just within their ring-fenced area. If he teleported to a different area, ten minutes later the two characters would come running up to join him, having taken the long way round. His designers told him that it was unintended behaviour and just something that happened in the company’s MetaAI system. Whether the AI regarded him as the new messiah or just followed him out of morbid curiosity is unknown, but such random behaviour is more likely to become the norm in games like this as the AI get smarter.

Assassin's Creed Valhalla Gameplay

And this becomes an exciting element in the development of game engine trends and character behaviour. While the AI in games of this nature is driven mainly by decisions trees and scripting, but there is now a move towards heuristic algorithms that can adapt to the changing conditions of the game. What’s more, AI developers are now using sophisticated games and routines to train AI, making them inherently more deductive from the ground up. Rather than being smarter than the average script, heuristic-driven AI will make gameplay more natural, and give the player an opportunity to enter a world that will blow them away.

Using heuristic AI, there is a potential for an added dimension where a non-playable character who you interact with may not respond as expected in a purely linear game.  You may go to one expecting to get a clue and they may decide to lead you off to a rumble with the Mage’s warriors instead. Just like real life, you end up in-game not being able to trust anyone but having to take a chance and interact with them anyway, just to be able to move forward.

RPGs are a particular brand of games that just keep getting better because of the way that the engines are running them. With many other genres, getting better just means more realistic graphics and bigger play areas, but RPGs have the potential to become much more immersive so that the gameplay becomes more believable not just by the way that they look but by how they feel too.

The fact is, that we are now starting to design in behaviour that we don’t quite understand, and are surprised at what the results are producing. RPGs are getting better and better thanks to game engines that are becoming more intuitive in nature and will naturally work with the stories playable characters in a more convincing way. The fact that RPGs have a huge mix of non-playable characters—including non-human ones—who will interact with the playable ones in increasingly complex scenarios just means that if you aren’t already playing them, you should be!