Rts presentation
This presentation is the property of its rightful owner.
Sponsored Links
1 / 59

RTS Presentation PowerPoint PPT Presentation


  • 81 Views
  • Uploaded on
  • Presentation posted in: General

RTS Presentation. by Alex Dulmovits and Luis Villegas. History. History of RTS Games. History. Precursors to RTS Utopia (1982) Direct manipulation of unit and resources for combat Turn-based Legionnaire (1982) Real-time No resource or economy/production concepts. History.

Download Presentation

RTS Presentation

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Rts presentation

RTS Presentation

by Alex Dulmovits and Luis Villegas


History

History

History of RTS Games


History1

History...

Precursors to RTS

  • Utopia (1982)

    • Direct manipulation of unit and resources for combat

    • Turn-based

  • Legionnaire (1982)

    • Real-time

    • No resource or economy/production concepts


History2

History...

First RTS Games

  • Dune II (1992)


History3

History...

First RTS Games

  • Warcraft: Orcs & Humans (1994)

  • Command and Conquer

  • Age of Empires (1997)

  • Starcraft (1998)


History4

History...

Transition to 3D and Refinement

  • Total Annihilation (1997)

    • 1st RTS with 3D elements


History5

History...

Transition to 3D and Refinement

  • Empire Earth (2001)

    • Researching tech

    • Advancing Epochs


History6

History...

Evolution of the RTS Formula

  • Sins of a Solar Empire (2008)

    • Grand-Scale stellar empire building


History7

History...

Evolution of the RTS Formula

  • Achron

    • Time-travel elements


History8

History...

Evolution of the RTS Formula

  • Halo Wars

    • Modern RTS on a console


Rts presentation

Architecting an RTS AI


Rts game components

RTS Game Components

  • Civilization

  • Build

  • Unit

  • Resource

  • Research

  • Combat


Game components civilization manager

Game Components: Civilization Manager

  • Highest-level manager responsible for development of the computer player's economy

  • Responsible for coordination between the build, unit, resource and research managers

  • Responsible for spending limits

  • Computer player expansion, upgrading and epoch advancement (EE)


Game components build manager

Game Components: Build Manager

  • Responsible for placement of structures and towns

  • Receives requests from the unit manager for training buildings

  • Receives requests from the civilization manager for support buildings

  • All site evaluation occurs here


Game components build manager1

Game Components: Build Manager

  • Where buildings can and cannot be placed

    • RTS games restrict component placement

    • Red usually signifies invalid placement


Game components build manager2

Game Components: Build Manager

  • Take "area of effect" buildings into account

  • Buildings with an area of effect are placed near resources, where most units are likely to congregate


Game components build manager3

Game Components: Build Manager

  • Military Buildings

    • Nearby resources, but shouldn't interfere with area of effect buildings

    • Built in a ring around immediate area of resources

  • Other Buildings

    • Farms, airports, walls, docks, towers require specialized placements

    • Depends on terrain analysis engine

    • Place towers in choke points, avoid building near enemies


Game components unit manager

Game Components: Unit Manager

  • Responsible for training units

  • Keeps track of what units are in training in various buildings

  • Monitors the computer player's population limits

  • Prioritizes

    unit training

    requests


Game components unit manager1

Game Components: Unit Manager

  • If training building not currently available, unit manager communicates with build manager

  • Attempts to maintain a similar unit count to the human players in the game to balance difficulty of game

  • By not allowing AI unit count to get too high, we lessen the CPU load of the game


Game components resource manager

Game Components: Resource Manager

  • Responsible for tasking citizens to gather resources in response from both the unit and build managers.

  • Balances gathering duties

  • Governs the expansion of the computer player to newly explored resource sites


Game components research manager

Game Components: Research Manager

  • Responsible for directed research of computer player

  • Technologies are examined and selected based on their usefulness and cost


Game components combat manager

Game Components: Combat Manager

  • Responsible for directing military units on the battlefield

  • Requests units to be trained via unit manager

  • Deploys units in whatever offensive or defensive position is most beneficial


Game components combat manager1

Game Components: Combat Manager

  • Keeps track of units via a personnel manager

  • Periodically updates the status, movement and actions of various attack groups

  • Offense and Defense are sub-managers within the combat manager.


Game components combat manager2

Game Components: Combat Manager

  • Depending on what programming language is used, the combat manager communicates with the other managers in different ways.

  • In C++, with the managers implemented as classes, public methods can be used as a means to communicate.


Game components combat manager3

Game Components: Combat Manager

  • Example: TrainUnit method in Empire Earth's Unit Manager

    • Responsible for for bringing new units into the world

    • Parameters: unit type, number desired, where is the unit required? (optional)

    • Communicates with Resource Manager to ensure sufficient resources, checks population headroom, communicates with Build Manager if training building needed


Game components combat manager4

Game Components: Combat Manager

  • Example: TrainUnit method in Empire Earth's Unit Manager

    • Use training orders as a mechanism to determine when the request was complete

    • Training Orders are simple classes that contain information about the request and a method to call to check if and when something is complete


Game components combat manager5

Game Components: Combat Manager

  • RTS Combat AI Example

    • Shogun 2


Game components

Game Components

  • All the game components will be communicating with each other

  • The problem comes when changing a manager

  • Small changes have profound effects on AI

  • AI becomes unpredicatable

  • Tracking down chains of cause and effect becomes the focus of late development testing


Rts presentation

Difficulty Levels


The difficult problem of difficulty

The Difficult Problem of Difficulty

  • Games are played by players with a broad range of experience

  • Tailor games to fit level of competence of player

  • Need to find a way for AI that can learn from the player as it goes along

  • Settle for pre-set difficulty levels

  • Avoid just adding more computer players for expert players. (more work for player and CPU)


The difficult problem of difficulty1

The Difficult Problem of Difficulty

  • Goal should be to develop an AI that is good enough to give challenge to an expert player in a 1-to-1 match

  • Then tone down AI for intermediate and beginners

  • Hire expert players to help programmers do balancing

  • More difficult to start with an easy AI and increase its intelligence


The difficult problem of difficulty2

The Difficult Problem of Difficulty

  • Choose what modifications to make to differentiate difficulty levels (narrow down)

  • The more variables you have, the harder it will be to test changes

  • Testing difficulty level changes is very time-consuming

  • Consider Cheating

  • Biggest Challenge: random maps


Rts presentation

Priorities in Goal-Based RTS AI


Goal engine architecture

Goal Engine Architecture

  • Responsible for making all strategic-level decisions in the opposing player AI

  • Decides what actions to take, where to take those actions, and what resources to apply to each


Actors

Actors

  • Things within the game controlled by a human or AI players

  • Buildings: immobile actors

    • Defensive structures: can attack things

    • Economic buildings: provide some nonmilitary advantage

  • Units: movable actors

    • Military Units: can attack things

    • Builders: construct and/or repair buildings

      Combat Value (CV): numerical measure

      of an actor's effectiveness in a fight


Goals

Goals

  • Used to represent every action a player can take in the game

    • attack, defend, explore, recruit, construct, and repair

  • Influenced by resources (units, money)

  • Goal status: active/inactive/selected/finished

  • Base priority: priority of certain goal given the current state

  • Current priority: takes into account resource assignments as well as game state

    Change of priority by red team: http://youtu.be/0b1uSwY48r0?t=3m23s


Generating goal priorities part 1

Generating Goal Priorities (Part 1)

  • Common Tools: balance varying factors going into a priority

    • Make more realistic/human- like

    • Less predictable

      • Multipliers

      • Exponents

      • Min. values

      • Max. values

      • Inversion

      • Bonuses

      • One-time Bonuses

      • Repeat penalties

      • Random Bonuses

  • Fuzzy Factor: random bonus added to base priority of every goal

  • Goal Inertia: any bonus added to goals selected previously

  • Goal Commitment: even though requirements might not be met at the moment, still selected


  • Generating goal priorities part 2

    Generating Goal Priorities (Part 2)

    • Money Value: AI needs to understand the value of resources such as: gold, wood, iron, food

      • How much? - More needed?

    • Actor Value: the value of an actor plays a large role in the priority of a goal

      • Some considerations that affect the determination of the actor priority

        • effect an actor has on the economy

        • the combat value of an actor

        • the strategic value of the actor's position

        • the location in the AI's territory


    Generating goal priorities part 3

    Generating Goal Priorities (Part 3)

    • Build Template: where buildings should be built with respect to one another

      • Bonuses for building certain buildings close to one another

    • Map Analysis: spatial reasoning

      • Region: map split up into rectangles where units can move freely

      • Pathfinding: using pathfinding system, can calculate distance between points which will encourage units to move to closer goals

      • Military Influence: every actor adds an influence to the region they are in depending on their CV

        • Equation:


    Attack goal

    Attack Goal

    • Attack goals are directed at an entire region

    • Base priority takes into account:

      • maximum number of a player's CV in a certain region

      • value that any capturable enemy actors would provide if they were controlled

    • Current priority takes into account:

      • CV ratio (ratio of friendly CV to hostile CV)

      • value of friendly CV in neighboring regions

      • whether or not there are known hostile units along path to attack region


    Goal based ai conclusion

    Goal Based AI Conclusion

    • Advantages

      • Flexible and powerful

      • Complexity scales fairly well as AI grows

      • Can execute more than one goal at a time

      • Emergent behavior (to an extent)

    • Disadvantages:

      • Priority calculations (“Bucket of Floats”)

      • Emergent behavior (becomes predictable)


    Rts citizen ai

    RTS Citizen AI


    Citizens

    Citizens

    • Responsible for the building and gathering of resources within a town

    • Usually low CV

    • Problem:

      • Citizens can be instructed by player on what to do

      • But after completing their task what do they do?

    • Solution:

      • AI uses build and gather goals to instruct when/where to build and gather resources


    Goals1

    Goals

    • A player can give citizens high-level goals

    • A citizen accomplishes these goals by following an FSM of varying actions

    • Citizens will continue their cycle of actions until sent a trigger by the player which will cause them to move onto another action


    Building and repairing

    Building and Repairing

    • When a player selects to create a building with certain citizens, the citizens must:

      • Establish a build site (location where the citizen is to position themselves in order to build the building)

      • Find a path to the build site

      • Begin to build the building (by gradually adding hit points to it)

      • Once the building is complete, the citizen goes idle and waits for next trigger from the player

    • For repairs:

      • Similar to building, except the building location has already been determined

      • Each hit point repaired to the building, cost the player resources

      • If the player runs out of resources, the citizen goes idle


    Building and repairing1

    Building and Repairing

    • Build Site Selection:

      • must find a location around the desired building

      • must take other citizens' build sites into account before determining theirs

    • Citizen Build Queues

      • player can issue a queue of commands to a citizen

      • additional commands are added onto the back of the queue

    • Three-Phase Building Construction

      • Foundation: - must be cleared before construction begins

        - when in construction does not block paths

      • Scaffolding: - stage during construction

        - becomes visible to other players in range

        - more citizens working, the faster it is built

      • Completed


    Gathering

    Gathering

    • Citizens must gather resources from a resource unit (gold ore, trees, etc.) and bring to a storage unit (town center, mill, etc.):

      • A player gives selected citizens a command to gather a certain resource

      • Citizens pathfind to the resource

      • They gather until their capacity is reached

      • Then they locate the nearest storage unit and dump the resources off adding to the player's total

      • Repeat

    • If a citizen can't find a resource unit or storage unit, it will become idle


    Citizen ai example empire earth

    Citizen AI Example: Empire Earth

    http://youtu.be/GUWnK25BdJE?t=2m30s


    Rts terrain analysis

    RTS Terrain Analysis


    Rts terrain analysis1

    RTS Terrain Analysis

    • First need to know information about the terrain to determine what tactic the AI should perform

    • Some questions that can be used to determine terrain information:

      • Are my troops in a single region?

      • Are there enemy forces in the same region as my troops?

      • Does my region have connections to others?

      • What regions have important strategic value?


    Geometric terrain analysis approach

    Geometric Terrain Analysis Approach

    • Uses Voronoi diagrams using geometric information

    • Useful for dividing map into different areas which can later be classified by an algorithm

    • Drawbacks:

      • doesn't take into account changing map features (such as water and land)

      • provides no information about strategic value of area

    Voronoi diagram of obstacles consists of a set of points which are equidistant from two or more distinct obstacles

    Created from 2D Segment computer programs


    Pathfinding simulation analysis approach

    Pathfinding Simulation Analysis Approach

    • Attempts to find important paths on map

    • Useful to help determine paths and avenues of approach that are most likely to be used

    • After a pathfinding technique is used, determines the paths that were travelled the most

      • Higher concentration of paths = more important the location is

    • Drawbacks:

      • No information about logical areas

      • No information about connections

      • No information from the paths about which of their waypoints are important


    Combined approach

    Combined Approach

    • Both Geometric Terrain Analysis and Pathfinding Simulation Analysis Approaches have drawbacks

    • Use a combination of the two approaches

    • Geometric Terrain Analysis

      • Used to detect logical areas and their connections

    • Pathfinding Simulation Analysis

      • Determine the importance of paths


    Basic concepts

    Basic Concepts

    • Passability Map: map that shows what regions are passable

      • Black pixels: represent passable areas

      • White pixels: represent impassable areas (slope too steep or river)

      • Bridges displayed since they affect passability

      • Other buildings or trees not included

    • Regions: passable areas surrounded by impassable terrain or regions of different type

      • Game zones: broad, open passable areas

      • Chokepoints: narrow corridors between game zones

    • Connections: logical links between chokepoints and game zones

    • Hotspot: best position to defend a game zone from attacks coming through a particular chokepoint


    Terrain analysis algorithm

    Terrain Analysis Algorithm

    • Noise Reduction

      • Cleans passability map

        • Removes small islands or pockets of impassable terrain that produce useless divisions

      • Selects zones of impassable terrain

      • Fills small areas with black pixels

    • Random Pathfinding

      • Takes information of terrain heightmap and pathfinding data

        • Finds most likely used paths by enemy

      • Calculates a large number of random paths and stores them


    Terrain analysis algorithm1

    Terrain Analysis Algorithm

    • Iterative Image Processing

      • Takes in a clean passability map

      • Generates an output image on which each region is clearly marked by different colors:

        • passable terrain

        • impassable terrain

        • game zone

        • choke point

  • Combining Image Processing and Pathfinding Data

    • Computes a hotspot for each connection between a chokepoint and game zone

    • Returns list of game zones connected by the chokepoint

    • Returns hotspot for each chokepoint

    • Direction from the hotspot to the game zone connected to it


  • Terrain analysis depiction

    Terrain Analysis Depiction

    • Select impassable terrain

    • Expand selection

    • Invert selection

    • Fill (Free spaces)

    • Expand selection

    • Invert selection

    • Deselect impassable

    • Fill (Choke points)


    Terrain analysis conclusion use of map information

    Terrain Analysis Conclusion: Use of Map Information

    • AI system can use this knowledge to help defeat the enemy

      • Properties of each region

      • Which areas contain allied and enemy units

      • Hotspots: which connections must be defended or attacked depending on enemy position

      • Direction of hotspot: where to place units at appropriate locations relative to the connection

      • Weighting information: which regions and connections are most important


    Conclusion

    Conclusion

    Recap:

    • History

    • Architecting an RTS AI

    • Difficulty Levels

    • Priorities in Goal-Based RTS AI

    • RTS Citizen AI

    • RTS Terrain Analysis

      The future of RTS games/graphics

      Total War: Shogun 2

      http://youtu.be/RgglJXnjNe4?hd=1&t=36s


  • Login