Posts

Showing posts with the label Research

Adjusting Behaviours at Run Time

Image
I have been looking into way I could have improved my AI and my approach to my Final Project (Dissertation equivalent) and I have found a few methods, and tips that I could implement to make the AI feel less "rigid" to the player and become more "believable" by reacting to situations differently depending on various factors, for example if the player fires at the AI, how should they react?  Should they take cover, return fire or flee?  Should this always be the same and hand coded in?  I have found two methods from Steve Rabin's Game AI Pro 2 which look at ways to make the AI less predictable building upon the illusion of intelligence. Dual-Utility Reasoning Where there are multiple decisions an agent is able to make they will usually pick the first available option, especially in a BT which worked through its children based on positioning priority (unless a random composite node is used).  However, utility-based AI is able to make better decisions and “will...

The Illusion of Intelligence - A Talk by Halo's Chris Butcher and Jaime Griesmer

Image
AI is broken down into multiple subsections, some of the responsibilities are down to the designers, such as mission objectives, scripting and object placement, while other tasks are the responsibilities of programmers such as firing patterns, path-finding etc.  However, some parts overlap, such as combat behaviours which is what this talk is mostly about. (Nanopdf.com, 2018) When designing AI the player should be taken into consideration and what they can do as "the first design goal was to make the AI intelligible to the player, so the player can understand what they're doing".   (Butcher and Griesemer, 2002) This means that when designing the AI they had to work within limited capabilities because if the player is unable to understand what or why the AI is doing a certain action, it might as well not be in the game.  So the player will assume that the AI is able to do what they can do such as; see what they can see, do what they can do and know what they can kn...

Researching Blackboards

Image
"a[ sic ] blackboard system is composed of three main components: the blackboard, a set of knowledge sources (KSs), and a control mechanism" (Carver and Lesser, 1994) although over the years the blackboard system has evolved and "many times no arbiter is used" (Isla and Bumberg, 1980) where the arbiter is the control system, that (Carver and Lesser, 1994) describes. The blackboard model has proven to be popular for AI problems outside of games artificial intelligence (AI) and within, however, within games AI "blackboards are commonly used with behavior[ sic ] trees"   (Broder, 2014) although they can be used without a behaviour tree.  Blackboards are a place where data can be stored and read by agents within a game world.  Agents can have their own independent blackboard, a global blackboard can be used or both. As mentioned above, blackboards can be used to store data after a calculation.  This can help with performance as it will n...

Creating a realistic NPC search

The way NPCs search in games helps create believably and makes the NPCs seem more human, as they go about searching for stimuli that they are reacting to.  There are different types of searching an NPC can, and should perform depending on the situation and the stimuli, (Welsh, 2015) breaks these types of searches down. When an NPC is performing a cautious search, this should be because "the NPC has been alerted, but does not know whether their target is hostile." (Welsh, 2015).  This can be caused by sounds using techniques different games employ, such as in Metal Gear Solid, the player can knock on a wall, or in other games the player can make a verbal noise such as the whistle in Assassin's Creed. Another type of search that (Welsh, 2015) talks about is an aggressive search, this is where the NPC knows that what they are searching for is hostile, some stimuli to this could be spotting the player or hearing a hostile sound such as a gunshot. It is important to tele...

Learning About Delegates

While researching into Behaviour Trees (BT) in Unity I kept coming across the "delegate"  keyword so I decided to research further into the use of delegates. Delegates can be "used to pass methods as arguments to other methods"  (Docs.microsoft.com, 2018) and if you read further through the Microsoft  documentation on delegates it further clarifies the similarity to " C++ function pointers, but delegates are fully object-oriented, and unlike C++ pointers to member functions, delegates encapsulate both an object instance and a method."  (Docs.microsoft.com, 2018). As shown in the Unity scripting tutorial on delegates they are created by using the keyword "delegate void MyDelegate(int num);" (Unity, 2018)   and shows how the delegate variable can be reassigned to different methods however they must have the same return type. I also watched a couple of videos on YouTube about delegates, and although I feel like I now understand them, I'm n...

Researching Different AI Techniques - Behaviour Trees (Part 3)

Image
When designing AI for video games, they must act in an intelligent way while carrying out their tasks and behaviours. Originally the way this was done was using finite-state machines (FSMs) which are an “architectural structure used to encapsulate the behaviour of discrete states” (Graham, 2017). FSMs are still widely used within the games industry but are suited towards games that have less intensive AI. This is because as an FSM grows they begin to become unmanageable as each state needs to be able to transition with all other states, and if another state is added later into production, or one is removed the state transitions would need to be adjusted across the project. Although this problem can be slightly mitigated with the use of a hierarchal finite-state machine (HFSM) Which allow you to create transitions “once to super-states rather than each state individually.” (Champandard, 1, 2007) Helping to reduce the amount of redundant transitions. Behaviour Trees (BTs) have bec...

Researching Different AI Techniques - Behaviour Trees (Part 2)

Image
Autonomous agents need to be reactive to situations happening in the world around them, especially in the sense of a guard artificial intelligence (AI) which will need to react to the player's actions.  Collendanchise and Ogren talk about the trade of between modularity and reactivity "in terms of the classical Goto statement that was used in early programming languages" (Collendanchise and Ogren, 2018)  The Goto statement is as a one-way control transfer  which caused the program to jump to another section of code and continue execution from there rather than the more common two-way control transfer  where code jumps down to perform the execution, then returns to where it left off such as calling a function.  Finite State Machines (FSMs) execute code similar to the one-way control transfer as each state needs a transition to and from the state, so "a new state or behavior[ sic ] to a character requires not only coding the new state itself bu...

Research AI Techniques in Other Games - Alien Isolation

Alien Isolation is "one of the biggest AI driven titles of modern times" (AI and Games, 2016) that uses a technique called Psychopathic Serendipity which "indicates that the creature is guided by its own procedural intelligence rather than the canned foreknowledge of a game designer: [sic] "   (Keogh and Jayemanne, 2018) this will help the alien to always find a way to disrupt and mess with the player, even the alien cannot see them, to pull this off the alien cannot be scripted and must work off events triggered by the player, such as noise while being guided by the game.  For the creation of Alien Isolation, Creative Assembly used a Two Tier System to control the alien. A Macro AI and a Micro AI. The Macro AI is similar to a director or God-Like entity that is always watching the current situation of the game world and has a constant reference to what is happening with and the current states of the player and the alien.  This means that the Macro AI will al...

Research AI Techniques in Other Games - Halo 2

After watching a brief video by AI in Games called " The Behaviour Tree AI of Halo 2 ".  In this video they explain how Bungie made the artificial intelligence (AI) in Halo use the narrative of the game to visual show the player how the AI will react to the character. Using this method the player quickly understands that; Grunts   are small creatures that act in a scared manner. Jackals  are shifty creatures and act as snipers. Elites  are big and aggressive leader type characters Using this the player can quickly understand how the AI will react to certain events in the world, usually caused by the players actions. The AI in Halo is controlled by a Behaviour Tree (BT).  Because of this the AI in Halo reacts on what is happening and will traverse the tree asking "what is happening in the world, and what should I do?" and based on the predefined conditions, the agent will perform the appropriate behaviour. Halo's AI is able to think in context depe...

Starting Proposal

This week I will be making a start on my proposal, using the research I have done over the past few weeks and what I have learnt over the past two years of University to formulate the thesis for my final project. I have currently been looking into different AI techniques, such as finite-state machines (FSM), hierarchal finite-state machines (HFSM) and behaviour trees (BT).  Previously I have used a FSM and a BT during my time at University.  I liked how simple and easy it was to implement an FSM however, I would like to make a complicated artificial intelligence (AI) agent with lots of states and actions to make it seem 'smart'.  If I used an FSM or a HFSM this could become very confusing with multiple transitions to states, and as I add more states throughout the course of the project it will soon become very hard to manage it all. For this reason I have decided to research further into BTs.  I aim to create the AI for a stealth based environment to test my know...

Researching Different AI Techniques - Behaviour Trees

I started reading "Getting Started with Decision Making and Control Systems" by Alex J. Champandard In this chapter Champandard speaks about different support frameworks, such as the schedular which can manage the tasks used in the system calling them one after the other during its update step.  Champandard (2014) then goes on to give a basic scheduler example Class Scheduler { public:           bool run (Task&);           bool halt (Task&);           void update(); protected:           struct Entry           {                  Task* task;                  Status status;                  // Other data for execution            };        ...

Researching Different AI Techniques - Steering Behaviours

Steering behaviours are a way of moving an agent autonomously around the game scene.  Steering behaviours were brought about by Craig Reynolds when he demonstrated his flocking behaviour, which was based on a simple set of rules.  A definition for an autonomous agent given by (Buckland, 2005, p85) "An autonomous agent is a system situated within and a part of an environment that senses that environment and acts on it, over time, in pursuit of its own agenda and so as to effect what it senses in the future." To get a better understanding of how an autonomous agent works (Reynolds, 1999) explains that you can divide the behaviours into several layers, these layers are; Action Selection Strategy Goals Planning Steering Path determination Locomotion  Animation Articulation There are different steering behaviours that cause an agent to act in different ways.  The first behaviour I will explain is the seek behaviour. The seek steering behaviour g...

Researching Different AI Techniques - Hierarchical Finite-State Machine

Image
While researching into Finite-State Machines (FSMs) I came across a Hierarchical Finite-State Machine (HFSM).  (Buckland, 2005) explains them as "a state itself contain a state machine.".  This means if an agent has a combat state, that state might contain an FSM that manages the states needed for combat, such as dodge and shoot. A HFSM is similar to a FSM where the logic is built up state by state, however, in an HFSM states are grouped together to create a super state.  This allows the programmer to make transitions between the super states, rather than applying them to each individual state.  This reduces redundant transitions as they are only applied once to the super state. HFSMs make use of inheritance, this allows each substate of a super state to override specific behaviours, this allows internal transitions that are not recognised by the super state.  However, HFSMs still have issues with transitions between states which can become tedious. ...

Researching Different AI Techniques - Finite-State Machine

For my Final Project module I have been asked to pick a subject I have studied over the past few years of University, that I have enjoyed and would like to improve my knowledge of.  For this I have selected to research into Artificial Intelligence (AI).  The reason for this, is during my second year of University I had to complete an AI module using Torcs which is "an open-source 3D car racing simulator" (En.wikipedia.org, 2018) using one of the methods we had learnt previously, these are; Finite State Machines (FSM) Steering Behaviours  Behaviour Trees Although there were different AI techniques we had learnt, we were instructed to pick one or more of these techniques and control a car around a track, I used a Behaviour Tree to control mine.   To begin my research into AI I will be looking at Finite-State Machines (FSM) and how they can be applied to games.  A FSM as described by (Buckland, 2005) "is to decompose an object's behavior [ sic ]...