NWC603COM ASSIGNMENT TWO - AI and Games

NWC603COM –  AI and Games
                                                                                                 
Rachel Osho ID: 309740
Assignment 2 –  AI and Games

Introduction

Algorithms In this assignment I will talk about my game idea and how AI can be used within it. I will also describe the various elements that I am doing and how they apply to this concept you are proposing. In regards to the game that I am going to create a game with the layout of a maze. The game that I am going to create will consist of the main AI character and then the zombie attackers trying to chase down and attack the player.

Algorithms


Algorithms are an AI technique used within gaming  and they are a basic set of rules. The use of algorithms are very important and as a result of this I plan to implement the AI technique into my game. Algorithms will be used in my game as a way to giving the AI Characters/ Players/Zombies instructions on how to move around their surroundings within the game e.g. should the zombie be within ten feet of the AI Character then the zombie should chase and run towards the player. As I plan to create an attacking and survival game the algorithms that I set within the game will aim to give the player knowledge on how it can go about resolving a problem or either completing a task should the player come into contact with the zombie that is trying to capture them.


There are main of advantage of using algorithms within my game is one being that as algorithms are a a set of rules, allowing each individual step will have its own logical sequence. This means that it will be a lot easier for me to debug should I have any issues. On the other hand with the good always comes the bad and the disadvantage is that writing algorithms for my game can be quite time consuming.


Hacks

A hack is when an artificial intelligence entity that uses data that they are not supposed to be made accessible as this information should be prohibited. When a hack is used within a game this is often a bad thing even though they can be seen as useful,
essentially the AI will have hold of information that they are not suppose to have. Through gaining this information this can cause the AI player to react in a way that’s not expected and respond to the trigger that initially set it off. As hacks are often seen as a bad thing I do not intend to place hacks in my game, therefore I will refrain from using them as I do not AI player already having the knowledge of what is going to come next, or take place should the character set off any specific triggers. If I were to implement hacks into the game that I am creating then can often lead the game to be unrealistic for the player as a result of there not being hacks in real life, so it can be seen as somewhat unreal. Due to this the player can potentially see the game as very idealistic leading to their gamer experience being ruined and breaking player immersion and I want my player to have a good player experience

Hueristics

Heuristics can be applied to AI in gaming as it is the concept of learning from trial and error, in other words learning from any previous mistakes that occurred in order to completing its target. Often one of the reasons that gamers will implement heuristics into their game is because of path finding. This is due to the players surroundings constantly changing as its inconstant, as a result of this the AI character will need to reroute in order to get to its desired destination. So should should the AI player begin to get chased by a zombie throughout the game, the AI player will need to be able to derive at a solution quite quickly on how to escape and think fast on its feet e.g. turn left in order to get away from the zombie in good timing so that the AI player does not get killed, so good timing is very important. This is an example of how and why I plan to implement heuristics into my game.

Boids Flocking

Boids flocking is an artificial intelligence technique used in games and is a method and representation of crowd like behavior. Boids flocking is often used in gaming to represent animals in large quantity e.g. flock of birds . In regards to my game I will be using and implementing boids flocking as I want the zombies to stimulate crowd behavior. Boids flocking can be categorized into three different components of steering behaviors; separation, alignment and velocity matching, and cohesion.  By having boids flocking in my game it will enable the zombies move together in large crowds wondering around or either separately using separation, alignment and cohesion. In order to carry out boids flocking and make sure that it works I will need to include the coding for all these three behaviors. When I create my game I will also make the zombies wander aimlessly should the AI character not be with in its surroundings. Having boids flocking within my game will enable the zombies to chase down the AI character in large groups, which will stimulate the player and make my game more complex and exciting and it's to my advantage that the technique is simple to implement.

A* algorithm

A* algorithm is a path-finding which is widely used within gaming so that the players will be able to move and motion will be possible. In my game I plan to include A* algorithm due to it been the most popular path finding. I will use A* almost like a navigator for zombies so that they will be able to wandering round aimlessly in the location that I choose. This path finding algorithm will allow the zombies to come up with a route  of an estimated costs in order to derive at it's goal. Another reason as to why I will use A* is that it is faster unlike the Dijkstra algorithm, due to the algorithm help the player find & locate the path route with the best cost, by minimising costs (time, energy, distance)


Dijsktra algorithm


The Dijkstra algorithm is another path finding. I can use this path finding in my game however the main disadvantage to using it within my game is that even though it might help you derive at the shortest route, it might not be the best possible route given and is also proven to be wasteful for point to point path-finding. So for example should the player be getting chased by the zombies and the players looking for a quick get away then it will follow this path finding. This can lead to disappointment as the player can decide to try and get away using the quickest path but then find them self stuck as they can't cross the river or or get out the cave and this will then lead to the player being stuck. So as previously stated it may be the quickest route however it is not always the best one, and as a result I may refrain from using it too much in my game as it can ruin the players gaming experience.


Decision trees



A decision tree is like a branching tree diagram transferring from node to node. The purpose of a decision tree is to help you to be able to arrive at a decision, by making decisions all the way from the top of the tree all the way down to the bottom. Decisions tree in regards to gaming helps artificial characters make a decision. Boolean responses which are true or false answers (yes or no) are used to represent responses within a decision tree. Decision trees are often used as it is a artificial intelligence technique that is very simple to implement in terms of gaming. I plan on using decision tress as they display fast and easy execution. As I plan to use decision trees in my game, I will use them so that the AI character respond to how will respond to an enemy/zombie. I can do this by using IF statement within my coding for my game, so that decisions can be made. So for example an example of an IF statement that I can use is "IF health > 20 then find health pack" there's only two options to pick from which is either true or false and this makes the decision making processes a lot easier as your options are narrowed down to reach a decision. However should their be else statements this may make the decision making process more complex.

State machine

State machines are type of another decision making concept and they are much more advanced in comparison to decision trees. Even though state machines can be easy to write initially and effective. However state machines can also prove difficult to keep up with maintenance such as debugging, therefore I don't really plan on using it in my game, however this can change depending on certain things.

From the diagram above which is an example of a state machine, this is an example of how I would embed a state machine into my game. Firstly the AI character will wanders round, but should the zombie be nearby then the AI character it will go into attack mode and attack. If there are no zombies near then the AI character will result back to wandering/patrol. Then moving on to attack if the player begins to fight back then the AI character will evade. Should the player not fight back then the AI character will just stay in its attack state. Once the AI character evades and it’s health is low, then it is set to find aid to boost up its health points and lastly after finding aid the AI character will wander round. Then the state machine is set to rotate and continue in this cycle within the game.

Fuzzy logic


Majority of the time game developers will use fuzzy logic within their games that they create. A great example of using fuzzy logic within gaming is a health bar. I will need a health bar in my game seeing as my game will be a survival game. I think it'll be a really good idea if I implemented the heath bar within my game. In terms of using fuzzy logic within my game, it can be used to show the gradient (health wise). The health bar in my game will be full and set to 100 HP (health points) and then gradually should the AI player get attacked by the zombie and continue to get attacked then the health bar will act like the visual representation of the AI players health and you will gradually see it decrease every single time you the AI player gets attacked in the game(going from 100 - 0, gradually)

Q - Learning

Q-learning is a method that is a learning technique. The technique is used as a reinforcement learning algorithm, which operates through the use of the AI learning to react to an environment through positive feedback, and then later getting rewarded for it.


Q-learning can be very useful despite game developers not often using it, however it has its advantages.In regards to my game I shall not be using Q-learning. The main reason as to why I will not be using Q-learning is simply because my game is a survival game and in real live you don't get rewards for surviving in life, therefore I will not be using the learning technique as I want the game that I'm creating to have a more realistic feel. Even though previously stated that game developers do not really use Q-learning when creating a game, there are still some developers that do. Q-learning can be used within a game that are more strategy base e.g. fighting games e.g. games where you will need to beat the opponent to get to the next level, and once this happens you'll unlock a new character/ a new arena to fight in or reward the player by making the gain up within the ranking system.

Artificial Neural Networks

Artificial neural networks are learning technique which was biologically inspired. In terms of gaming this learning technique is often used within stimulation games. Often artificial neural networks that are used in games can be difficult to be defeated in games. I do not intend to use artificial neural networks in my game. The reason for this is that the game that I am creating I do not want it to be where the computer always win the game. In my game I want the player to have a fair chance of surviving, should I add artificial neural networks then this will be impractical and it just will not be able to work. Another reason as to why I will not be using artificial neural networks is that they are rather hard to implement and I reckon it will be time consuming and that time can be spent doing something else e.g. perfecting my game.

Comments

Popular posts from this blog

2. Using AI in Computer Games (Hardware constraints AI Engine)

References/Bibliography

4. Using AI in Computer Games (Pathfinding Concepts)