Tuesday, 31 October 2017

2.2 The Priorities of a Games Developer


The Priorities of a Games Developer

I feel there are three main priorities to look into when it comes to developers and what they want their finished product to achieve, these are how hard they can push the hardware, the happiness of the end user and finally, the overall achievement and review of the product.

Hardware: PC’s and laptops today can be updated with the highest spec, CPU, GPU, SSD, and RAM that developers don’t need to worry about system requirements, they can push hardware to the max but in the end hardware will always win because there is only so much you can put into a game. Are some developers more interested than trying to break a computers component by developing a meatier game? Yes of course, but I think there are more games developers more interested in making a game more playable for all by making the spec requirements more appropriate for the today's gaming public.

User experience: Gaming developers or make games for the consoles i.e. PlayStation can only develop games to the spec of the console, if the game requires too much processing power that it won’t run on a PlayStation then the game is no good, it won’t sell. Fortunately, the PlayStation 4 Pro has enough power and graphical interface to run a large amount of games with a high frame rate and incredible graphics, this for one pleases the end user of the console. Using PlayStation, the playing experience is over 80% because the hardware of the console and support all games developed for the console, this is an advantage as when not all games developed for PC are unable to be played on all computers.

Reviews: Obviously the reviews of a game is going to be important to a games developer, the users will be criticising all aspect of a game because as gamers, its what we do. Now do all games developers care about the reviews? I'm not sure but does an artist create a painting and not want to hear the critics? i doubt it. Reviews link in with sales, does a developer sooner sell  more copies of the game or have better reviews.

"game programming can allow you to work on a product you love while honing your software development skills for nongame jobs or a more significant role that involves contributing to a game's content and design."(18)

I have not round many articles from programmers about what there priorities are when developing a game but Hoffman has made a very true statement, Developers makes games because its a passion, what they love doing. I can tell from reading his paper that developers are not really interested in sales figures or reviews, yes they want the game to do well but I feel to them, its more than that and its a feeling of making the drum and playing in the band.

Monday, 30 October 2017

2.3 Mobile Devices & Tablets


Mobile Devices & Tablets

Now how this topic slightly differs from the previous headings earlier in this post, is the processing power being a lot less in mobile devices from your modern day laptop. I think mobiles and tablets are important to mention because the world now operates on these devices, in the current day, I do not know one person that does not own a mobile phone. Now these mobile devices are far less powerful that computers, so why do some developers chose to make games for mobiles and tablets? well...
The low cost of mobile-phone games ties into another key advantage - the huge variation among mobile games. Since mobile games can be produced faster and cheaper than other video games, developers can take more of a risk in trying out new concepts or ideas. Developers don't stand to lose as much if an experimental game is unpopular. (4) Kittmer makes an excellent point which links back to the (2.2 The Priorities of a Games Developer), he makes the point that developers feel more comfortable testing new ideas on mobile devices because creating a game on this format will come at smaller cost and little risk. Console and PC game developers Rockstar who are well know for the making of the Grand Theft Auto series will spend years and millions of dollars modelling and coding a game, now i'm not saying all games take that amount or time and money to develop but you can see the attraction to the newer more modern game developer opting to develop games for smart phones.

So I do like Kittmers point but from another article by A Sowards that makes me still feel that developers who prefer the (2.2 User experience of the customer) would make games for the PC and console gamers. "Hardcore gamers are attracted to console games and PC games because they are often richly complex, massive in scale, and utilize the most powerful graphics technology on the market. Of course, “Candy Crush” doesn’t compare to “Grand Theft Auto” in terms of complexity."(5) 

So what do I think regarding this debate of PC, Console and Mobile wars? Well the points made by both authors make me really think that maybe mobile gaming is catching up because there are more developers creating games for smart phones, and then I think well, console and PC gaming will never be over taken because user want the real drawn into a game feel and the was that is possessed is by the realistic graphical display. Personally as someone who is a console gamer, consoles will never be beaten, but as a mutual support or gaming... maybe mobile gaming is slowly taking over.




Sunday, 29 October 2017

3.1 Pathfinding Concepts - A* Algorithm


Pathfinding Concepts - A* Algorithm

When it comes to pathfinding concepts, the real golden tick of algorithms is the A* algorithm. In AI gaming, its important to understand how the A* algorithm works and what its purpose is. A* aims to avoid using the most expensive route when planning its next move, but as well as this the A* will also invest in the most quickest path. There maybe certain routes the AI could take to get to its goal, what the AI will do is calculate how much it would cost to take one route over another, her is an example of the A* algorithm:

So A will be the starting point of the algorithm, if you check the key the current value of A is 5 so know matter what moves are made, the total cost before starting the route is 5. From here all  the current paths with be calculated up, the method used for example A to B to D to H will be:
starting point A = 5, then the cost of the move to B is 2, the cost of landing on B is 2, then the cost of getting to D will be 4, landing on D will cost 2 and then the final move to H will cost 7 and the total coming to 22. Here are the calculations for the remainder of the paths which the A* algorithm with make full use of:

Option 1 - A:5 + 2 + B:2 = 9 + 4 + D:2 = 15 + 7 + H:0 = 22
Option 2 - A:5 + 2 + B:2 = 9 + 1 + E:5 = 15 + 6 + H:0 = 21
Option 3 - A:5 + 4 + C:3 = 12 + 4 + F:7 = 23 + 10 + H:0 = 33
Option 4 - A:5 + 4 + C:3 = 12 + 9 + G:2 = 23 + 2 + H:0 = 24

Now from the available paths and the information we have calculated, we can see that option 2 is the lowest cost of travel to the AI. 

"A* algorithm combines features of uniform-cost search and pure heuristic search"(6) 

An advantage of A* is that it is like the Dijkstra algorithm (3.2 Pathfinding Concepts - Dijkstra Algorithm) is that both algorithms are used to find the shortest path to the goal, it uses a heuristic method (1.2 Heuristics) to guide and find the best first search. What Robin says in his article is correct but he comes across that is it 50/50 cost search and heuristic search, but I feel the Dijkstra algorithm uses the cost searching feature as its main priority of search source.

Saturday, 28 October 2017

3.2 Pathfinding Concepts - Dijkstra Algorithm


Pathfinding Concepts - Dijkstra Algorithm

Dijkstra algorithm works in a similar way to the A* algorithm (2.1 Pathfinding Concepts - A* Algorithm) as its main obligation as an algorithm it to find its way to a goal in the shortest most cost effective way possible. Dijkstra works by moving vertically as it is was laid out on a graph, the starting point will be set and then the algorithm, would constantly examine the next move by choosing the closing not yet examined vertical move. Dijkstra's algorithm is a greedy algorithm meaning that it will always choose the thing that seems to best right now and without regard for how it may impact future choices.

"In Dijkstra's algorithm you search all the verticies in the graph to determine the lowest cost route between each point. A* is a modification of Dijkstra's algorithm that uses a heuristic to determine which vertices to search."[7] 

Now Dennis pursues an interesting statement that links to Robin's words that'll find in reference (6) in (3.1 Pathfinding Concepts - A* Algorithm), A* is a mixture of both features of search, cost and heuristic. Dennis goes to say that A* is mainly built of of heuristic features, I disagreed with Robin in respect that I felt that cost search was the A* main priority.

I feel that out of the two algorithms, there is one more to mention. Breadth-first search algorithm which uses two values to each vertex, value one is the distance which calculates the number of edges along the path from A to B. And the predecessor vertex which calculates the shortest path from point A to point B. The difference between the Dijkstra algorithm and BFS (Breadth-first search) is that Dijksra does not need to know the target node to start its path, it is a uninformed algorithm.

Friday, 27 October 2017

4.1 State Machine


State Machine

A state machine in AI or otherwise known as a finite state machine or FSM is a algorithm used in gaming to give the AI options in real time, it will use this technique to set as its current state which will be what mood or what action the AI chooses to make.

So for example lets use the game Assassins Creed, as the player character approaches the AI villain is this scenario, the AI character will see the player character as see him as a threat which will then using the state machine algorithm set the action for the AI, The AI will then go into an evade state where it could then choose to avoid or run away from the player character. The other option for the AI would be the attack state which is where the AI would then fight the player character.

(12)

Now from Bevilacqua's FSM you can see the basic fundamentals of how the algorithm works, this is the state machine for an AI character. Now the state machine can work in relation to a health bar, for example if the health bar gets below 60% for the AI then the AI would decide to hide or take cover to reduce the risk of taking more damage and reducing health. When the health bar drops again below a certain point, the AI would choose to run from the scene, this links in with the Fuzzy logic algorithm and this is where the state membership has a float range and not made up of 0 and 1's, I have refereed to Fuzzy logic in (4.2 Fuzzy Logic) part of my blog.

A state machine basically consists of a set number of states that are connected in a graph by the transitions between them. A game entity starts with an initial state and then looks out for the events and rules that will trigger a transition to another state. A game entity can only be in exactly one state at any given time.(12) 

To finish, I have inserted a quote from the book Unity AI Game Programming because for me it indicated the definition of FSM. What I mean by this is by looking at the game Pacman and the AI algorithm (1.1 Algorithms) involved in the ghosts AI, they wander the maze, chase Pacman when in attack mode, run away from Pacman when in the evade state and then return when the games complete. It looks at the current event before making its initial decision, then transits into a different state when called upon.

Thursday, 26 October 2017

4.2 Fuzzy Logic


Fuzzy Logic

Fuzzy logic algorithm is where the state membership has a float range and not made up of 0 and 1's, what I mean by this is the state is a number between the 0 and 1, so for example 0.5. You're probably thinking, what does this mean? Well to make it simpler, in a shooting game the AI as well as the player character will have a health bar, below is an example of Fuzzy logic...


From my example you can see the life of an AI character in a game, now "No Health 0%" is obviously when the AI character is dead. "Full Health 100%" is when the AI is at full health and had no damage to it, but that's not the segment we are interested in Fuzzy logic. What we are interested in is the AI's health bar at 67%, this is the in-between of 0 and 1.

Now the next part of Fuzzy logic is the actual reaction of the AI in the time of even the health bar drops below a certain point, Now the developer could then implement code so when the health bar drops below a certain point the AI character will flea the scene or attack. The AI use decision tree's (4.4 Decision Tree) to make it's next move, an example of this is shown below...


Now the decisions the AI will make is what to do at certain stages of the health bar, lets take the game Call of Duty: World at War as an example. The AI soldier enters the shooting scene with 100% health, once he gets shot his health bar will begin to decrease, now in my example above, when the AI hits 60% health then the AI soldier will retreat and take cover, find someplace to hide. Then if the attack continues on the AI and his health bar goes down to 10% or below, the reaction of the AI will be to run away from the shooting scene and out of range from the player character.

"enabling an AI opponent to assess threats and for classification, for example by ranking players and NPCs in terms of health or power using fuzzy variables"(10)

Pirovano makes the exact point that using Fuzzy logic, a game can separate a classification of AI. Ranking how good one AI is to another, in a game the boss of a level will be harder to defeat that a ground soldier in the game, this is also used to acknowledge the longer heath that the boss AI will have. It's a perfect example of Fuzzy logic and displays what the algorithm is all about.

Wednesday, 25 October 2017

4.3 Boids Flocking


Boids Flocking

Then boids algorithm also know as boids flocking, is an artificial life motion of how birds flock together and how fish swim in schools. "It was based on three dimensional computational geometry of the sort normally used in computer animation or computer aided design."(8) 
I have used a quote from Craig Reynolds who is the founder of boids flocking because here he mentions this technique is used in computer animation or computer aided design, well a good example of boids being used in a game is from this screen shot from Far Cry on PS4.


(9)
Now you can ask yourself what is the point of adding a large flock of birds randomly flying around, well to answer that question, first we need to talk about how boids work.








When it comes to boids flocking, the first segment of three is the alignment, alignment is the behaviour that will set an agent to line up with the other agents in the vicinity, for example if you have a fish swimming around on its own and is going into a different direction to the other fish, the the line fish joins the other fish, the alignment will correct the fish's path and align it with the rest of the fish in the flock so they are all facing in the same direction.

Next is cohesion, this behaviour will cause the agent (fish) to aim towards the middle of the flock (centre of mass), This is the centre of which is created by the radius of the flock. Finally is the separation, this is when the agent\fish will behave in away which will steer away from the others in the vicinity.

So now we have a basic understanding of how it works and the three main entities that make up boids flocking, we need to introduce why its used. Now the term "flocking" is used to mimic the movement of a flock of birds, its used in real world games such as Far Cry, Grand Theft Auto and Assassins Creed.

"Often in video games, nonplayer characters must move in cohesive groups rather than independently. Let’s consider some examples. Say you’re writing an online role-playing game, and just outside the main town is a meadow of sheep. Your sheep would appear more realistic if they were grazing in a flock rather than walking around aimlessly."(10) 

So Seemann and Bourg like to reflect that boids flocking is to make the game look more realistic for the user experience, yes they have mentioned its purpose but I feel its more that just a few sheep eating in a field. As a gamer myself, the ultimate high when playing a video game is to feel like your really in the game itself, to be drawn into that other world we wish we could live in. In a free roam world you may not be always be paying attention to the sky, but as you are walking down street in GTA, to catch a flock of birds in the corner of your eye flying in to and back out of the scene, really makes you feel like your really in the game.

4.4 Decision Tree


Decision Tree

A decision tress is an AI entity which uses algorithms to make decisions base on its current surroundings, state and well-being. Decisions tree's work in like a leaf framework but to make it work the needs to be a question, answer and then the outcome. The way this works is there will be a parent node (question) and then child nodes (answers) and each child node must come up with all possible answers that the parent node is asking. Now in a real world situation, you can see below a image (13) that is a very simple example of a decision tree in action. Now in a Call of Duty game the AI would be asking itself:

Have I taken any damage? -> Yes -> find a place to hide until healthy -> Do I now have full health?   -> No -> continue hiding until healthy -> Do I now have full health?   -> Yes -> Return to the battle scene.

Questions/conditions are Nodes. Yes/No options represent Edges. End actions are Leafs of the tree. (13)

The decision tree is a very popular algorithm used in AI gaming, it collates with states machines or FSM's (4.1 State Machines) in a way that it asks itself by using the decision tree, Am I hurt? Do I need to evade? Do I have enough health to attack? or am in any danger? If not I can wander. Like Deszhic mentions in his quote, questions represent the parent nodes, yes and no reply's represent the child and also the answers and final outcome creates the final shape of the leaf.


Tuesday, 24 October 2017

5.1 Tactics & Strategy's


Tactics & Strategy's

AI strategy's, a technique used a lot of war\strategy type games, its the algorithm rule put into place on a set of characters in that scene. For example in  Call of Duty you could have a group of AI characters tasked to kill the player character and to achieve this as a unit, they would use a strategy. Now each AI character will have its own strategy, its own role to play you could say in the scene. Now using algorithms, each AI in the unit will work on its own decision tree (4.4 Decision Tree) and own state machine (4.1 State Machine) meaning that it will think for itself but on the decisions it makes, that will make an impact on the other members of the unit. The overall behaviour and AI duties will rely on what the unit is doing as a whole, if the unit is programmed to attack the player character then all AI members will do so.

AI tactics links to strategy's because this will be the action of the AI characters in the unit, for example you can have a leader, sniper and four foot soldiers in a unit and because of algorithm tactics, each job will suit the AI's role. What I mean by this is the leader will be sitting back giving commands, the sniper will also be sitting back, away from the main fight trying to shoot the player characters from a distance, and the foot soldiers will be the first to attack the player character on the ground. More in-depth tactics would be that of the ground soldiers, they would be aware of there environment and surroundings, ie. are they being shot at? are they hurt? shall I take cover? these also link to state machine (4.1 State Machine) in respect making decision on what current state their in.

"In strategy games all strategy elements apply (naturally), however strategy games normally comprise other kinds of disciplines as well, that are not strictly related with strategy. For example strategy games normally present other challenges to the player other than the strategical, like tactical, logistical and economical challenges."(16) 

Solo describes the elements of strategy in games and the techniques used to really define a strategic game, one I can think of which suits this quote is Total War, combining the two techniques tactics and strategy's by the AI working as a unit but each individual AI has its own decision tree. Solo does say that some games work with other strategies, by this he could be referring to decision trees (4.4 Decision Tree) and state machines (4.1 State Machine) which backs really backs up the use of algorithms in games today, games today can be incredibly clever will the algorithms that are used, watching units of AI working together to surround and eliminate the player character can really take you to another world.

5.2 Learning Technologies - Artificial Neural Networks


Learning Technologies - Artificial Neural Networks

So what are artificial neural networks? Well basically its a heuristic technique (1.2 Heuristics) which learners from its previous mistakes, its a more dynamic model in such a way that it makes the AI in a game more intelligent. In sense, your brain is actual a neural network so ANN is just a brain which has been applied to an AI. So how does it work? Simple, software; an artificial network is software which gives the AI its own thinking brain, it's used to think the same as a human player. Whats clever is that the AI will have its own decision tree (4.4 Decision Tree) and learn from its previous experience, for example...

If your playing a 1 v 1 match, player character vs the AI. If you were to stay in the same location\hiding from the AI and manage to kill the AI character in your current location, because the AI character did not know your whereabouts, when the AI re-spawns, from its experience and using artificial neural networks the AI will have learned and will remember where the player character is hiding and wont make the same mistake again by running into your path. This links to (5.3 Learning Technologies - Q-Learning) as the AI apply's what it has learnt from ANN's and made it work in game using Q-Learning.

"the researchers add a phase function to the neural network that essentially prevents it from wrongly mixing different animation types — for instance, taking a step in the middle of a jump."(19)

From Coldeway's comment from his article, it gives us a further look into the artificial neural network mindset, we can start to understand that AI characters are starting to not only think like humans but move and react like them also. We are all for the realism of people and animals in games which uses emergent behaviour (4.3 Boids Flocking) and by adding these featured functions, it allows the developer to insert these different types of animation to make the AI seem as real as possible.

Advantages of ANN's - Well like I mentioned earlier, it allows the AI to learner from its mistake, understand the impact of its role. It understands where its fits in live game play, the AI knows what to do. It uses is environment and current state to determine its next move, this is a clever piece of software which emulates a human down to every feature.

Disadvantage - Well for me, if the AI can think and act as I would then that would only improve the gaming experience and I doubt many would disagree. But obviously the worry could be that by suing ANN's, the AI could learn to out think us and know what we are going to do before we do it.

Monday, 23 October 2017

5.3 Learning Technologies - Q-Learning


Learning Technologies - Q-Learning

In a nutshell, Q-Learner is basically what the AI has learnt in artificial neural networks (5.2 Learning Technologies - Artificial Neural Networks) and applying them to an in game situation.

"The Q-learning algorithm is a reinforcement learning algorithm. Reinforcement learning algorithms are a set of machine learning algorithms inspired by behavioral psychology. The basic premise is that you teach the algorithm to take certain actions based on prior experience by rewarding or punishing actions. Similar to teaching a dog to sit by giving it treats for good behavior." (20)

Now what Soren is saying is that Q-Learning is a learning algorithm, well at the end of the day its used to teach the AI to take on actions based on is past experience. Soren refers to the AI as a dog which is being reward or punished based on its actions, In somewhat I suppose his theory is correct but I like to think to Q-Learning as a real human, the stages of life, a baby is born and is knew to everything, then as it gets older it gains experience and knowledge and learners from its mistakes, if it does well it is rewarded as so forth. Q-Learning is so linked to human life and ANN's that it combines the human way of life and apply's that to a gaming AI. 

I have talked about how Q-Learning relates to artificial neural networks in (5.2 Learning Technologies - Artificial Neural Networks - If your playing a 1 v 1 match, player character vs the AI. If you were to stay in the same location\hiding from the AI and manage to kill the AI character in your current location, because the AI character did not know your whereabouts, when the AI re-spawns, from its experience and using artificial neural networks the AI will have learned and will remember where the player character is hiding and wont make the same mistake again by running into your path.")

Two previous algorithms come together to create Q-Learning, these are the Bellman equation: which describes the value of a problem at a certain point in time made from previous decisions, its used by breaking a problem down into smaller problems. The other algorithm is The Law of Effect: which is the process of trial and error. By combining the two algorithms, you get Q-Learning. A perfect example of gaming AI using academic Q-learning is Forza on Xbox One, you can create a drivatar which is an AI which learns how you drive in the game by imitating and repeating your driving style.

Introduction to: NWC603COM – Using AI in Computer Games Assignment 1

Introduction to: NWC603COM – Using AI in Computer Games Assignment 1 Artificial intelligence (AI) in the gaming world today has become ...