Case Based Planner Platform For Rts Games

21
CASE-BASED PLANNER PLATFORM FOR RTS GAMES An Introduction Abdelrahman Al-Ogail Ahmed Atta

description

Survey on 2 popular CBP platforms in RTS Games

Transcript of Case Based Planner Platform For Rts Games

Page 1: Case Based Planner Platform For Rts Games

CASE-BASED PLANNER PLATFORM FOR RTS GAMES

An Introduction

Abdelrahman Al-Ogail

Ahmed Atta

Page 2: Case Based Planner Platform For Rts Games

AGENDA

Case Representation. David W. Aha Platform. Santiago Platform.

Page 3: Case Based Planner Platform For Rts Games

CASE REPRESENTATION

Case = ( Goal , State , Plan, Performance)

Case

Goal

State

Plan

Actions

Sub Goals

Performance

Page 4: Case Based Planner Platform For Rts Games

CASE REPRESENTATION

  Example of a caseGoal:

ResourceGoal(Gold, MaxInfluence)

State:Number of gold mines

Distance between gold mines and nearest gold mine storer

Number of free or useless peons

Plan:

Train(3, peon)Assign(3, peons, GoldMiner)

Build(Farm)

Build(GoldMineCollector, 200)

Performance:Number of gold collected in 1 minute

Page 5: Case Based Planner Platform For Rts Games

CBP – CAT

AbstractThe Case-Based Tactician (CAT) system,

created by Aha, Molineaux, and Ponsen (2005), uses case-based reasoning to learn to win the real-time strategy game Wargus.

Previous work has shown CAT’s ability to defeat a randomly selected opponent from a

set against which it has trained. We now focus on the task of defeating a selected

opponent while training on others. We describe CAT’s algorithm and report its

cross-validation performance against a set of Wargus opponents.

Page 6: Case Based Planner Platform For Rts Games

CBP - CAT

- Spronk and Ponsen developed a genetic algorithm and a technique called dynamic scripting to learn plans spanning the entire game which win against fixed opponent.

- CAT is the first case-based system designed to defeat an opponent that uses tactics and strategies that it has not trained against (novel opponent).

- RTS Games concerns on: military combat, exploration, economic development, research advancement, limited diplomacy.

Page 7: Case Based Planner Platform For Rts Games

CBP - CAT

- Sources of knowledge:• Building Static Lattic.• Set of tactics in every building state.• Game State.

Winning (i.e., by destroying all the enemy units and buildings) requires managing three key resources: buildings, the workforce, and an army.

The decision space is the set of possible actions that can be executed at a particular moment

Page 8: Case Based Planner Platform For Rts Games

CBP - CAT

We estimate this (action space) as O(2W(A*P) +2T(D+S) + B(R+C)), Where:

W is the current number of workers. A is the number of assignments workers can perform

(e.g., create a building, gather gold) P is the average number of workplaces. T is the number of troops (fighters plus workers). D is the average number of directions that a unit can

move. S is the choice of troop’s stance (i.e., stand, patrol,

attack). B is the number of buildings. R is the average choice of research objectives at a

building. C is the average choice of units to create at a building.

Page 9: Case Based Planner Platform For Rts Games

CBP - CAT

Game State Variables

Page 10: Case Based Planner Platform For Rts Games

CBP - CAT

Page 11: Case Based Planner Platform For Rts Games

CBP - CAT

Idea of breaking game into periods in order to current available buildings.

Building state is time between the constructions of such building to the time the next is built.

Building state defines the set of actions available to the player at any one time.

In contrast, CAT performs no adaptation during reuse, but does perform case acquisition. Also, CAT focuses on winning a game rather than on performing a subtask.

Page 12: Case Based Planner Platform For Rts Games

CBP - CAT

CAT retrieves cases when a new state in the lattice is entered.

The similarity between a stored case C and the current game state S is defined as: SimC, S = (CPerformance/dist(CDescription, S)) - dist(CDescription, S) where dist() is the (unweighted, unnormalized)

Euclidean distance between two cases for the eight features.

However, to gain experience with all tactics in a state, case retrieval is not performed until each available tactic at that state is selected e times, where e is CAT’s exploration parameter.

During exploration, CAT randomly retrieves one of the least frequently used tactics for reuse. Exploration also takes place whenever the highest Performance among the k-nearest neighbors is below 0.5.

Page 13: Case Based Planner Platform For Rts Games

CBP - CAT

Then after applying the case we evaluate by:

Page 14: Case Based Planner Platform For Rts Games

CBP - CAT

Evaluation yields the Performance of a case’s Tactic, which is measured at both a local and global level. That is, CAT records the WARGUS game score for both the player and opponent at the start of each BuildingState and at the game’s end, which occurs when one player eliminates all of the other’s units and buildings.

In retaining C’ if we found C with same <Description, Tactic> then we update it. Otherwise create new case

Page 15: Case Based Planner Platform For Rts Games

CBP - DARMOK

Darmok starts the execution with the initial goal of “WinWargus”.

The system Retriever will try to return a plan to satisfy this goal by going on the following 4 steps:

Page 16: Case Based Planner Platform For Rts Games

CBP - DARMOK

Game State best-first greedy hill-

climbing algorithm

shallow features

Game state Shallow features

values

Situation

a

b

Example of extracted shallow features:lumber (number of trees in the map), food (amount of food), gold (amount of gold of the player), peasants (number of peasants) and units (number of units the player has)

In this example , According to the values of these features we predict that the current situation is BEGINNING

1- DEFINE THE CURRENT SITUATION

Page 17: Case Based Planner Platform For Rts Games

CBP - DARMOK

2- RETURN A SET OF CASES RELATED TO THE CURRENT SITUATION

Case base Situation

Set of cases

Returns all cases which have Situation = BEGINNING , and Goal = WINWARGUS

Page 18: Case Based Planner Platform For Rts Games

CBP - DARMOK3- DETERMINING DISCRIMINATE

FEATURES

Set of cases

a feature selection algorithm

Deep features

Example of extracted Deep features:• ispath (a boolean feature that is true when there is a

path from the player base to the enemy base)• wallbarrier- width (the width of the biggest barrier

between the player and the enemy) • baseproximitydistance (distance between the

player’s base and the enemy base).

Page 19: Case Based Planner Platform For Rts Games

CBP - DARMOK

4- DEFINE THE MOST RELEVANT CASE

Deep features

normal retrieval techniques

case(s)

According to the values of these deep features, the retriever will determine which case is the most relevant to the current game situation

Page 20: Case Based Planner Platform For Rts Games

CBP - DARMOK

Shallow FeaturesSome features used to define the currentgame situation.

Deep featuresSome features used to discriminate betweensome cases.

SHALLOW FEATURES VS DEEP FEATURES

Page 21: Case Based Planner Platform For Rts Games

REFERENCES

Defeating Novel Opponents in a Real-Time Strategy Game - 2005.pdf – David W. Aha

Learning to Win - Case-Based Plan Selection in a RTS Game- 2005.pdf - David W. Aha

Case-Based Planning and Execution for RTS Games - 2007.pdf - Santiago Onta˜n´on

Situation Assessment for Plan Retrieval in RTS Games - 2009.pdf - Santiago Onta˜n´on