Use of Logic in Strategy Games. - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Use of Logic in Strategy Games.

Description:

Close Combat 2 is a squad tactical game set in World War II. ... In game, the soldier's current position is taken in as input. ... – PowerPoint PPT presentation

Number of Views:132
Avg rating:3.0/5.0
Slides: 11
Provided by: Jin108
Category:
Tags: game | games | logic | strategy | use

less

Transcript and Presenter's Notes

Title: Use of Logic in Strategy Games.


1
Use of Logic in Strategy Games.
  • By Jin Yao, gtg110y
  • CS 1050B

2
Close Combat 2 A Bridge too Far
  • Overview
  • - Close Combat 2 is a squad tactical game set in
    World War II.
  • - Player is given a group of soldiers and
    vehicles to command.
  • -The objective of the player is to hold key
    tactical points on the map.
  • -The victor is decided by the number of key
    points held at end of game time or complete
    elimination or route of the opposing team.

3
AI elements in Close Combat 2
  • Path-finding
  • - The player gives each squad a command. Usually,
    these commands require the players soldier to
    move from point A to point B on the map. A
    well-coded path-finding AI will draw a path that
    is the shortest between the point and relatively
    tactically sound (in other words, not running in
    front of enemy machine gun position even though
    it was the shortest possible path).

4
Path-finding and Logic
  • The path planner in CC2 uses an algorithm
    reminiscent of a paint fill in a graphics program
    that allows it to calculate the best path (as
    determined by a scoring function) from a starting
    location to every other location on the map in
    one swoop. So, for the price of determining one
    path you get all the others as well.
  • Source - http//www.gameai.com/games.htmlCC2,
    interview with AI programmer of Close Combat 2.
  • The basic concept of path-finding is first to
    create a group of coordinates available on the
    map.
  • A algorithms, or function in logic term, is
    applied to possible coordinates.
  • The algorithm uses mathematical formulas and
    functions to narrow down the possible set of
    coordinates that the group of soldiers can
    travel. These functions can be similar to ones we
    have used in our class, such as divisibility,
    Quotient-Remainder, and/or Number Theory
    (such as even/odd, prime).
  • In game, the soldiers current position is taken
    in as input. These data are then used to define
    the parameter for the algorithms. Then, the
    game-engine will create every coordinates
    possible for the soldier to travel to from Point
    A to Point B. Using another algorithms, defined
    by game environment parameter (such as cover,
    threats, risks, terrain-difficulty), the possible
    path coordinates are filtered down to the best
    possible coordinate.
  • This is no different from what we have done in
    class for function-relationships and number
    theory. First, a broad number of element are
    created in a set, then we apply a number of
    functions to reduce the element to desired
    elements that holds properties we want. For
    example, from a set of all real number, we may
    apply divisibility function of 4 and property of
    even number. We will end up with all real numbers
    that can be divisible by four and have property
    of even number.
  • The job of AI programmer in creating path-finding
    logic is to create balanced and realistic
    functions that mimic human decision making. When
    faced with decision of going from point A to
    point B, people generally think of all possible
    way of travel. Then, based upon factors such as
    traffic condition, economic cost, and
    time-in-transit, we decide upon the best path.
    AI function in Close Combat must mimic such
    decision making through complex functions. The
    functions on the game will use factors such as
    cover from enemy fire, risks of taking fire, and
    difficulty of traversing through terrain.

5
AI elements in Close Combat 2
  • Soldier Behavior
  • Close Combat 2 boasts a AI that mimic real-life
    behavior and action of soldiers in World War II.
    These behaviors gives the player a more authentic
    experience. Instead of having completely
    drone-like soldiers that require constant
    commands, a well-coded AI will allow the soldiers
    to perform actions on their own and/or perform
    given order in realistic and sensible manner.

6
Conditionals and Fuzzy Logic
  • I use a fuzzy logic system which weighs in
    hundreds of variables through dozens of formulas,
    eventually coming down to a probability of a
    particular action that the soldier will perform.
    To prevent inconsistant jumping of actions
    (soldier decides to go prone, then the next
    instant decides to stand up, then go prone, etc.)
    a series of weights are associated with good
    behavior. This helps reinforce a consistent set
    of good actions. In the case of bad behavior, the
    soldier is restricted from choosing a good
    behavior action until certain conditions or time
    limit has been met.
  • Source - http//www.gameai.com/games.htmlCC2,
    interview with AI programmer of Close Combat 2.
  • The most elementary AI behavior is conditional
    statements in the programming. In any video game,
    a task must be performed, and the game engine
    must react to the input given by the player.
  • In strategy games such as Close Combat 2, these
    conditional statements are numerous. In
    battlefield, there are infinite amount of
    possible actions and consequences. The game
    designer usually limit the amount of action a
    player can make to reduce AI implementation
    requirement to reasonable level.
  • In most basic step, the game engine is
    conglomerate of thousands of conditional
    statements. Many of them are simple If P, then
    Q type of conditionals.
  • For example, in Close Combat 2, P , the
    supposition, can be a player command, such as
    Fire at Point X. Then the Q can be defined as
    Soldiers will shoot at point X.
  • However, simple conditional statements cannot
    possibly mimic the conditions of real-life
    battlefield. To do so, AI programmer must use
    fuzzy logic.
  • Using fuzzy logic, the AI programmer can have
    more room to create realistic behavior for
    soldiers. Instead of concrete true-false of
    simple conditional statement, they can create
    flexible degrees of truth for a more complex
    conditional statement.
  • For example, using same situation as above, the
    supposition P has become much more detailed.
    Instead of simple player command, it has expanded
    to include situational variables, such as how far
    the target (point X) and how well the soldiers
    can shoot( aim, location). The fuzzy logic system
    then determines the possibility of soldiers
    shooting at point X. In this system, there is no
    absolute truths. Instead of having absolute
    true-false, consequences are calculated in
    probability. In the example, fuzzy logic system
    may give the game engine a certain probability
    that the soldier will fire at point X rather than
    certain answer of fire/not fire.
  • So, the underlying principal of any given game is
    a conditional statement, if P then Q. However, to
    create a more interactive and sometime
    realistic game, fuzzy logic system is used to
    create the grey that mimic the real world.

7
How to beat strategy games
  • So, how do we take out those Nazis in Close
    Combat 2?
  • The problems with current AI.
  • How to exploit those problems.

8
Fundamental problems with game AI currently.
Star Craft
Command Conquer Red Alert
9
What is the limit? How do we exploit it?
  • The limit is simple. The weakness lies in the
    fact that game engines use conditional statement
    in its core principal.
  • Conditional statement requires a suppositions.
    Supposition defines whether the consequence is
    true or false. Thus, in any interactive program,
    such as games, there are incredible amount of
    supposition the programmer must consider.
  • As the game becomes more complex, the number of
    given supposition increase many fold. Even with
    help of fuzzy logic, there is simply too many
    decision to code in reasonable amount of time
    and resource. Therefore, the AI programmer must
    code as many decisions as possible and the game
    designer must constrict the game environment as
    much as possible to reduce the workload for AI
    programmer.
  • In essence, game AI are not too different from
    canned responses to given stimulus, actions.
  • A player then can exploit such situation. A
    player may spend several gaming session to get a
    feel for game AI behavior. The human player,
    will then have knowledge of AIs response to
    different situation. Knowing how the AI will
    respond, the player can then develop tactics that
    counter the AIs response. To beat the AI
    completely, rinse and repeat.

10
How to improve game AI?
  • AI needs to learn.
  • This is fundamental evolution in AI. A true
    intelligence must have the ability to learn. In
    logic terms, the game engine must add more
    supposition as situation arises. As the player
    counters AIs moves, AI must add more
    conditionals in its data banks. These created
    conditionals will require complex analysis of
    players behavior. However, this creates a
    fundamental problem of storage-handling of so
    many suppositions.
  • AI needs creativity.
  • Human are purported to have creative minds. We
    can think outside of the box. AI and logic
    cannot. Logic is defined as a system of order. It
    must follow principles and functions defined by
    mathematics and logical thinking. Creativity is
    part chaos, part logic. Chaos produce
    possibilities, while logic filters out the
    useless ones. From what we have learned in class,
    almost all of the supposition were restricted.
    Because of that restriction, logic cannot think
    outside of the box.
  • All of the argument given in this presentation
    are based upon the understanding of logic in the
    course. There are perhaps many more principles
    that will defined game AI better. Perhaps,
    learning can be defined in logical term.
Write a Comment
User Comments (0)
About PowerShow.com