You are on page 1of 10

Submitted to:

Sarabia Rahman
Assistant Professor
Bangladesh University of Professionals

Submitted by:
Uzma Shahid, roll: 18221082
Bishal Singha, roll: 18221072
Anindya Mutsuddy: 18221076
Safat Imtiaz, roll: 18221024
Jannatul Ferdous Makki, roll: 18221052

Course Name: Computer and its


applications in business
Course Code: ALD 1104
Department: BBA in Finance & Banking
Bangladesh University of Professionals
Date of Submission: 13 May 2018

1
2

Team 7: Use of AI in game mechanics

Introduction:

Since manmade brainpower (AI) is an expansive thought in computer games, it is


vital to begin by characterizing the extent of this work. A computer game can be
considered to have two primary viewpoints, the specific circumstance (context)
and the game. The diversion incorporates the components that characterize the
real difficulties players confront and the issues they need to settle, for example,
principles and goals. Then again, the setting envelops every one of the
components that make up the setting in which these issues show up, for example,
characters and plot. This work centers around game AI, that is, AI which is worried
about taking care of the issues in the diversion, for example, crushing a rival in
battle or exploring in a labyrinth. On the other hand, context AI would manage
setting particular errands, for example, influencing a character to play out a
progression of activities to propel the plot or responding to player decisions.
Accordingly, the extent of talk is constrained to the gaming perspective in this
work.

History:
Video games were born without AI. The first game ever was created in 1958 by
William Higinbotham who worked at the Brookhaven National Laboratory. The
game is called “Tennis for Two”, and was made by wiring an oscilloscope up to an
analogue computer.

In 1970, Atari released the first video arcade game, “Computer Space”. And it was
not until then that game designers began the take their first attempt to
incorporate AI into their games. AIs were designed primarily for arcade games
with the purpose of ensuring people kept feeding quarters into the game machine.
Games back then were running under very simple rules and scripted actions. The
agents didn’t have the ability to make decisions. Sometimes decisions were
designed to be made randomly so that the behaviors looked more unpredictable.
Therefore, the so called Intelligence was actually coded into the game and was not
able to act at runtime. Early AI appeared in the form of stored patterns. An
3

example of such hard-coded AI is the aliens design in “Space Invaders”. In this


game, Player must shoot the aliens before they reach the bottom of the screen.
The way these aliens move is pre-coded into the game. They were the stored
pattern.

During the 1980’s, more genres of games emerged rapidly. The old style of AI
design was out of date. Designers had to treat game AI seriously since AI has
become a standard feature of video games.

We are still in the evolution of game AI. Video games have come a long way ever
since 1950’s, and so have the AI techniques that go along with them. The past few
years have witnessed more and more novel ideas, and methods for games AI have
joined into the game development process.

Since computer games are intended for individuals, it is just characteristic that
they center around their intellectual aptitudes and physical capacities. The
wealthier and more mind boggling an amusement is, the more aptitudes and
capacities it requires. Along these lines, making a genuinely shrewd and
completely self-ruling operator for a mind boggling computer game can be as
trying as imitating a vast piece of the total human knowledge. Then again, AI is
normally freely intended for each diversion. This makes it hard to make an
altogether vigorous AI since its improvement is constrained to the extent of an
individual amusement venture. Albeit every computer game is extraordinary, they
can share various ideas relying upon their classification. Classes are utilized to
order video amusements as indicated by the way players collaborate with them
and their guidelines. On a calculated level, computer games of a similar class
ordinarily include comparative difficulties in light of similar ideas. These
comparative difficulties at that point include normal issues for which essential
conduct can be characterized and connected paying little mind to the issue
occasion. For instance, in a first-individual shooter one-on-one match, players
confront issues, for example, weapon choice, adversary position expectation and
route. Every minute, a player needs to assess the circumstance and change to the
most fitting weapon, foresee where the rival likely is or is heading and locate the
best course to arrive. These issues can be contemplated about on an applied level
utilizing information, for example, the rate of shoot of a weapon, the present
soundness of the rival and the area of health packs. These ideas are regular to
4

some first-individual shooter recreations and are sufficient to characterize


successful conduct paying little mind to the details of their understanding. Such
arrangements as of now exist for certain route issues for example and are utilized
crosswise over numerous computer games. Additionally, human players can
regularly easily utilize the experience obtained from one computer game in one
more of a similar classification. A player with involvement in first-individual
shooter diversions will as a rule perform better in another first-individual shooter
amusement than one with no experience and can even perform superior to
anything a player with some involvement in the new amusement, demonstrating
that it is conceivable to apply the conduct learned for one amusement in another
diversion including comparative ideas to perform well without knowing the details
of the last mentioned. Clearly, when the details are found, they can be utilized to
additionally enhance the essential applied conduct or even supersede it. It might
in this manner be conceivable to make cross-amusement AI by recognizing and
focusing on reasonable issues as opposed to their diversion particular occasions.
Withdrawing AI or a piece of it from the improvement of computer games would
expel the undertaking constraints that push engineers to restrain it and enable it
to have a persistent and more intensive plan process.

So what does AI mean for games?

At its most fundamental level, "artificial intelligence" comprises of imitating the


conduct of different players or the elements (that is, every one of the components
of the diversion that can demonstration or be followed up on from players to
rockets to health pickups) they speak to. The key idea is that the conduct is
mimicked. At the end of the day, AI for amusements is more "artificial" and less
"intelligence". The framework can be as straightforward as a principles based
framework or as unpredictable as a framework intended to challenge a player as
the officer of a restricting armed force.

Traditional AI vs AI in games:

Traditional research in AI seeks to create a real intelligence-albeit through artificial


means. Projects such as the Massachusetts Institute of Technology’s Kismet are
trying to create an AI that can learn and interact socially as well as exhibit
emotions. As of this writing, MIT is working on creating an AI that has the faculties
of a young child, with promising results.

For the motivations behind the present games, genuine AI is well beyond the
necessities of a bit of entertainment software. Game AI does not should be
5

conscious or mindful; it doesn't need to find out about anything past the extent of
gameplay. The genuine objective of AI in games is to mimic shrewd conduct,
furnishing the player with an acceptable test a test that the player would then be
able to overcome.

The purpose of AI in games:

AI can play multiple roles in gaming. It can be a general set of rules used to govern
the behavior of entities in the game world. You could also consider the pre-
scripted events that entities follow a type of AI. For example, in the game
‘F.E.AR’, the creepy little girl who appears to frighten players and foreshadow
future events is a pre-scripted event. What comes to mind for most people when
they think of AI and games is the computer-controlled players in multiplayer
games. However, all of these are different roles that AI can fulfill.

Depending on the nature of the role that the AI is supposed to fill, there can be
very little in the way of system needs. The more complex the system, the more
requirements an AI will have. Basic needs are nothing more than the processing
time needed to run the AI. More complex systems require some means of
perceiving the AI’s environment, a record of player actions, and some means of
evaluating the success of previous decisions.
6

1. Decision-making

The core concept behind AI is decision making. To execute these choices, the
intelligent system needs to be able to affect the entities using the AI system. You
can organize this execution in either an “AI push” or an “entity pull” strategy.

AI push systems tend to isolate the AI system as a separate element of the game
architecture. Such a strategy often takes on the form a separate thread or threads
in which the AI spends its time calculating the best choices given the game
options. When the AI makes a decision, that decision is then broadcast to the
entities involved. This approach works best in real-time strategy games, where the
AI is concerned with the big picture.

Entity pull systems work best for games with simple entities. In these games, the
entities call on the AI system when the entity “thinks,” or updates itself. This
approach works very well in systems with large numbers of entities that do not
need to think very often, such as shooters. This system can also benefit from
multi-threading techniques, but it requires some extra planning (for details see the
article on Multithreaded AI by Orion Granatir.

2. Basic Perceptions

For the AI to make meaningful decisions, it needs some way of perceiving its
environment. In simpler systems, this perception can be a simple check on the
position of the player entity. As systems become more demanding, entities need
to identify key features of the game world, such as viable paths to walk through,
cover-providing terrain, and areas of conflict.

The challenge for designers and developers is to come up with a way to identify
key features important to the intelligence system. For example, cover can be
predetermined by the level designers or can be pre-computed when a map is
loaded or compiled. Some elements must be evaluated on the fly, such as conflict
maps and imminent threats.

3. Rules-Based Systems

The most basic form an intelligent system can take is that of a rules-based system.
This system stretches the term “artificial intelligence”. A set of preset behaviors is
used to determine the behavior of game entities. With a variety of actions, the
overall result can be a behavior system that is not obvious although there is very
little actual intelligence involved.
7

A good example of a rules-based system is a Black Jack dealer (either video Black
Jack or real Black Jack). The dealer has a simple rule that it follows: Always hit
when the cards add up to 17 or less. To the average player, the perception is that
the dealer is playing competitively. The player will imagine a more competent
adversary than the one he or she faces (unless the house advertises the rule that
the dealers play by).

The classic application of this system is Pac-Man. Four ghosts plagued the player.
Each ghost followed a simple rule set. One ghost was always to turn left, another
was always to turn right, one turned in a random direction, and the last turned
toward the player. Individually, the ghosts would be easy to figure out, and the
player would be able to handily avoid them. As a group, the pattern of their
movement appears to be a complex, coordinated search party hunting the player.
In reality, the only one that even checks the player's position is the last one.

As this example suggests, rules do not need to be hard-coded: They can be based on
perceived states (as the last ghost was) or on editable parameters of the entity.
Variables such as aggression, courage, range of sight, and rate of thinking can all
lead to more diverse entity behavior, even within a rules-based system. Rules-based
systems are the simplest structure for an AI. More complex intelligent systems are
built upon and governed by a series of conditional rules. In tactical games, rules
govern which tactics to use. In strategy games, rules govern build orders and how to
react to conflicts. Rules-based systems are the foundation of AI.

4. Finite State Machines as AI


8

A finite state machine (FMS) is a way of conceptualizing and implementing an entity


that has distinct states throughout its life. A “state”can represent physical
conditions that the entity is in, or it can represent emotional states that the entity
can exhibit. In this example, emotional states are nothing like a true AI’s emotional
states but predetermined behavior models that fit into the context of the
game.Here are common examples of states for an AI system for a game with stealth
elements:

 Idle. In this state, the entity is passively standing around or walking along a
set path. Perceptions are low. Player sounds are not often checked for. Only if
this entity is attacked or “sees” a player directly in front of it will its state
change to a higher level of awareness.
 Aware. This entity is actively searching for intruders. It checks often for the
sounds of the player and sees farther and wider than an idle entity. This
entity will move to the Intrigued state if it notices something out of place
(something to check for), such as open doors, unconscious bodies, or spent
bullet casings.
 Intrigued. This entity is aware that something is up. To demonstrate this
behavior, the entity will abandon its normal post or path and move to areas
of interest, such as the aforementioned open doors or bodies. If a player is
seen, the entity goes to the Alert state.
 Alert. In this state, the entity has become aware of the player and will go
through the actions of hunting down the player: moving into range of attack,
alerting fellow guards, sounding alarms, and finding cover. When the entity is
within range of the enemy, it switches to the Aggressive state.
 Aggressive. This is the state where the enemy has engaged in combat with
the player. The entity attacks the player when it can and seeks cover between
rounds of attack (based on attack cool-downs or reloading). The entity only
leaves this state if the enemy is killed (return to normal), if the enemy moves
9

out of firing range (go back to the Alert stage), or if the entity dies (go to the
Dead state). If the entity becomes low on health, it may switch to the Fleeing
state, depending on the courage of the specific entity.
 Fleeing. In this state, the entity tries to run from combat. Depending on the
game, there may be a secondary goal of finding health or leaving the play
area. When the entity finds health, it may return to the Alert state and
resume combat. An entity that “leaves” is merely deleted.
 Dead. In some games, the state of death may not be completely idle. Death
or dying can have the entity “cry out,” alerting nearby entities, or go into a
knocked-out state, where it can later be revived by a medic (and returned to
a state of Alert).

There are at least two simple ways to implement an FMS within the entity system.
One is to have each state be a variable that can be checked (often through a
massive switch statement). The other is to use function pointers (in the C
language) or virtual functions (in the C++ and other object-oriented languages).

5. Adaptive AI

The previous sections discussed methods for designing intelligence systems that fit
into the predefined events of a game. For most games, this is adequate as long as
the designs were thorough and there is a clear understanding of the goals of the
intelligent entities. When a game calls for more variability and a better, more
dynamic adversary for the player, the AI may need to be able to grow and adapt
on its own.

Adaptive AI is used commonly in fighting games and strategy games, in which the
mechanics are deep and the options for gameplay are innumerable. To provide a
constant challenge for the player without the player eventually figuring out the
optimal strategy to defeat the computer, the AI needs to be able to learn and
adapt.

6. Prediction

The ability to effectively anticipate an opponent’s next move is crucial in an


adaptive system. Different methods can be used, such as past-pattern recognition
(covered in a future article) or random guess, to determine the next action to take.

One basic method for adaptation is to keep track of past decisions and evaluate
their success. The AI system keeps a record of choices a player has made in the
past. Past decisions must be evaluated in some manner. (e.g. in fighting games,
the advantage gained or lost-health lost or time advantage-can be the measure for
10

success.) Additional information about the situation can be gathered to give the
decisions some context, such as relative health, previous actions, and position in
the level (people play differently when their backs are to the wall).

This history can be evaluated to determine the success of previous actions and
whether a change in tactics is required. Until the list of past actions is built,
general tactics or random actions can be used to guide the actions of the entity.
This system can tie into rules-based systems and different states.

In a tactical game, past history can decide the best tactics to use against a player
team, such as defensive, offensive, berserk, or some balanced means of play. In a
strategy game, the optimal composition of units in an army can be discovered on a
per-player basis. In games where the AI is controlling supportive characters for the
player, the adaptive AI can better complement the player's natural style by
learning the way the player acts.

Summary:
The field of AI is a complex area of research. AI for games takes on different forms
depending on the needs of the game designed, ranging from simple sets of rules
for computer-controlled entities to more advanced adaptive systems. Applying AI
concepts to games is a necessary way to increase the believability of the virtual
characters created in electronic entertainment, but it is not an impossible
challenge. The next article in this series will discuss the challenges an AI faces in
perceiving and navigating a complex environment as well as how those challenges
can be addressed.

Sites used for reference:


 https://www.hindawi.com/journals/ijcgt/2015/271296/
 https://www.hindawi.com/journals/ijcgt/2015/271296/
 https://software.intel.com/en-us/articles/designing-artificial-intelligence-for-
games-part-1

You might also like