Saturday 30 November 2013

Dekonstruer One: Borderlands 2


Borderlands 2 is a very unique and revolutionary style First-Person shooter, developed by Gearbox Software and published by the popular 2K Games.  A sequel to the popular Borderlands game released in 2009, Borderlands 2 was released on consoles and PC in 2012.  What made this action packed game so unique, is the different gameplay elements it incorporates into its structure, while still being a fast-paced FPS at its core.  Borderlands 2 also incorporates various elements of humour into their game, helping to break the constant action feel and add another layer to the game for the player.  One of the main features that initially grasped my attention while researching Borderlands 2, was the RPG element the developers included in the game.  It seemed like a unique feature that I really wanted to try, so I purchased the game.  I was definitely not let down with the experience.

In this blog post, I will be examining the various game atoms present in Borderlands 2, as well as explain how they fit into the game and our teachings in class.  So grab your favourite gun and lets get exploring Borderlands 2!


From Left to Right: Axton, Maya, Zer0, and Salvador


PLAYERS:

To begin on this blogging adventure, I am going to give an overview of the first game atom we stumbled across is class, players!  Before we can outline the players in the game however, we need to touch on how the actual game player interacts with the game.  Borderlands 2 is mainly designed around the concept of being a single-player/co-op experience.  Multiplayer is supported in the game, allowing 4 players in the same world, but different elements in the world suggest the game was mainly designed for 1-2 players.  This is mainly evident in the car designs of the game, as each vehicle has support for a driver and a gunner.  Although it is a great element when a co-op game is taking place, the vehicles are still important in the main story for map traversal, as well a switching from driver to gunner when situations get a little hairy.  Since the game incorporates RPG elements, such as levels and skill trees, it needs to appropriately scale the enemies when a new player joins with a vastly different level than the host.  Thankfully Borderlands 2 put a good amount of time into developing this scaling system, and it performs flawlessly, creating a great player interaction experience.  Another player element included in the game that allows for player-on-player interaction, is the arena.  The arena allows for player to test their skills against one another in a gladiator style fight to the death.  Little reward is gained from this interaction, except for personal satisfaction and bragging rights.

Now that we discussed how the player actually plays Borderlands 2, we need to discuss the players that the user can take control of.  Borderlands 2 is unique in the way that it allows the player to choose from one of fours separate characters, each with their own play-styles.  First on the list is Axton, the commando.  Axtons play style is fit for those who enjoy assault rifles, as well as setting up turrets and trying to outmaneuver their distracted enemies.  Maya, the siren, is for players who enjoy focusing on the elemental side of the game.  Since many weapons come with modifiers such a fire, electricity, explosive, corrosion, and slag,  players who want to heavily invest themselves into these abilities should choose Maya.  My personal favourite character is Zer0.  An assassin type character, Zer0 is great at taking out players from far distances with his sniper rifle, as well as using his duplicate body ability to distract enemies while simultaneously becoming invisible to his enemies, allowing him to sneak away.  Finally, we have Salvador the gunzerker.  Salvador is perfect for players who enjoy running into the heat of battle with two machine guns in either hand.  He is definitely the tank of the group and should be played in this fashion.  Each player earns experience throughout the game and can level up, earning skill points.  As previously stated, these points can be used to purchase new abilities and skills through the skill tree.  Currently I am level 32 as Zer0, and I still have many different abilities and skills to purchase before I am finished with the game. 



OBJECTIVES

The main objective present in the Borderlands 2 universe is to focus on leveling up your character to a point where they can fight through different difficulty stages, eventually coming to the final battle against the main antagonist, Handsome Jack.  The player is given some aid in their quest through the many different weapons introduced in the game, as well as the different modifiers and skills that can be obtained.  The secondary objective introduced in Borderlands 2 is the side quest system.  These quests do not enhance the main story, but they are useful in leveling up your character and obtaining different weaponry to deal with enemies.  There are many different types of side quests such as fetch quests, monster hunting, and prisoner rescue.  Each on has a slightly different element than the next that keeps the player involved and wondering what will come next in the questline.

Before the player can access any of the quests in Borderlands 2, they need to find the individual offering the quest.  This introduces on of the other objectives of the game, exploration.  The player must be careful when they explore however, because like many games before it, enemies scale differently in different regions of the map.  In one section, the player may be the strongest individual present, while the next offers more challenging and tougher enemies that the player can not defeat at their current level.  This pushes the player more and more towards completing side quests and exploring the map to gain enough XP to gain levels. 


RULES

Much like the objectives of the game, the rules are very centered towards the players level and the exploration of the game world.  The first and most evident rule introduced to the player is their ability set in relation to other characters.  Depending on the choice of character at the beginning of the game, the player will be given a set ability and skill tree which cannot be altered unless they have skill points to spend.  This also means that the Siren will not have the same abilities or skills that the Gunzerker will, changing the gameplay experience.  The characters also have restrictions based on level as to what guns they are allowed to wield.  This ensures proper scaling of enemies in areas, creating a nice balance in the game.  Every gun is open to every class, however each character has a certain proficiency to a type of gun and their skills reflect this, like the assassin and his sniper rifles giving bonus XP.  Exploration is also limited to current character progress in very unique ways.  Certain areas are only accessible via vehicles, which are not immediately introduced into the game.  This means the player must complete certain objectives to gain the vehicle, allowing them to move on in the game.  

The next rule does not really act as a barrier to the character, but more of a precaution.  Each level is equipped with a recommended character level that the player can view.  What the game is attempting to do here is organize the players movements and activities, while still giving the illusion of choice.  Although the character can complete these missions at almost any time, it will be extremely difficult because of the scaling of the enemies.  This guideline is well implemented and works very well as a deterrent method in the game.

When trying to define one rule-set for the game I came up with gain XP through quests - level up - explore - find new quests - gain XP through quests and so on.  
    
RESOURCES

The resources in Borderlands 2 is what really blew me away as I played through the campaign.  Not just because of the variety of types of weapons, but the shear number of guns the player can collect.  It is very uncommon to have two identical guns on the player at the same.  This is because the game really focused on random loot drops being just that, random.  To keep everything fresh for the player, the guns in the game come equipped with different stats such as damage, speed, clip size, and reload time, as well a many modifiers such as fire or slag damage.  The developers of Borderlands 2 definitely hit the nail on the head when they boasted "loads and loads of guns" in their adds for the game.  

Although they are the primarily used resource of the game, guns are not the only ones present.  The player will also come across money, health, shields, ammunition, grenades, and class modifiers.  Money allows the player to purchase many of the resources above from vending machines scattered across the land.  It is a great asset to the player during the early stages, but as the game progressed I found myself relying more on pickups from enemies that the vending machine system.  This brings me to what I think to be the most important loot item, health!  Health is found in the form of max health modifiers, on collect health regeneration and health vials which can be used when the player is low on health and needs a quick boost.  Shields in the game are equipable items that will give the player different bonuses as long as it is equipped.  Players can choose shields that fit their particular play style, as well as different situations they believe they will face in the upcoming levels.  Ammunition and grenades are valuable resources to the player and can also be purchased from vending machines, or looted off of dead enemies.  Class mods are one of the rarest resources is the game because of the power they possess.  Class mods are used to help modify the current characters stats, as well as adding additional perks to the player.  An example of this was a class modifier that increased my assassins damage, while also giving him more health regeneration over time.  This proved to be invaluable for my assassin, as he was very reliant of stealth and did not fare well in larger firefights.  With this class mod however, he stood more of a chance and my change in playstyle reflected this. 

To control resource allocation in Borderlands 2, the player uses an inventory system, disguised to resemble a backpack where all gear, weapons, shields, grenades and money is stored.  From here you can equip weapons, destroy unwanted gear, and sell valuables to increase the characters money.  Certain upgrades can be applied to the backpack to allow more space and make room for larger weapons.



GAME STATE

While examining the game states present in Borderlands 2, I was able to confidently establish that there are three game states present in the game.  The first of which is Idle/Exploration.  During this game mode, the character is free to move where they want, collect resources, explore areas and interact with NPCs.  It is the most widely used game state and helps to lead into the next state, Combat.  This game state is usually triggered when the character gets within a certain proximity to an enemy.  Once triggered, the player has three choices, kill, be killed, or flee.  Usually the player stays within the first option, but on occasion fleeing is the only choice offered.  To switch back to the idle/exploration gamestate, the player must have no enemies aware of their presence to allow for freedom of movement.  

Finally we come upon the most unique of the three game states inescapable boss fights.  This game state is very unique in that it is similar to the combat state, but fleeing from the battle is removed form the choices.  These fights are usually triggered at the end of a stage and take place in an arena like setting.  The player can choose to leave the level at any time up until the boss, but once triggered the boss fight must end with either the boss dying or the player.  Only then will the player be allowed to leave.  

These rapid changing of state helped to keep me as a player interested in the game, giving me moments of action as well as moments of down time to relax.



INFORMATION

Information in Borderlands 2 is all dependent on the characters current skill level, current location, and characters that they have met along the way.  The main form of providing information to the player however, is through the characters and quests that must be undertaken to progress throughout the game.  This information can be anything from a characters location, to where the player will find the next boss that will open up a new region of the game world.  This information however can be restricted to players in some cases.  Certain characters will only provide information to the player if they have completed a certain quest, or have reached a set skill level threshold.  This helps with keeping the player on a set game path, while again allowing for exploration in areas where it is needed.  

Another form of giving information on the games world and characters is through the use of hidden recordings.  When discovered, the player can listen to little clips of audio from characters such as Handsome Jack and the Guardian Angel.  This helps to provide backstory to the main campaign and gives the player a reason to explore and hopefully track down all of these recordings.  

SEQUENCING

The sequencing in the game can become at times very repetitive, and in some cases boring.  The game follows a very specific set of mission rules and they all function in a similar way.  Usually this follows the trend of go to this location, kill all the enemies, collect the loot, and find the boss and kill them.  Upon completing these tasks, the player will be rewarded with money, XP, and in some cases a new weapon or resource for their inventory.  The players current experience will influence which missions are available, but upon receiving them they usually function the same way.  There is slight variations in missions, such as fetch quests and prisoner rescues, but they all function around the enter area kill everyone mindset.  To help keep these fights fresh however, the game adds different location styles, enemies, and vehicles that the player can use to fight.  Thankfully these were added, as the game would have become very dry without other elements to boost the entertainment.

PLAYER INTERACTION

The main form of player interaction in the game is to complete quests with a friend while in the co-op game mode.  To help keep it gameplay fair, friends of lower levels can be scaled up to help their friends complete missions, without getting killed all the time by higher leveled enemies.  To keep the co-operation aspect healthy in the game, all money and XP is distributed evenly to teammates.  Weapons and other items can also be traded among friends to make for an interesting bartering system between friends.  The only issue I had with the interaction I had was with a friend who was of a higher level than myself.  Since he was further on in the game, I had many story points spoiled for myself and it felt useless playing through them a second time on my single player campaign.  If the development team had implemented just co-op campaigns, this issue could have been solved and added to the interaction and gameplay experience. 

THEME

The theme that I took away from Borderlands 2 was that of a hilarious wasteland teeming with different life.  The game is very gritty in style and looks, but when the game is examined more closely, all of the comedic elements are revealed.    The artstyle of the game also helps to further introduce this decrepit wasteland style, while the cel-shading graphics help to increase the dark and dank aspects of this decaying landscape.  Although it pushed some players away from the game, it really helped to bring me in and I could not have been happier with the experience it portrayed. 


  
SETTING

The setting of Borderlands 2 takes place on the planet of Pandora.  In Borderlands 2 the player is introduced to 4 new vault hunters out to discover the second vault and gain its treasure.  However, their plan is disrupted by Handsome Jack, turning their mission from adventure to revenge.  With the help of Claptrap and the Guardian Angle, the player must locate the Resistance, get them to join the cause, and rush against Handsome Jack, possibly finding a vault key in the process! This will not be easy however, as Pandora is filled with an assortment of bandits, psychos and nasty creatures that will attempt to kill you at every turn.  


Borderlands 2 is just further proof that when game atoms are successfully implemented in a cohesive fashion, a game can give great enjoyment to the user.  This game is one of my favourite FPS' and it was a really interesting experience getting to pick it apart piece by piece and see all the elements involved in creating this classic title.




Stop, Camera Time!


So for today's little blogging adventure, I have decided that I am going to be covering the topic of cameras in Games!  Cameras play such an important role not just in allowing the player to see what is occurring, but also with setting the mood of the game and adding another layer to the immersion.  Now there are a few different types of cameras that can be used for different games and I will be getting to those shortly, but first I am going to give a little explanation to what a camera is and how it fits into our game space!

By now, you should know that a camera in a game does not really function in the same way that a camera in real life does.  It does not record images onto film or digitally and allow the player to pull them up for their enjoyment at a later time.  Instead a camera creates a technical window into which our player can view the action that is occurring on the screen.  Now, even though many of the games that we play our classified as 3D, we still are not able to play them in a 3 dimensional space. (Unless of course you can afford a 3D TV!)  It is the cameras job to capture the 3D action occurring in the game world, and display it to the player on the screen in the form of a 2 dimensional image.  In a way, this makes current generation 3D games feel as though they should be called 2D games with very nice 3D models!

This is done by the use of creating a viewport that the player can look through to view the game in front of them.  In a perspective camera, much like the ones we use in Maya while modeling our characters, we are able to view our images in what is called the frustrum.  The frustrum of a camera is the distance between the near clipping plane and the far clipping planes.  For those who may be confused, a near clipping plane will not load any objects past its threshold (set distance away from the camera), while a near clipping plane will not load any objects in the viewport that are closer than its threshold.  Now, in a renderable scene there must also be an aspect ratio.  This ratio is determined by setting the width of a scene, as well as a height, then dividing the two in this order.  Since cameras work in the way they do, with a near and far clipping plane, objects that are closer to the far clipping plane will appear smaller than objects closer to the near plane.  This is how we create distance on screen and a sense of 3 dimensions!  The other form of camera used generally is called an orthographic camera.  This camera does not create a sense of distance and is therefore generally unpopular in gaming.

A classic perspective Camera
Now that we know that it is necessary for a camera to be involved for 3D images to be displayed with distance on screen, we can understand why its so important for games!  When it comes to cameras, a developer has a very important decision to make.  How will my camera system work?  There are more options than one would think, from the simple single camera system that follows the player from A to B throughout the entirety of the game, or will my game have many cameras, making the player feel as though they are immersed in a movie.  This important decision can not only impact how the player will play the game, but also the feelings and emotions they will have as well.  For this reason, camera choice can not be taken lightly.  So, before a designer can choose how they want there camera to function, they must first choose which camera type they would like to use, fixed or dynamic.

When I think of fixed cameras, there is really only one game that stands out in my mind, and that is the God of War franchise.  I am not sure if this is by my own personal preference, or if this is the result of three years of lectures with Dr. Hogue.  Even if this is not by my own choice, I can not argue with my professor on his choice, as the GOW series has a fantastic camera system.  This is because the camera is not meant to only be focusing on the main character constantly.  In my opinion, this camera system is best used for creating a very cinematic and epic gaming experience for the player.  The camera does not follow the player on a 1-1 character to camera movement basis, instead the player works inside the camera interpolates around the screen at its own pace.  The character is always kept in the frame, while still giving the player the sense that the camera is mounted on a swivel in another area, capturing the most cinematic of shots.  The cutscenes follow this trend as they are laid out in a way that the player feels as though they are watching a movie and they are the main protagonist.

This can be seen as Kratos is not perfectly centered like most camera systems.
These systems are beautifully executed in the game, but they are not a hard concept to grasp when some thought is put into the idea.  A camera such as this could be set up in Maya with the use of locators in different positions around the current level.  These could then be exported and simple interpolations could be implemented between each of the locators.  As the players moves about the level, the camera will smoothly pan from one location to the next, giving a very cinematic and cutscene like feeling to the levels.  Although fixed cameras do have their perks, many games have been implementing the second form of camera systems, Dynamic cameras.

These cameras, unlike their counter-parts, are definitely harder to understand when it comes to implementing them into games.  As discussed earlier, dynamic cameras are those that follow the player in a 1-1 manner.  If the player moves forward on the X axis, the camera will also move forward on this axis.  Since this is the case, a designer of a game has to ensure that this camera style will fit into the mood of the game they are trying to portray.  If a cinematic feel is what they are after, they should probably stick with the fixed system.  This camera style does have the advantage of putting the player directly into the action of the character however through the use of the first person camera.  The first person camera is great for games such as where the player wants to take on the role of an entity in the game, as the camera view is through the eyes of that character.  This is relatively easy to set up, as the cameras position is centered on the head area of the character, looking in the same direction that the eyes would be.

Through the eyes of the hero - First Person View


Setting up a camera location for the other form of dynamic camera, third person, is another story.  The third person camera view has the player from an over the shoulder perspective.  Most or all of the characters body is in view, and generally allows the player a more in depth view of the space the character is holding in the world.  This can be difficult to implement into games however, as the designers have to be very aware that the camera is actually slightly behind the players physical entity in the worldspace.  This can cause problems when a character runs toward the camera, while simultaneously running towards a wall, causing the camera to malfunction or show the character through a wall.  These are the challenges facing those who decide to implement a third person camera. 

Many fixes have been implemented into games over time however, and some work much better than others.  A way that has always thrown me off personally is having the camera reset to the behind the back position, upon coming into contact with a wall, while still allowing the character to keep running.  This always disoriented me, and made for a very un-enjoyable gaming experience.  A successful fix for this problem involved having the camera travel upwards along the wall so that the player was looking down at the character.  This doesn't have the disorienting effect that the other method has and it still allows the player to keep their thumbstick pointed in the same direction. 

Hopefully this blog has helped to outline the importance that cameras carry when being implemented into a game.  Although a bad camera system may just show the player what is occurring on the screen, I believe that a great camera system can involve the player on a whole new level, making them feel apart of the action taking place in front of their eyes.










Thursday 28 November 2013

Scripting: The What and the Why.



Recently in one of our lectures presented by Dr. Hogue, we went over an exciting topic that is sure to benefit our game creation dramatically.  This topic was of course, scripting!  He went over the various uses of scripting, the different types of languages used for scripting, and how we as students will be able to include scripting into our games to save time and effort.  For this blog post, I will first be outlining what scripting is, then outlining some of the scripting languages used currently, and finally, finishing off with how our GDW group will be using scripting to our benefit!

Up until this point in our education, coding in C++ has been a pretty straight forward task.  We write the code in our .cpp files and .h files, then compile the program and run it to see if it functions.  It is a system that has worked for all these years, even though it is inefficient.  If a small change is made in the code and the programmer wishes to test it, the project must re-compile all over again to see if the change was a success.  For smaller projects, this time does not seem like large burden to the programmer, however, when a team is assembling a large project (such as our games), having to re-compile after each change can mean substantial amounts of down time.  To help combat this problem, scripting was introduced to the mainstream programming scene.

Scripts in themselves are generally small text files written separately from the main code base.  These small texts are then taken and compiled at run time, outputting some option for the user.  This allows for the rapid development of minor changes in the project, while also making the engines core behaviours simpler for the programmer. For a non-programming type like myself, this also meant that I could write code in scripting language, which I found much easier to understand and interpret for my small tasks.

Now before a script can be written, the user must realize that there are two different types of scripts that can be written.  These scripts are:

Interpreted

Interpreted scripts are usually intended for smaller tasks, as the process of "sticking together" a succession of compiled programs, is not very ideal for larger projects.  Interpreted scripts is a program where a logically sequenced series of operating system commands are handled piece by piece, using a command interpreter.  This interpreter does this, by going through the scripting code line by line, examining what is occurring at each stage.  These lines are then parsed, interpreted using the operating system and executed as they are passed over.  This is why larger systems generally stray away from using the interpreted scripting method.

Compiled

Compile scripts are what programmers use when they need to handle a larger task, but still do not wish to compile the project as a whole because of time constraints.  Similar to how C++ functions, for this style of scripting to function, we need to use a compiler that creates bytecode from the written script.  This bytecode that is written in a special format, in which the interpreter can load the bytecode and understand what is occuring in the script.  From this stage, the bytecode in loaded into a virtual machine that is residing in the script application.  While this bytecode is being loaded in, the project can run in a piece by piece format, saving the programmer their most valuable resource, time!

Since we had all of the benefits of scripting sitting in front of us, we as a Studio decided that using scripting in our program would be the most efficient method of completing this project on time.  Without the fear of needing to make large changes to the code to justify re-compiling, we as a group figured we could have a semi flexible game idea that allowed for constant modification and testing when a new idea was formed.  The only issue we had was which scripting language would we want to use?

Now, we planned on using scripting to cover the majority of our workload.  This would include using scripting for things such as previewing character animations, testing level design layouts and concepts, as well as previewing different mechanics for our game and how they would function in code.  Since we knew this all had to fit within the abilities of what our scripting language was capable of, we needed to make the smartest decision.  In class, Dr. Hogue outline many of the different languages used today.  The list was as follows:
  • Lua
  • Python
  • GameMonkey
  • Squirrel
  • AngelScript
  • SpiderMonkey
  • Ruby
  • Gmae Maker Language
  • Unreal Script
Needless to say, we had a tough choice to make.  Since our programmer James was going to be using the language the most, we first and foremost wanted to be sure that he was comfortable working with the language we chose.  So, after careful deliberation and a some time looking into each language, we all settled on the decision to use the Lua programming language.  
   
Even though it is not the most exciting Logo
Since we were starting with a fresh new language that we had little to no skill in, we decided that our first task should be to find suitable knowledge sources to use.  As it would turn out, the Lua website provided many of the resources we needed.  In their documentation section, the website provides many sourced written documents, including topics such as the implementation of Lua and the design of the programming language as a whole.  These sources were a great benefit for us, as it gave the team a starting point to work from.  When it came to specific problems we ran into with production involving Lua, Youtube came in to save the day.  Many users have uploaded visual demos, that helped us to work through our problems, when the documentation did not cover the issue, or was too difficult for us beginners.

An example of an issue our team came across very early on in the use of Lua, was the lack of libraries being included in the Lua pack itself.  Without these libraries, there would really be no use in using Lua, as it would not properly run and compile.  So, the team was faced with yet another choice.  Do we attempt to create our own libraries, or do we seek out a 3rd party one to download?  While discussing this among the group, James was able to put the issue to rest by locating a pack of Lua libraries that would successfully run and compile our scripts.

Although it seems like a lot of work to learn and implement scripts into our games for the year, it has truly proven to be an invaluable resource.  Not only has it saved the team a substantial amount of time compilation wise, but it also allows us to rapidly implement, test and either scrap or keep new ideas for our game.  The benefits have far outweighed the cons and I am greatly that this knowledge was included in the teachings for our Game Engines class.

Tuesday 26 November 2013

My Favorite Game Engine... The Source Engine!


For as long as I can recall in my gaming history, I never really took an interest into how game engines worked.  As a child, if I could throw a game into my computer and have it run at 20 Fps, I was a happy camper.  Since I grew with a sub-par PC at home, I found it difficult to run a variety of the higher end games that always looked so great on my friends gaming PC's.  I had lost all hope for running one of these graphically intense games, until in 2005 I picked up Half-Life 2 from a designer called Valve.  When I popped the game into my CD drive, I was stunned at the look of the game and how well it was running on my PC!  At this point, I wanted to know what was so special about this game that it could run so smoothly on my not so great system.  This hunt led me to an article on the at the time year old Source engine.  I instantly fell in love and began picking up any game I could find that was using this great technology.

As you may be able to guess, I still love the Source engine today, so I found it fitting that I should do a blog post on an Engine that I still use to this day.  During the upcoming blog post, I am going to be outlining a bit of the history behind the source engine, some features relating to its design and use, as well as what Valve has planned for this incredible technology in the future.

I still can not believe I could run this on my machine!
A HISTORY OF THE SOURCE ENGINE

So before I get into the technical aspects of the Source Engine and the incredible features contained within it, I thought that it would be fitting to give some background on the engine and its creation.  The first deployment of the source engine was in 2004 when it was released in tandem with Counter Strike Source.  Players were amazed at the optimization of the engine and how well the game performed, even on low to high end systems.  Released shortly after CSS was Half-Life 2, which featured even more realistic character models, animation, facial movements and ragdoll physics.   Valve was being praised for this new source engine, however it would not have been possible without the GoldSrc engine, which in itself is a very heavily modified version on the Quake Engine from years past.  This use of the GoldSrc engine can even been seen in code snippets from both Half-Life 2 and CSS.  Although Valve did give credit to the GoldSrc engine, initially referring to their engine as the GoldSrc and Source engine, it was in 2003 at an E3 conference where the engine name "Source" became the one officially used by the public and Valve employees.  Over the years, the designers and programmers at Valve have taken on the task of replacing the original GoldSrc engine code, with their own better optimized code for current consoles and PC hardware.  

Since the source engine is an ever changing staple of Valves company, they needed a way to constantly be updating these features for the players, to always improve on their gaming experiences.  To accomplish this task, Valve decided to use their already successful steam online digital distributer to constantly feed the players with new updates as well as fixes that may be required for certain games.  This has allowed the Source engine to constantly evolve, and even be used in current upcoming next generation game titles such as Titanfall set to be released in 2014.  Now that you know a nice chunk of the history behind the engine, lets get into more of the technical aspects and what this engine is capable of.

Not a bad looking Logo either!

THE MEAT AND POTATOES OF THE ENGINE!



Since the creation of the Source Engine back in 2004 many different technologies have been developed for implementation in the engine, as well as removed when they have become outdated.  What I am going to be discussing was what is currently present in the Source Engine, thanks to an information licensing sheet released about the engine.  To start, I thought I would touch on some of the assets included in the Source renderer.  These features include Direct 3D rendering on PC's, Xbox systems, thanks to the multiple CPU cores included in all of these systems.  HDR or High Dynamic Range rendering is also included, as well as 3D bump mapping on all models in the game.  For rendering the lighting in their games, the Source engine uses pre-computed radiosity lighting as well as dynamic shadow maps on character and object models.  My favorite part of the engine, the physics engine, was derived from the classic physics engine that has been in use for years.  This physics engine is network-enabled and very bandwidth efficient to not disrupt players.  Among these major technologies included, the source engine contains water flow effects, dynamic 3D wounds, cloth simulation, an advanced particle system as well as a whole host of other features that are exciting to discover.  

One of the key areas of the engine that I really wanted to focus in on was the animation of characters faces and actions, as well as the material system included.  To start though, I am going to outline some of the key ways that Valve created these life like characters that we all fell in love with.  Using the source engine, the designers were able create characters with believable character traits, as well as interactive and intelligent responses to character movements and actions.  The Source engine a realistic eye system included, which allows the NPCs to focus on either the character or different objects, not just parallel views, while also adding realistic eye bulge that is present in humans.  The simulated muscularity of the characters provides emotions in speech in body language, while the Faceposer included can also be used to craft more dramatic emotions and lip syncing.  Another animation asset included is the skeletal and bone system, as well as the layered animation system.  When used together, these two features can synthesize complex animations out of several pieces of data.  Now we come to the material system used in the source engine.  Valve really took everything into account when creating this system, since instead of traditional textures each object is given sets of materials to define what the object is made of and what texture to use.  These materials are important, as they define what the object will do when fractured, dragged along a surface, as well as its mass and buoyancy.  It is a very interactive system to use and can even have effects on NPCs or objects, such as mud slowing a character, or ice causing them to slide.  I was really intrigued by how this system works, and it shows through in the games how well it works.



Since we have discussed some of the background elements of the engine that the players know is there, but don't pay a second though too, lets discuss some of the features we interact with all the time.  These features of course are the multiplayer, AI, the sound, and the UI that is implemented in the games using the Source engine.  Since we are touching on the multiplayer first, I thought it would be fitting to discuss how robust the networking code of the Source engine is, as it allows support for up 32 players in both LAN and internet based play.  Not only this, but a complete toolset is included to for use by level designers, character animators, and the creation of demos for players to experiment with.  Since collision can sometimes run into some faults via multiplayer play, the source engine includes a prediction analysis system, that is used for interpolation collisions and hit detections of players and objects.  This makes for a much smoother online play experience for all players.  Having tested it myself many times, I can say that the multiplayer in the Source engine has worked flawlessly for me over many different games and consoles.  

The AI in the source engine is what truly helps to bring many of Valves cult classics to life.  This is evident in games such as the Half Life series, where the player is able to form strong meaningful bonds with characters such as Dr. Kleiner and Alyx Vance.  This is thanks to the advanced AI included in the Source engine that allows for these meaningful interactions.  This AI includes features like graphical entity placement for level designers to quickly control the game environment, sophisticated navigation to allow characters to run, jump, climb, and take cover.  The AI also use senses to see, hear, and smell, as well as determine whether an entity is friend foe or just an object.  The one feature of the AI that truly stuck out to me however, was the squad AI.  Upon finding survivors, they will join your party and behave like a real military unit.  The characters operate together, knowing when to advance, take cover, suppress the enemy and retreat to different cover.  It was a really immersive feature included in the source engine and helped to further the realism of the game. 

The Source engine is fully supportive of 5.1 surround for up to 4 speakers.  A high quality 3D spatialization effect is also included to give the character a sense of distance and direction of the enemies.   The engine also has a pre-authorized doppler effect included, as well as support for users to stream audio on any wave.  The audio really helps to bring to life the fights, especially when alien weaponry is involved in games such as Half-Life 2!

Finally we come to the user interface of the source engine.  The source engine uses a very simplistic approach when it comes to their UI, however it successfully gets the job done.  The main area where the UI's simplistic nature works well is in the multiplayer server browsing area.  The server browser displays all of the currently active servers for the player to choose from, as well information pertaining to each.  From this screen the player is able to filter out different settings, pick favourites, and see past servers to help with their choice.  The messenger in the source engine can also be used here for chatting with friends, as well as joining servers that friends are currently playing in.  Its a great interface and although I struggled with it at first, I now know why the Source engine includes this UI in all of their games.



WHERE IS THE SOURCE ENGINE HEADED

Now as I have previously mentioned, the source engine is constantly being updated with new content to help further the gamers experience, however there are a few different technologies Valve is working on to improve Source.  The first of these is the development of new content authoring toolsets.  Since Valve has received a heavy amount of criticism over their Source SDK toolset, in regards to being outdated and too difficult to use, Valve has invested many of their assets into creating these new sets.  The new toolsets will allow content to be created faster and more efficiently as even Gave Newell himself has called the curent tools "sluggish and very painful to use"

There have also been confirmation as to Valve creating a brand new engine which they have named the "Source 2 Engine".  The engine has been in development for some time now and currently Valve is waiting for an appropriate title to launch the engine with, similar to how they launched Source with the Counter Strike Source title.  

The final piece of technology that Valve has been attempting to integrate into their Source engine is the Image-Based Rendering system.  The system was due to release back in 2004 with the Half-Life 2 game, however it was struck of the list before the release was set.  Currently Valve is attempting to integrate this feature into their Source engine, as it would allow support for very large scenes that currently are not possible with polygonal objects.



As I stated before, Valves Source Engine is still my favorite engine after so many years of gaming.  The ease of access, the modding capabilities and the optimization are all what give players like myself such a joy from using it.  I can not wait to see what Valve has in store for this engine and what exciting technologies and games they will be able to release in the coming years.  

Half-Life 3 perhaps? 




Sunday 24 November 2013

Insomniac and Navigation, an Analysis Blog


Since the beginning of the video game revolution, one aspect of games has almost always been necessary to create an enjoyable experience for the player.  This game component that I speak of is of course Artificial Intelligence.  Without this crucial element, current generation games would not be possible, as non-player characters would have no concept of what action to initiate, to attempt to counter the player.  What I feel is at the core of video game AI, would have to be how NPCs navigate throughout the game space provided.  In one of our lectures with Dr. Houge, we discovered how navigation is presented in the Insomniac Engine from Insomniac Games.  The main focus of the presentation was how navigation of NPCs (mainly enemies) can influence the immersion presented to the character.  It was a very informative talk that covered many aspects of why level navigation is becoming increasingly necessary, as well as improved as our knowledge of AI deepens.

The lecture presented to our class was designed by one of the employees from Insomniac Games.  This employee went into great detail about the navigation systems used by the engine, and which games they applied to from Insomniacs AAA lineup.  In this blog, I will attempt to give my understanding of the talk given by Reddy Sambavaram and discuss how I feel these systems work and what sort of impact they have on the players gaming experience.  To analyse this, I will begin with the earlier works of Insomniac, Ratchet and Clank, and slowly progress through their timeline and navigation development with games such as Resistance Fall of Man, Resistance 2 and Resistance 3.  Before any of this occurs however, I will first touch on why navigation is necessary in games and what players can take away from a system that performs well.  So without further delay, lets begin!


We as gamer's are always looking for the next best game to be released.  Whether it be a FPS, RTS, RPG, or even a simple puzzle game.  We are always looking for games that will make us feel immersed in the world, games that will transform these character models into living breathing entities.  For this realism to occur and attachments to be formed, the game must have a solid AI.  For this AI to occur however, the NPCs must move and act in a way that brings their character to life.  When this navigation functions well, the player will feel involved and will feel as though the NPCs belong in the world.  However, when glitches and errors occur in the navigation systems, the players immersion can be broken, causing the game to lose its magic appeal.  This is one of the main reasons that game developers, such as Insomniac, are investing a large portion of their time and energy into creating a navigation system that feels very natural to the player and can occur without them realizing what is taking place.

In some cases, AI is a large and cumbersome task for level designers and developers.  Having to input commands for the NPC to move from point A to point B, all the while avoiding obstacles C,D,E is very expensive in time it takes to implement from a designers standpoint.  Even when this is completed, the designers must rigorously test the system to ensure that the animations flow realistically, while also following the path laid out for the NPC to follow.  Noticing this problem, many companies including Insomniac are trying to move in a more designer friendly direction, by making the movement of NPCs a more dynamic action, instead of being heavily scripted.  Many variations have come and gone in the industry, including such methods as sphere and box based approach, point and connection placement by the level designer, a 2D grid approach, as well as the widely used A* path finding algorithm method.  Now although these methods all have their pros and cons, Insomniac has moved towards a mesh based system, which allows a mesh to be placed over the current game mesh, to outline where many NPCs can inhabit and not move towards.  It is not a perfect system, sadly no system has been discovered yet, but it does offer many benefits towards Insomniacs titles.

An Enemy that would need to navigate in Ratchet and Clank: Deadlocked
RATCHET AND CLANK: DEADLOCK

Now before I get into the navigation mesh method of navigation that was touched upon above, I felt it fitting to include a short summary of how Insomniac was doing NPC navigation, before the introduction of these meshes.  In Ratchet and Clank: Deadlock, the enemies did not use any of the navigation methods used currently by Insomniac.  Instead they used a way-volume representation system with connection nodes in between.  The way that this system works, while simplistic, did the job at the time for the game.  NPCs would inhabit these way-volume spaces, doing basic animations such as idling, seeking the player, and when necessary moving.  To move from area to area however, the enemy would need to choose one of several adjacent connections.  These connections were all previously laid out and designed by the team to give the most realistic movements for the NPCs, while still restricting where they can move.  The systems used volumes as nodes for A* graph to determine which connection would be used to move in a direction to face the player.
An outline of the way-volume connection system.
Although it worked, at times the movement did not feel natural and enemies would end up in positions that were clearly not advantageous to their goals, breaking the immersion.  Insomniac decided to combat this issue with the introduction of their Navigation Mesh (nav-mesh) system in their new PS3 title, Resistance: Fall of Man.






RESISTANCE: FALL OF MAN

Since the release of Resistance FOM was release on the PS3, the opportunities for improvement pertaining to navigation had grown in size for the team at Insomniac.  The decision to implement the nav-mesh system into this title, truly led them on a path towards more intelligent AI and a more immersive gaming experience.  For the production of the this title designers certainly had a tough task ahead of them.  For the level to be designed for NPC navigation, the level designers were tasked with taking each area where NPCs could inhabit and laying out a nav-mesh in maya.  At runtime on the systems, tools in the engine would take these meshes and convert them to convex poly meshes.  After much time in the designing stage of the levels, the system actually functioned pretty well.  This was because the polys of the mesh were treated as though they were nodes in the A* path finding algorithm, allowing them to move between separate nodes based on their needs and behaviours.  It was a great revolution for Insomniacs nav system, however, the team ran into issues occurring in the PPU when navigating 8 NPCs, as well as their distance based Ai lod restriction.  This sent the team back to the drawing board to think of ways to fix this issue for their upcoming title Resistance 2.
Nav-Mesh being implemented in Maya

RESISTANCE 2

Moving into their new Resistance title, Insomniac had few goals in which they hoped to achieve to alleviate the issues that plagued Fall of Man.  The team hoped to fix the PPU bottleneck that occurred with multiple NPCs, as well as fix or remove the Ai lod restriciton, while simultaneously adding in support for a 9x nav-mesh poly load.  To start, Insomniac decided that by moving the processing of the nav-mesh system to SPU, they would be able to cure many of the problems that were associated with the PPU hitting a bottleneck.  With this issue solved,  the team was able to come to the conclusion that the convex poly idea of their mesh system was not well suited to the A* path finding.  To resolve this issue, the team implemented a triangulated system, giving the navigation system less paths to worry about when moving NPCs.  It was also necessary to use tri-mesh and tri-edges as A* nodes, to ensure that the shortest path was always being discovered.  The final change made to the mesh system was a jump up and down parameterization.  This would allow enemies the ability to climb certain objects to access more advantageous cover against the player.  To achieve this, the team added different coloring of meshes based on height and accessibility.   

Nav-mesh with the height addition


With all of these changes being done on the mesh system, the team at Insomniac need to develop a new pathing system for the NPCs.  At first, the team attempted to introduce a hierarchical path finding system.  This system however came with its issues, as at times a high-level path would be established, without a low-level path being present.  To try and fight this issue, the team implemented a path caching system to try and determine if there was a start and end point within the "successful" path.  Although the system did eventually function as the team had predicted, it just did not save the system enough time during path finding to justify being added into the system.  For this reason the team scrapped the idea of hierarchical path-finding and instead stuck with the A* method, making slight changes such as parameterizing path-queries to allow the use of selective nav-meshes by NPCs.


Another key element fixed during the development of Resistance 2 was the pathing around corners or the "bend point" of the turn.  The issue during the production was that NPCs generally had to be running around a corner for the animation to play in a semi-smooth looking manner.  The enemies were not slowing down enough during their turns in a realistic manner, as the currently implemented string pull approach was not allowing it.  To combat this aesthetically unappealing look in the animation, the designers decided to add in a Bezier curve in the bend point.  What this allowed to occur, was the enemies could arrive into the turn, target the midpoint of the bezier curve (in comparison to the bend point in the old method) and slow their actions for the animation to appear realistic and smooth.  To allow many NPCs to be completing these animations and turns at the same time, the team made sure to keep the steering system very lightweight, as to not bog down the engine.  



The final change the team came to in Resistance 2 was the use of the mesh to avoid obstacles in the environment while traveling on their path.  For the objects in the game, each NPC was given a set of escape tangents, which when used will modify the path traveled to avoid collision with the object in the worldspace.  As shown in the image below, when a capsule and a box object are loaded into the world, each object is given two different tangents to follow so as not to collide.  Based on the path of the NPC discovered using A*, the system will make a decision on which tangent path to use to avoid these obstacles.  This system came with a couple flaws however, as enemies were still getting stuck in objects, and enemies were being perceived as objects in the queries of other enemies, causing 80% of the time being spent on object avoidance alone.  To combat enemies becoming stuck in objects, the system performed a sweep check during the course of every collision check.  If the enemy would still collide with an object, the system would add 90 degrees to the path to avoid collision.  To help with the time burden of enemies seeing each other as obstacles, the designers introduced a special chache they called the "Grim Cache" (Grims being in game monsters).  Since they all contained the same threshold tolerance they had to maintain for boundaries, the Grims would function as a unit instead of individual entities, sharing information between each other on obstacles and which paths to be taken.  It was an ingenious system that ended up fixing their issue.






RESISTANCE 3

Since so much was changed during the course of Resistance 2, there was not a lot of work to be done to navigation system when it came to Resistance 3.  However, the team at Insomniac were very adamant about releasing the caches developed at the end of Resistance 2 in a more formal fashion.  To accomplish this task, the team split the SPU into three different passes.  The first of these passes was responsible for accumulating a list of all of the objects that would be in the path of moving NPCs.  Next up was for the SPU to gather all of the boundary information of the obstacles and ensure that no NPC would get stuck in the object, or avoid it in an unrealistic fashion.  Finally, the last pass would review the second step of the process and ensure that all of the tangents for the NPCs are set correctly and avoiding all the objects.  

One of the more exciting and visible features that the team included in Resistance 3 was using custom links to further include the vertical movement of enemies.  To allow the designers to add these custom links for things like jumps, ladders, etc. The team implement a box system for links instead of points on the mesh.  These boxes were more adaptable when it came to level changes and allowed the designers to place the link and not have to worry about them at a different point in time.  This worked really well with the A* approach as these edges (or clue edges) allowed the NPCs a more dynamic movement style instead of on the ground linear movement.  In Resistance 3, we can see enemies jump from one rooftop, across a clearing to another, all because of these custom links implemented by Insomniac.  It helped to really enforce the personality of the NPCs, as it really gave the illusion that they were thinking and communicating, while trying to get to the best position to thwart the players efforts.  


An NPC uses the custom link to climb the wall!
CONCLUSION

Before learning about how Insomniac handles their navigation, I was unaware of the challenges that came along with moving an NPC from point A to point B.  With the evolution of the AI and navigation we as players are starting to realize the potential for games and how NPCs can be given real emotion through there actions.  I can not see this area of the industry slowing down and I can not wait to see what the big name companies will bring to the table in the coming years. 



  


Friday 22 November 2013

Artificial Intelligence in Games. The Good, The Bad, and The How!


Since the dawn of video games, programmers and designers alike have been attempting to accomplish a feat that can make or break any great title.  What I am referring to of course is making non-player controlled characters in games, react as though they were being controlled by a living breathing human.  Since we first picked up a controller to play Pong, we have been required to implement human behavior into these games so that the person playing feels as though they have a challenger always waiting at their fingertips.  During our time in class, we have learned what Artificial Intelligence is, and have been shown different ways in which AI was successfully and unsuccessfully implemented into games.  Over the course of this blog post, I am going to be covering some examples of great and terrible AI, as well as explaining some of the techniques used to implement AI into current game titles.

One of the first and most basic, albeit difficult, forms of Artificial Intelligence can be seen in Pong

THE HISTORY OF AI

Before we get into the bulk of the blog about AI, I felt that it would benefit you the reader to know some of the history behind AI and why it was developed in the first place.  Although the idea of artificial intelligence has been around for thousands of years, it was not until the 1940's that mechanical AI was truly taken on as a study by mathematicians and philosophers.  One of the key contributors to the field of artificial intelligence was Alan Turing, whose theory of computation stated that a machine that shuffles symbols such as "0" and "1", could come up with any conceivable act of deduction.  This theory eventually led to the creation of the first programmable digital electronic computer.  Form this point the study of AI flourished, leaving many people amazed at the way computers could now solve word problems and prove logical theorems.  Many believe that the 1990's and early 2000's saw the greatest success in the study of AI, as the technology was implemented into the fields of logistics, data mining, and medical diagnosis.  Although it has been over 50 years since the first steps were taken in artificial intelligence, we still have so much to discover in this ever growing field.

Alan Turing, considered by many to be the father of Artificial Intelligence.
WHAT IS AI IN GAMES

When it comes to artificial intelligence in games, this technology plays a very significant role in how the game will play.  In our current state of games, AI is still in what I like to call the childhood stage, as we really haven't achieved full human like behavior.  In games, AI is generally used on Non-Player Characters (or NPCs).  When creating these NPCs, the designers try to create a set of patterns that the entity will follow, that seems very natural and human like to the player.  Since AI is an effort to try and simulate the realistic behavior of a human in a non human entity, the programmers want to try and remove the human designed element from the NPCs in the game and instead make the NPC feel like a real individual.  When this is done successfully, the NPC will have very natural movements through the game space and will react to situations in a similar way the you or I might.  This creates a great sense of immersion for the player and can lead to some pretty phenomenal games.

GREAT AI IN GAMES

As I stated above, the AI in a character can be the difference between a hit game release and a complete flop.  Here are a few games that I feel really integrated AI into their game successfully.

F.E.A.R. SERIES


THE SIMS


HALO


Now I know that in any game there are examples of how the AI is flawed, however I feel that the games listed above are great demonstrators of how AI can be successfully implemented into a game.  F.E.A.R. earns a spot on my list not only because of how the AI work in the game, but the technology that was implemented to allow these behaviors.  Having designed their AI system from scratch for the game, meant that they were able to implement their new planning system that had the enemies generate context-sensitive behaviors and actions that were all decided in a single frame of the game.  This meant that enemies not only reacted in human like ways, but it was also a fast and realistic process.  Some examples of these in game behaviors are enemies using set cover points, as well as tipping objects and opening doors to gain access to more advantageous cover points.  The enemies in game also work in tandem with other NPCs to perform various military maneuvers such as flanking and suppressing fire.  

The Sims is a personal favourite of mine from back when I was a kid.  Now that I am starting to learn more about how games function, I never realized all of the AI elements that were present in these games.  The main game I will focus on is the Sims 3, as it is one of the most current titles and features the most elements.  Why I believe the AI works so well in this title, is because of the sense of life the game gives to each character (including NPCs.)  Characters will go about living their lives in the town regardless if the player interacts with them or not.  Each character has a set list of basic desires and needs that are used to determine NPC activity and what task they will perform next.  To help with the implementation of these behaviors the designers created each object as a smart object.  What this meant was that all of the data that pertains to an object is stored together to allow easier accessibility from the AI standpoint.

Finally on my list of great AI examples is the Halo series.  Having spent many hours investing my time into beating the main campaign of the game, I can say with confidence that Bungie did an excellent job when it came to AI in Halo.  This is evident in the way that enemies work together to employ suppressive fire for enemy teammates, while simultaneously searching for a new area to give themselves cover.  The team at Bungie also put a lot of detail into showing when enemies react to your attacks by taking cover and performing actions like throwing your own grenade back at you.  Situational AI is also implemented in Halo and can be seen when a higher ranking enemy is killed during combat.  In most situations the smaller grunt soldiers will lose morality and begin to flee from the player.  This tactic really adds to the immersion the player feels in the game, by giving the enemies their own personalities.  Since Halo Combat Evolved, many games have implemented the "behavior tree" (trees of tasks are combined together to create AI) form of AI implementation that we can see throughout the game.  

THE NOT SO GREAT AI EXAMPLES

Now that I have touched on the good, I need to touch on the bad.  These games portray some of the worst AI I have come across in my life of gaming.

CRYSIS 2


JUST CAUSE 2


DEAD RISING 2


Although I loved playing the three games listed above, the one thing that kept me from logging some serious hours into them, was the terrible AI.  In Crysis 2, the character has the choice to use many different abilities to dispatch the enemy.  Although one of these options is stealth, I found that at times the enemy would detect me while I am behind a wall on the other side of a house.  Other times, I could be standing directly in front of an enemy and my character would stay hidden from view.  Although the game looked great and the gun-play was fun, I still feel as though the game was missing an element that could have been greatly improved on.  In Just Cause 2, the enemies are the polar opposite.  At every turn they seem to detect the player and will immediately engage him.  The problem with this however is that the enemy seems like they are a commando on a suicide mission.  Rarely does the AI script force the enemy to find cover, and it is not uncommon to see an enemy jump right in front of a car while chasing after the player.  Although this can lead to some hilarious results, it really broke the immersion of the game and took away the humanity of the NPCs. Finally, we have Dead Rising 2.  In all my years of gaming, I think that this game has some of the worst character AI I have come across.  Since a fair chunk of the game is derived of escorting survivors, you would think that the AI would be a well oiled machine.  While playing however, characters will become stuck in groups of zombies, will rarely use the weapon given to them, and at times will stop dead in there tracks and quit following the player.  This made for a very frustrating experience as the whole game has a set time limit and every second is precious.  Although I did enjoy them at times, these game just reinforced the fact that artificial intelligence can either make or break a game.

And at times beat you at your own game.
CONCLUSION ON HOW AI FUNCTIONS IN GAMES.

I now understand why we were enrolled in an animation class before we tried our hands at engines and how AI works within them.  This is because for AI to function properly in a game the animations must be generated in tandem with the AI behaviors.  However, these animations cannot be done correctly if they do not inherit a path behavior, and for these paths to be determined, many games look the A* algorithm.  The A* algorithm is the perfect option for this, as it does not necessarily find the shortest path (a very expensive thing to do in a large world), but it instead finds a path for the AI to use.  This is very evident during certain chase sequences during games such as Assassins Creed.  While the player is outrunning the enemy, the AI has to be constantly creating new paths for the pursuers to be using, otherwise they would not be able to catch the player.  This means that the A* has to be constantly checking for objects the guards will have to run around, or tables that they may be able to vault.  Once these paths are locked in, the game will play out the appropriate animation, creating these grand chase sequences.  To make sure it is fair for the player however, the AI must always reference back to the behaviors and states of the NPCs to ensure basic principles like "Is the character in view" and "Am I still with my allys" is being checked.  Otherwise, the player may be stuck in an endless chase or battle that they cannot win.  

Scripted sequences in game can also be related in a way to how the player perceives the artificial intelligence in a game.  An example of this can be the random encounters that players interact with in games such as Grand Theft Auto V.  During these scripted sequences, the player gets to choose how they want to interact with different scenarios, such as a store being robbed.  Although the scene is scripted into the code, it gives the player a feeling as though the NPC made the decision to rob the store via there own decision.  This helps to give the game world a feeling of life, making NPCs seem as though they make their own choices, with no influence from the game itself.  

One of the higher end ideas that are implemented into the AI of games is strategy.  What strategy means to me is how the enemy I am facing is going to interact and use the world around them to work against me.  In the games this can be something like running to get a new gun when out of ammo, or using player suppressing fire to move to a new position.  This form of strategy can be seen in the Half-Life games, when enemies will work together to move into different positions and attempt to flank the player from the sides and back.  Most of these actions however complex they seem, usually can be traced back to using the A* search methods to effectively plan these routes for the AI.  To handle most of these complex actions like suppressing fire in tandem with movement, we break up the actions into smaller categories such as behavior trees or state machines.  When the enemy teammate is firing, this enemy will use A* to find a path from position one to two and so on.  Once there the behavior will switch from movement, to firing upon the enemy.  Although to the player it seems like a complex system of interaction, in actuality its just a series of linking behaviors between the enemy units.

What I have mainly taken away from these teachings of artificial intelligence is how simplistic some of the more complex sequences can be.  I cannot wait to see where the future takes us with AI, not only in the game industry, but in our human lives as well.

Robot Butlers perhaps?