Showing posts with label Adaptation. Show all posts
Showing posts with label Adaptation. Show all posts

Friday, November 8, 2013

Procedural Content Generation on a MOBA genre videogame - Part 3

This is the last part of my post about my thesis project, I recommend reading Part 1 and Part 2 if you haven't already!

Character Adaptation System

Finally, the last part of this post is here, and I'll be talking about the final part of the project, which is the Character Adaptation System (CAS).

Before getting into implementation details, I'd like to talk about how is the common MOBA character composed.

 Traditional MOBA character

The common MOBA character comes from the RPG paradigm, where the player controls a character that is composed by a set of attributes and skills that determine its capacities. When the character accumulates a certain amount of experience points, its level is increased, which allows the player to choose how would he like to improve his characters capacities and therefore be stronger. Because of this, the level is directly mapped to how powerful a character is in the game.

In a MOBA, characters follow the RPG paradigm, where the player needs to increase his character's level in order to increase its attributes and abilities to become stronger. This progression happens in a discrete way, where (leaving modifiers like items aside) the character won't become stronger until the experience threshold is reached, which could take some time. 

This way of making a character progress through the game has as a goal the accumulation of experience points in any possible way to reward the player with more power. I'm not saying this is bad or anything, this is what we are all used to do while playing an RPG and it feels just right. But how about changing it a bit??

Why change what isn't broken? You may be right, but I decided to do this to try to address the problem MOBA developers face every time they release new characters into their game: rebalancing.

When a new character is released, they are supposed to be all fun and unique and with a very well made design. The problem here is that the bigger the character pool offered by the game, the harder it seems to be for developers to maintain every character in equal ground. Having played years of League of Legends, I've always criticized the constant rebalancing of characters done with each new champion update, and to me this means that the difficulty of adding new champions to the game is proportional to the size of the champion pool.  Meaning that at some point Riot (for this particular example, this applies to most MOBA's in my opinion) will have to stop spitting out new champions, not because they will run out of imagination but because it will be so freaking hard to rebalance so many champions and do it right.

CAS design

Following this train of thought, I decided to change the core by which the characters are created and maybe fix the problem. I decided I would take away the necessity of creating new characters by hand in order to add new content to the game. To do this, I would need to implement some kind of system that would be able to let the player choose how he wanted to play and kinda "create" their own unique character as the game progresses.

For this I created the CAS, which changes the RPG paradigm and removes the level mechanic embedded into the character to switch to a continuous progression system. Players will make their characters stronger not by earning a certain amount of points, but by fighting.

"But fighting happens all the time and is the way you usually earn experience points!", that is completely true, but with no experience point to tell us how much that fight was worth, what do we have left? What happened during the fight, and this is exactly what the CAS system uses to make a character stronger.

When the player gets into combat, he will play his way, using the skills he chose to achieve the results he wants to achieve. When leaving combat, the CAS will interpret every action performed by the player during the combat phase, and will determine a set of attribute bonuses to be applied to his character to encourage the player to keep playing his way and be more effective by doing so.

This is easier to explain with an example: If a player likes to play defensively, during combat he will do things like use shields and protect allies by taking damage for them and things like that. After combat, the CAS will reward him with attribute bonuses that will let him do exactly what he dide during combat more effectively. 

It's important to note that the bonuses given by the CAS are all tied to how effective the player was while fighting, meaning that if the player misses an attack, he will not get a bonus for this. Likewise, if the player hits the intended target when he casted the skill, he will get a bigger bonus than if he hits a different target.

By now you should (I really really hope) understand the basic behavior of the CAS and how it differs from the typical character on a MOBA.

CAS implementation

Each skill in the game (all actions besides moving are skills, including auto-attacks) has a special routine that interprets what happened during combat, and then stores the corresponding bonuses for when the character leaves the combat state. We could say that the CAS is actually a set of smaller systems, where each system interprets the combat information in their own way and then define the bonuses to be applied. Therefore, the CAS is actually an abstract system that is not implemented by itself, but is composed of at least one skill monitoring the combat actions of the player.

The important part of the implementation lies on the logic behind the behavior of the skills. The CAS will work as long as there's one skill that follows this loop of events:
  1. Use
  2. The skill does what it has to do
  3. The outcome of the usage of the skill is interpreted. Did the projectile hit the intended target? Did damage to an enemy? Did the shield broke while absorbing damage? Etc...
  4. The result of the 3rd step is stored in a buffer inside the skill class. This information represents the bonuses that will be given
  5. After the character leaves the combat state, the buffer of the skill is read and the corresponding bonuses are applied to the attributes
With that loop, we control the way a character progresses through the game by the usage of skills, which is vital to be able to do anything at all.

Skill acquisition vs Item acquisition

At this point I've talked about skills here and there but I haven't actually explained how is the player supposed to get them. This is another thing I've changed when compared to a common MOBA.

You still earn money by defeating enemies, and this money is used to buy skills (pretty much like having a store in Dota 2 that only sells active items). So by doing this the flow of events of a common MOBA is flipped upside-down.

Normally a player learns or improves his skills by directly defeating enemies, and by defeating enemies they are able to buy skills that increase their attributes. With the CAS, players defeat enemies to increase their attributes and buy skills with the money they earn.

When the players start the game, they all start with characters with the same attribute values, and a 2 skills: the basic-attack chosen by them, which can be either ranged or melee depending on what they want, and another skill that will help them develop their character towards certain play-style.


Well that's all there is to my thesis project. I've tried to give a twist to the MOBA genre and I think I managed to hit something interesting. The map generator neither the CAS are perfect, but I think they are a good starting point to further develop the use of PCG on a MOBA game.

Thanks for reading the whole thing and I hope you enjoyed reading it :)

Please feel free to ask ANYTHING regarding this project, I'll be more than glad to answer your questions! 

Sunday, November 3, 2013

Procedural Content Generation on a MOBA genre videogame - Part 1

Its been a year since I started doing research on Prodecural Content Generation (PCG), and on October 28th I presented my thesis project, getting the highest grade, yaay!

As the title says, the project was a prototype of a videogame of the MOBA genre (Multiplayer Online Battle Arena, think of League of Legends, Heroes of Newerth, Dota, etc...), and it involved creating a MOBA game that relied heavily on PCG to create most of its content, thing that hasn't been done that I'm aware of.

On the common MOBA, developers provide most of the content of the game in the form of new and interesting characters to play. Each character is supossed to be new and refreshing in order to stand out among a huge pool of characters. The problem here is that the more characters the game has, the harder it is to create new ones, and thus comes the problem of the constant rebalancing that (I mostly play LoL or Dota 2 so I will be using those for examples) the developers have to go through. For example: whenever LoL spawns a new champion there is always a rebalancing update involved, because the new abilities brought by this new champion overshadow other(s) champions in some way, making them less viable, and since the idea of having a ton of different things to play with is to... well... play with them, the developers are forced to make changes here and there to make everything fit and make every champion kinda stand at the same height in the matter of viability (although in competitive gameplay we all know this is not and probably will never be the case).

Because of this issue regarding the creation of new characters to bring variety to the game, I thought about a solution for this problem and came up with an interesting solution, instead of having a lot of carefully crafted characters, every player would start a game with the same character, and then throughout the game, these characters would adapt to the play style of the player and change their appearance and attributes accordingly. I've called this the Character Adaptation System.

Before I get to explain the CAS I want to talk about the map. If you have played any MOBA you know that theres little variety on the maps you play. It's usually the same map over and over and over and over and over and over again and again. I'm not saying this is a problem, but who doesn't like to experience the refreshing feeling of traversing a place for the first time? This is seen on Minecraft or any game with a procedurally generated world, new content is always welcome by players and gives a nice touch to the overall experience.

Personally I think that this staticity presented on MOBA's maps comes from the fact that designing a map is hard, thus it's not worth it to create different variations of a map that is in the core the same. The best example for this is the Magma Chamber map for LoL that was never released because the designers concluded that it was just the same as Summoner's Rift but bigger (which also led to longer games). The developers didn't want to spend time developing the same thing they already had on Summoner's Rift, so they scrapped the map and created instead The Crystal Scar, which also brought with it the Dominion game mode. Both the map and the game mode are awesome and extremely fun to play, but with this you can have an idea of the consequences involved in redisigning a map just to have a different layout of roads and things like those, its hard, so hard that the developers rather not waste time on that, and I get it, it's actually what makes sense.

But since I felt like I could address this problem (and also because I'm a PCG addict) I decided I would come up with a way to generate the map procedurally so that everytime you play a game the map is different, and I'm not talking about slightly different positioning of the towers, lanes, camps, etc... I'm talking about design concerned different, where the change is so big that it has real impact on how the map is played.

With this in mind, I created a system that is capable of procedurally generating the map from scratch, focusing on the river and the jungles (which covers a huge % of the map). The other stuff like lanes and bases generation don't have much impact on the design of the map.

This is a map generated procedurally by the system I created.


This is the video showing how the whole game works, it pretty much sums up all the features it has.


And this is last build I made. It still has some bugs here and there, but thats the final version of it.

IMPORTANT:
  • To be able to connecto to a server hosting the game, the server must be connected directly to the modem (for some reason I'm not aware of, Unity network interface wouldn't let me get through routers).
  • If you are hosting a game and it's running at non-playable fps, try leaving the "Spawn Minions" checkbox unchecked before hosting the server.

Content information:
  • The Ancient, towers and terrain textures belong to Dota 2.
  • Ashe and Blitzcrank (the melee and ranged characters you can play) as well as the minions, belong to League of Legends
  • The rocks and trees where made by Anguel Roumenov for another project we are working on. You can check out his work at sohardtoremember.com
Well, thats it for this post, on Part 2 I'll be talking more specifically about how the map was generated and will explain implementation related stuff so you can have a better idea of how this was achieved. On Part 3 I will explain how are the characters modified throughout the game and how the Character Adaptation System works to achieve this.

Feel free to leave a comment if you have any questions related to the game or how did I get the content from Dota 2 or LoL