AI&Games Assignment2
Stealth games need to have strong AI systems to give a real feeling of immersion to the player that anything above a whisper or straying too close to an area not covered in shadow or descending from a rooftop at an unfortunate time could lead to being hunted by an entire city watch and a bloody death. The AI in dishonoured uses algorithms and heuristics as a result since the player has many options of approach, so using algorithms to patrol specific areas of the environment also being alerted if the player isn’t not behind cover or in sufficient darkness or being attracted by a gunshot or explosion as well as dead bodies.
Heuristics comes more into effect with the pathing since the player can climb buildings and there is often multiple ways of doing so, having non-player characters struggle to give chase by getting stuck or taking ages to decide the best path up. Heuristics will alter the algorithm of the NPC to find either a better solution. Some games these days that if they can’t find a suitable solution to getting stuck or not finding a path they’ll teleport to an open space or near the player such games include Skyrim and GTA 5.
AI hacks are often a result of poor AI design and often used to increase difficulty, such as AI having resources they shouldn’t have or knowing your build order, so it can instantly counter your units or actions this can be found in real time strategy games such as star craft and age of empires. Age of empires would monitor the resources and actions of the player and if it started falling behind on resource nodes such as mines for gold or stone it would cheat and give itself a resource boost. Star craft 2 can have an AI that utilizes graphical APIs to take rapid pictures of the game and react to what it sees so it keeps track of its resource quantity and if it has enough to build a unit or building. A Modder then altered the AI so it’s now capable of making 500 decisions per minute or around 2000 APM (actions per minute) in a match. The best players in the world have around 300 actions per minute.
Hardware constraints can include many things from graphics cards, memory to monitors/display outputs, for example something like the original Pokémon games and Mario on the Nintendo Gameboy where they were restricted around 160x144 and to a single colour palette of four shades of the same colour. Another example would be a the original Crysis game which would run poor or was even unplayable without borderline top spec hardware of the time (2007) This also cause some review outlets to criticise the developers for having such a steep hardware requirement, as not having sufficient hardware would result in incredibly low frame rate which means the image you see will appear like a slide show giving a janky feel or just out right crashing on launch. First person shooters are one of the genres that relies heavily on having a high but also sustained frame rate/frame timing since if either is low or out of sync the game-play will feel off and the animations will be less fluid creating a lesser experience. Smartphones often have very simple mechanics such as clicking on buildings or the match 3 styles of games and usually have a cash shop to make progression easier or to skip entire segments of the game. Such games also are very light on AI meaning the performance impact can also be minimal. That said more AI intensive games are making their way onto App stores such as Fallout Shelter which is like a diet Xcom: enemy unknown which has quite complex AI since it’s a mixture of tactics and base building. On older phones the performance would be unbearable since a lack of performance would result in huge amounts of lag (the time it takes for your input/actions to have an effect in the game) when the screen is covered with NPC’s fighting or one of the rooms catching fire or being invaded by rad roaches. PC developers are often have the most leeway when it comes to AI since the systems generally have a reasonable processor allowing for more complex AI though when it comes to strategy games the developers can still be lazy have the AI hack to give the impression that the AI is more complex or harder than it actually is. Although PC developers often also need a wide range of minimum and recommended specifications since there is so much variation in GPU’s, Memory, PSU’s and operating systems (Windows/MAC and Linux).
Boids was a computer model of coordinated animal motion such as bird flocks and schools of fish and was based on three-dimensional computational geometry which is generally used in computer animation or computer aided design. The basic simulated flocking creatures were designed boids and the standard flocking model is made up of three steering behaviours which detail how an individual boid manoeuvres based on the positions and velocities of its nearby flock mates. Individual boids have access to whole scene geometric descriptions but the flocking requires that it reacts only to flock mates in a specific range around itself. The range is characterised by a distance (measured from the centre of the boid) and an angle, measured from the boids trajectory of flight. Flock mates outside the local range are ignored, this can be likened to a limited model of perception but is generally thought more correct as a defining region in which flock mates influence a boids steering. It included predictive obstacle avoidance and goal seeking. Obstacle avoidance allowed the boids to fly through simulated environments while dodging static objects. For applications in computer animation, a low priority goal seeking behaviour caused the flock to follow a scripted path.
A couple of examples include games like "Knights of the old republic and Fable" both of which use a system in which a light sided/good interaction with npcs means the majority or npcs will have a positive response to you. Whereas a dark sided/evil interaction will receive negative reactions from npcs. Of course, the scale doesn't go from one end to the other instantly it’s a gradual effect that acclimates over the course of the game (basically taking a bunch of binary choices and turning them into a fuzzy value).
A* search algorithm is one the most popular techniques for finding the shortest path between two points in an area. A* was designed to combine heuristics such as Best-First-Search (BFS) and Dijkstra's algorithm. Unlike Dijkstra's and best-first-search A* doesn't randomly select a node to move to it will select what looks the most promising/cost efficient node. f(n) = g(n) + h(n) g(n) is the cost (distance) of the path from the starting point to another point n and h(n) is the estimated cost from point n to the goal. Point A=7 and to move to point B costs 1 so the final cost is 8 Breadth First Search examines all directions which is useful for regular path finding as well as procedural map generation, flow field path-finding, distance maps and other types of map analysis. Dijkstra's Algorithm (also called Uniform Cost Search) prioritizes which paths to explore. As opposed to exploring all possible paths, it prefers lower cost paths. It allows for assigning lower costs to encourage moving on roads and higher costs to avoid environments such as forests which could have more obstacles, using higher costs to discourage going into those areas. When movement costs vary this is used in place of Breadth First Search. Dijkstra’s Algorithm works well to find the shortest path, but it wastes time exploring in directions that aren’t promising. Best First Search explores in promising directions, but it may not find the shortest path. The A* algorithm uses both the actual distance from the start and the estimated distance to the goal. Having decision trees really helps AI feel more real by making choices like what a player would make such as can it see the player? Yes, no or maybe? If yes, then it can give chase or sound an alarm or attack. if no then it can continue its patrol route, however if its maybe in which maybe it heard the player or say something in the shadows it may go into an alert state to check out what the disturbance was. Basically, starting at 0 and moving down a tree of choices. Another example is if the AI is using a ranged weapon with ammo, such as does it have enough ammo? Does it need to take cover while it reloads? Does it need to swap weapons so on so forth.
Q-learning is a type of algorithm that is designed to improve the AI over time or attempts, an example is if an AI was in a building and its goal is outside there would be a value for each room and its goal however each room along the way wold give a negative value until it reaches its goal. An AI with Q-learning will keep going through this process (trial and error) until it finds the optimal route/the highest reward.
Artificial neural networks (ANN) are algorithmic constructs that allow machines to learn such as voice commands, managing play-lists and image recognition. A general ANN is made up of thousands of artificial neurons stacked in rows called layers forming millions of connections. Often layers are only interconnected with the layers either side of them through inputs and outputs. There are usually four essential layers of neurons; Convolution, Activation, Pooling and Fully connected.
Advantages of ANN's is that they can learn in a nonlinear way such as seeing features in images that aren't immediately obvious. Such as items in bad lighting or piles or partially obscured by other objects, the activation layer serves as a kind of highlight tool for the easily spotted and harder to see objects. A neural network designer can then gather the subsequent layered configurations and filter them to receive higher-level information. Meaning that it will then take a portion of the information and slowly build up layer upon layer and in the fully connected layer the pooled feature maps are connected to nodes on the output side and that represent the items that the ANN is learning to identify such apples, oranges and pineapples. As for how I would implement an artificial neural network is that honestly for the type of gaming I am aiming to create it just is not a realistic goal not to mention complete over kill and would be a waste of time for very little gain, this is shown in the world where ANN’s are occasionally used as demonstrations for games of Chess or Go where a lot of processing power is required with little else which is why ANN’s are more suited for voice/image recognition.
The first option is an isometric survival shooter as these types of games have been quite popular over the past couple of years with engines such as unity and unreal (E.G. The Wild Eight) making it easier to create these types. This also means that there is generally a fair number of tutorials and guides to help with creating your own and helping if you get stuck in places.
My second option is going to be a hack and slash action role playing game like Diablo and Torchlight, I chose these two because they share quite a few similarities from the camera perspective to how the enemies behave and even the combat is not too different. The combat is usually wave/mob based sending a lot of enemies to swarm the player with the occasional boss fight often a larger more defined enemy model with larger harder hitting attacks. This means mechanically that the games I’ve chosen are similar enough that I can swap later down the line if I feel one would work better than the other. The biggest difference would be in the character progression such as different weapons and how they are acquired, survival games usually revolve around weapons dropping from the enemies or pickups around the environment. Player progression in ARPGs is often a more complex with statistics such as strength, dexterity and stamina etc whereas the weapons for this type of game drop from bosses or can be bought from vendors and sometimes crafted.
I’m hoping to include Boids flocking in the design of my game to give a crowd feeling as I’m planning to use zombies or a something similar and the effects of boids flocking seem like a good match of having a horde of enemies freely roaming in a large horde and splitting into smaller groups but re-joining the mass later. What is Boids Flocking? Boids was a computer model of coordinated animal motion such as bird flocks and schools of fish and was based on three-dimensional computational geometry which is generally used in computer animation or computer aided design. The basic simulated flocking creatures were designed boids and the standard flocking model is made up of three steering behaviours which detail how an individual boid manoeuvres based on the positions and velocities of its nearby flock mates.
These three behaviours are cohesion, Alignment and Separation, Individual boids have access to whole scene geometric descriptions but the flocking requires that it reacts only to flock mates in a specific range around itself. The range is characterised by a distance (measured from the centre of the boid) and an angle, measured from the boids trajectory of flight. Flock mates outside the local range are ignored, this can be likened to a limited model of perception but is generally thought more correct as a defining region in which flock mates influence a boids steering. path-finding is how a computer controlled artificial intelligence navigates between points which is pretty much based off Dijkstra’s algorithm for finding the shortest route, Dijkstra’s is an uninformed algorithm for specific situations and this lead to a more general algorithm which is A*.
In the game I am creating A* search algorithm is probably what I will use as A* has heuristic functionality whereas Dijkstra’s has no heuristic and at each step picks the cheapest edges. A* is basically a guided version of Dijkstra resulting in using a heuristic to pick a direction. Dijkstra’s is often used in applications such as google maps and a good choice for games with simple mechanics like the classic Mario games on the Nintendo handheld (simple 2D) or general AI that doesn’t need to anything else than get from point a to point b or to just chase a specific object as such Dijkstra’s is uninformed the problem comes in when you more complex environments that may cause problems such as getting stuck. A* search certainly has its share of problems in the sense that its decision making is heuristic based which can be a great advantage for it however if the heuristic it depends on is lacking for a specific situation it basically fails so well put together thorough heuristics are needed so it can function efficiently. A* search has a history of struggling in strategy games such as Age of empires and civilization in which it needs to move large groups of units and has a habit of units getting stuck in or around objects such as forests in Age of empires units would get stuck in small gaps as they tried to pass through the forest while some would attempt going around. A* search has proven much more effective in games such as counter-strike and other first-person shooters where it doesn’t have as many units to control, this may be due to A* having a hard time calculating the optimal route for potentially hundreds or thousands of units with limited resources such as CPU and memory.
Heuristics comes more into effect with the pathing since the player can climb buildings and there is often multiple ways of doing so, having non-player characters struggle to give chase by getting stuck or taking ages to decide the best path up. Heuristics will alter the algorithm of the NPC to find either a better solution. Some games these days that if they can’t find a suitable solution to getting stuck or not finding a path they’ll teleport to an open space or near the player such games include Skyrim and GTA 5.
AI hacks are often a result of poor AI design and often used to increase difficulty, such as AI having resources they shouldn’t have or knowing your build order, so it can instantly counter your units or actions this can be found in real time strategy games such as star craft and age of empires. Age of empires would monitor the resources and actions of the player and if it started falling behind on resource nodes such as mines for gold or stone it would cheat and give itself a resource boost. Star craft 2 can have an AI that utilizes graphical APIs to take rapid pictures of the game and react to what it sees so it keeps track of its resource quantity and if it has enough to build a unit or building. A Modder then altered the AI so it’s now capable of making 500 decisions per minute or around 2000 APM (actions per minute) in a match. The best players in the world have around 300 actions per minute.
Hardware constraints can include many things from graphics cards, memory to monitors/display outputs, for example something like the original Pokémon games and Mario on the Nintendo Gameboy where they were restricted around 160x144 and to a single colour palette of four shades of the same colour. Another example would be a the original Crysis game which would run poor or was even unplayable without borderline top spec hardware of the time (2007) This also cause some review outlets to criticise the developers for having such a steep hardware requirement, as not having sufficient hardware would result in incredibly low frame rate which means the image you see will appear like a slide show giving a janky feel or just out right crashing on launch. First person shooters are one of the genres that relies heavily on having a high but also sustained frame rate/frame timing since if either is low or out of sync the game-play will feel off and the animations will be less fluid creating a lesser experience. Smartphones often have very simple mechanics such as clicking on buildings or the match 3 styles of games and usually have a cash shop to make progression easier or to skip entire segments of the game. Such games also are very light on AI meaning the performance impact can also be minimal. That said more AI intensive games are making their way onto App stores such as Fallout Shelter which is like a diet Xcom: enemy unknown which has quite complex AI since it’s a mixture of tactics and base building. On older phones the performance would be unbearable since a lack of performance would result in huge amounts of lag (the time it takes for your input/actions to have an effect in the game) when the screen is covered with NPC’s fighting or one of the rooms catching fire or being invaded by rad roaches. PC developers are often have the most leeway when it comes to AI since the systems generally have a reasonable processor allowing for more complex AI though when it comes to strategy games the developers can still be lazy have the AI hack to give the impression that the AI is more complex or harder than it actually is. Although PC developers often also need a wide range of minimum and recommended specifications since there is so much variation in GPU’s, Memory, PSU’s and operating systems (Windows/MAC and Linux).
Boids was a computer model of coordinated animal motion such as bird flocks and schools of fish and was based on three-dimensional computational geometry which is generally used in computer animation or computer aided design. The basic simulated flocking creatures were designed boids and the standard flocking model is made up of three steering behaviours which detail how an individual boid manoeuvres based on the positions and velocities of its nearby flock mates. Individual boids have access to whole scene geometric descriptions but the flocking requires that it reacts only to flock mates in a specific range around itself. The range is characterised by a distance (measured from the centre of the boid) and an angle, measured from the boids trajectory of flight. Flock mates outside the local range are ignored, this can be likened to a limited model of perception but is generally thought more correct as a defining region in which flock mates influence a boids steering. It included predictive obstacle avoidance and goal seeking. Obstacle avoidance allowed the boids to fly through simulated environments while dodging static objects. For applications in computer animation, a low priority goal seeking behaviour caused the flock to follow a scripted path.
A couple of examples include games like "Knights of the old republic and Fable" both of which use a system in which a light sided/good interaction with npcs means the majority or npcs will have a positive response to you. Whereas a dark sided/evil interaction will receive negative reactions from npcs. Of course, the scale doesn't go from one end to the other instantly it’s a gradual effect that acclimates over the course of the game (basically taking a bunch of binary choices and turning them into a fuzzy value).
A* search algorithm is one the most popular techniques for finding the shortest path between two points in an area. A* was designed to combine heuristics such as Best-First-Search (BFS) and Dijkstra's algorithm. Unlike Dijkstra's and best-first-search A* doesn't randomly select a node to move to it will select what looks the most promising/cost efficient node. f(n) = g(n) + h(n) g(n) is the cost (distance) of the path from the starting point to another point n and h(n) is the estimated cost from point n to the goal. Point A=7 and to move to point B costs 1 so the final cost is 8 Breadth First Search examines all directions which is useful for regular path finding as well as procedural map generation, flow field path-finding, distance maps and other types of map analysis. Dijkstra's Algorithm (also called Uniform Cost Search) prioritizes which paths to explore. As opposed to exploring all possible paths, it prefers lower cost paths. It allows for assigning lower costs to encourage moving on roads and higher costs to avoid environments such as forests which could have more obstacles, using higher costs to discourage going into those areas. When movement costs vary this is used in place of Breadth First Search. Dijkstra’s Algorithm works well to find the shortest path, but it wastes time exploring in directions that aren’t promising. Best First Search explores in promising directions, but it may not find the shortest path. The A* algorithm uses both the actual distance from the start and the estimated distance to the goal. Having decision trees really helps AI feel more real by making choices like what a player would make such as can it see the player? Yes, no or maybe? If yes, then it can give chase or sound an alarm or attack. if no then it can continue its patrol route, however if its maybe in which maybe it heard the player or say something in the shadows it may go into an alert state to check out what the disturbance was. Basically, starting at 0 and moving down a tree of choices. Another example is if the AI is using a ranged weapon with ammo, such as does it have enough ammo? Does it need to take cover while it reloads? Does it need to swap weapons so on so forth.
Q-learning is a type of algorithm that is designed to improve the AI over time or attempts, an example is if an AI was in a building and its goal is outside there would be a value for each room and its goal however each room along the way wold give a negative value until it reaches its goal. An AI with Q-learning will keep going through this process (trial and error) until it finds the optimal route/the highest reward.
Artificial neural networks (ANN) are algorithmic constructs that allow machines to learn such as voice commands, managing play-lists and image recognition. A general ANN is made up of thousands of artificial neurons stacked in rows called layers forming millions of connections. Often layers are only interconnected with the layers either side of them through inputs and outputs. There are usually four essential layers of neurons; Convolution, Activation, Pooling and Fully connected.
Advantages of ANN's is that they can learn in a nonlinear way such as seeing features in images that aren't immediately obvious. Such as items in bad lighting or piles or partially obscured by other objects, the activation layer serves as a kind of highlight tool for the easily spotted and harder to see objects. A neural network designer can then gather the subsequent layered configurations and filter them to receive higher-level information. Meaning that it will then take a portion of the information and slowly build up layer upon layer and in the fully connected layer the pooled feature maps are connected to nodes on the output side and that represent the items that the ANN is learning to identify such apples, oranges and pineapples. As for how I would implement an artificial neural network is that honestly for the type of gaming I am aiming to create it just is not a realistic goal not to mention complete over kill and would be a waste of time for very little gain, this is shown in the world where ANN’s are occasionally used as demonstrations for games of Chess or Go where a lot of processing power is required with little else which is why ANN’s are more suited for voice/image recognition.
The first option is an isometric survival shooter as these types of games have been quite popular over the past couple of years with engines such as unity and unreal (E.G. The Wild Eight) making it easier to create these types. This also means that there is generally a fair number of tutorials and guides to help with creating your own and helping if you get stuck in places.
My second option is going to be a hack and slash action role playing game like Diablo and Torchlight, I chose these two because they share quite a few similarities from the camera perspective to how the enemies behave and even the combat is not too different. The combat is usually wave/mob based sending a lot of enemies to swarm the player with the occasional boss fight often a larger more defined enemy model with larger harder hitting attacks. This means mechanically that the games I’ve chosen are similar enough that I can swap later down the line if I feel one would work better than the other. The biggest difference would be in the character progression such as different weapons and how they are acquired, survival games usually revolve around weapons dropping from the enemies or pickups around the environment. Player progression in ARPGs is often a more complex with statistics such as strength, dexterity and stamina etc whereas the weapons for this type of game drop from bosses or can be bought from vendors and sometimes crafted.
I’m hoping to include Boids flocking in the design of my game to give a crowd feeling as I’m planning to use zombies or a something similar and the effects of boids flocking seem like a good match of having a horde of enemies freely roaming in a large horde and splitting into smaller groups but re-joining the mass later. What is Boids Flocking? Boids was a computer model of coordinated animal motion such as bird flocks and schools of fish and was based on three-dimensional computational geometry which is generally used in computer animation or computer aided design. The basic simulated flocking creatures were designed boids and the standard flocking model is made up of three steering behaviours which detail how an individual boid manoeuvres based on the positions and velocities of its nearby flock mates.
These three behaviours are cohesion, Alignment and Separation, Individual boids have access to whole scene geometric descriptions but the flocking requires that it reacts only to flock mates in a specific range around itself. The range is characterised by a distance (measured from the centre of the boid) and an angle, measured from the boids trajectory of flight. Flock mates outside the local range are ignored, this can be likened to a limited model of perception but is generally thought more correct as a defining region in which flock mates influence a boids steering. path-finding is how a computer controlled artificial intelligence navigates between points which is pretty much based off Dijkstra’s algorithm for finding the shortest route, Dijkstra’s is an uninformed algorithm for specific situations and this lead to a more general algorithm which is A*.
In the game I am creating A* search algorithm is probably what I will use as A* has heuristic functionality whereas Dijkstra’s has no heuristic and at each step picks the cheapest edges. A* is basically a guided version of Dijkstra resulting in using a heuristic to pick a direction. Dijkstra’s is often used in applications such as google maps and a good choice for games with simple mechanics like the classic Mario games on the Nintendo handheld (simple 2D) or general AI that doesn’t need to anything else than get from point a to point b or to just chase a specific object as such Dijkstra’s is uninformed the problem comes in when you more complex environments that may cause problems such as getting stuck. A* search certainly has its share of problems in the sense that its decision making is heuristic based which can be a great advantage for it however if the heuristic it depends on is lacking for a specific situation it basically fails so well put together thorough heuristics are needed so it can function efficiently. A* search has a history of struggling in strategy games such as Age of empires and civilization in which it needs to move large groups of units and has a habit of units getting stuck in or around objects such as forests in Age of empires units would get stuck in small gaps as they tried to pass through the forest while some would attempt going around. A* search has proven much more effective in games such as counter-strike and other first-person shooters where it doesn’t have as many units to control, this may be due to A* having a hard time calculating the optimal route for potentially hundreds or thousands of units with limited resources such as CPU and memory.
Comments
Post a Comment