44
CS 680: GAME AI INTRODUCTION TO GAME AI 1/9/2012 Santiago Ontañón [email protected] https:// www.cs.drexel.edu /~ santi /teaching/2012/CS680/ intro.html

CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

CS 680: GAME AI INTRODUCTION TO GAME AI

1/9/2012 Santiago Ontañón [email protected] https://www.cs.drexel.edu/~santi/teaching/2012/CS680/intro.html

Page 2: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

CS 680 • Focus: advanced artificial intelligence techniques for computer games.

• Goal: cover state-of-the-art AI techniques that are 1)  Recently used in commercial games, 2)  Open problems in the game AI research community.

Page 3: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 4: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 5: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Structure of the Course •  3 blocks:

•  Real-time Strategy Games, Drama Management, Procedural Content Generation

•  Flexible content

•  Students need to: •  Complete 3 group projects (one per block)

•  One of them will be your focus, and you will write a paper about it. •  Read 1 paper and present it in class

•  on-line students will prepare a powerpoint/keynote/pdf presentation with audio

•  Every 3 hour class will be divided in: •  2 student paper presentations (20 minutes each) •  Lecture •  Project support session

Page 6: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Grading • Projects: 70%

•  Focus project: 40% •  Secondary projects: 15% each

• Paper presentation: 20% • Attendance and class participation: 10%

Page 7: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Prerequisites • Basic knowledge of artificial intelligence:

•  Heuristic Search (e.g. A*) •  Game tree Search (e.g. minimax)

• Readings: •  “Artificial Intelligence: A Modern Approach” (Russell & Norvig)

(Chapters 3,5,18)

Page 8: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 9: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

What is Game AI? • Artificial Intelligence for Computer Games • Different from traditional AI

Traditional AI: Optimality, efficiency Game AI: Fun, artificial “stupidity”

Page 10: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

What is Game AI? •  Intersection of games and AI:

•  Two (three) main communities working on it: •  Academics:

•  Artificial Intelligence community: how can games help us have better AI (AI centric)

•  Computer Game scholars: how can AI help us have better/more interesting/new forms of games?(Games centric)

•  Game industry: •  Their goal is to make games that sell more units (games centric)

Games AI

Page 11: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 12: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI

Pac-Man (1980) First ever game to feature AI

AI: finite state machine

Page 13: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI

“Pac-Man” (1980) First ever game to feature AI

AI: finite state machine

Page 14: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI

“Double Dragon” AI: Finite State Machines

Page 15: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI Chess AI needs to provide a collection of difficulty levels. Only one: hardest (to be played only against grand-masters), falls into the realm of traditional AI.

Page 16: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI “The Secret of Monkey Island” “And Then There Were None” Dialogues, storytelling

Page 17: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI

“Left 4 Dead 2” AI Director adjusts game pace to ensure desired dramatic effects

Page 18: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI

“Black & White” Uses machine learning to simulate a learning creature

Page 19: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Examples of Game AI “Starcraft II” Strategy, planning, path-finding, economics, etc.

Page 20: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Types of Game AI •  Inside the game:

•  Character control •  Director (drama management)

• During game development: •  Help in behavior/content design

• After game deployment: •  Analysis of game data

Page 21: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Types of Game AI •  Inside the game:

•  Character control •  Director (drama management)

• During game development: •  Help in behavior/content design

• After game deployment: •  Analysis of game data

Covered in this course

Page 22: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 23: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Basic Game AI Techniques • Scripting: Finite State Machines, Behavior Trees • Path-finding: A* • Game Tree Search: Minimax • Driving games: Steering behaviors •  [Physics: inverse kinematics]

• Plus a lot of fine-tuning

Page 24: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Scripting • Most used game AI technique by far (99% of the games) • Predefine behaviors of characters in the game • Examples:

•  Classic games (Pac-man, space invaders.), •  platformers (mario, turrican, etc.), •  strategy games (Dune II, Starcraft, etc.) •  Etc.

• Standard techniques: •  Finite-state machines •  Behavior trees •  Rule-sets •  High-level languages (e.g. lua)

Page 25: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Path-finding •  For navigating in complex maps

• Examples: •  Strategy games •  First-person shooters (Doom, Half-Life, etc.) •  RPGs (Skyrim)

• Standard techniques: •  A* •  Waypoint maps

Page 26: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Game Tree Search • Adversarial games

• Examples: •  Board games (chess, checkers, backgamon, etc.)

• Standard techniques: •  Alpha-beta search (minimax)

Page 27: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Basic Game AI Techniques • Not the goal of this course

•  These basic Game AI techniques are covered in the intro to Game AI course (next quarter)

Page 28: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 29: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Course Scope • Advanced AI techniques:

•  recent theoretical developments with new applications to commercial games.

• Real-Time Strategy Games • Drama Management • Procedural Content Generation

Page 30: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Course Scope • Advanced AI techniques:

•  recent theoretical developments with new applications to commercial games.

• Real-Time Strategy Games •  Flexible smart architectures for RTS game AI •  Real-time path finding for large maps, with large number of units •  Complex intelligent decision making

• Drama Management • Procedural Content Generation

Page 31: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Course Scope • Advanced AI techniques:

•  recent theoretical developments with new applications to commercial games.

• Real-Time Strategy Games • Drama Management

•  Self-adapting games •  Player modeling •  Automatic interestingness evaluation

• Procedural Content Generation

Page 32: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Course Scope • Advanced AI techniques:

•  recent theoretical developments with new applications to commercial games.

• Real-Time Strategy Games • Drama Management • Procedural Content Generation

•  Automatic map and level generation •  Automatic story and plot generation

Page 33: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 34: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Paper Presentations • Each student will have to read a paper and give a 15-20

minutes presentation in class about it

• Presented papers will concern related topics to what was covered in class the previous week

•  For copyright reasons, I’ll give you the private URL for downloading the papers in class

Page 35: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Outline • Structure of the course •  Intro to Game AI • Examples of Game AI • Basic Game AI techniques • Course Scope • Paper presentations • Projects

Page 36: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Projects • Group projects (2 people per group) •  3 projects • Each group will pick one as their focus project •  Focus project:

•  The group will write a 6-page (AAAI proceedings style format) about their project

•  Students are encouraged to consider submitting their paper to a Game AI conference if they consider the obtained results interesting.

• Non-focus projects: •  Each group will have up to 20 minutes of time at the end of the

course to present them in class

Page 37: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Projects Goal •  The goal of the projects is not to implement some

techniques and see that they work

•  The goal is to understand their strengths and limitations

• Before starting the implementation of a project think what is that you want to understand, and don’t lose time with aspects of the implementation that are irrelevant to your experiments.

• You will be required to experiment with your implementation and present experimental results showing strengths and limitations of the implemented techniques

Page 38: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Projects Experimentation •  The goal of your experiments is not to show that the

algorithm you implemented is the best

•  The goal is to understand the algorithm: •  When does it work, and when does it not? •  Why? •  What could be done to improve it? •  Does it achieve the desired effect?

• Results showing an algorithm doesn’t work do not mean your project is bad.

Page 39: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Project 1: Real-Time Strategy Games • You will have to implement an AI bot for a real RTS game.

I suggest using one of these:

Starcraft S3

Page 40: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Project 1: Real-Time Strategy Games • Your AI bot needs to:

•  Play the complete game: •  Doesn’t have to be very good. Use, for example, a simple finite-state

machine technique to design the overall strategy of your bot. •  Implement one of the advanced techniques we will study in class

concerning: real-time path-finding, or decision making.

• Experiment with your bot: •  Make it play against the built-in AI, or against other existing Ais •  Compare the performance of your bot before and after

implementing the advanced technique: •  Does it play better or worse? •  Is it more or less fun to play against?

Page 41: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Project 2: Drama Management •  Implement a Drama

Manager on top of a game engine. I will provide you with one, but feel free to use another.

•  The game engine comes with a specific game defined. Feel free to modify it or extend it if you need additional elements in your game to test your DM

Page 42: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Project 2: Drama Management •  Identify what do you want your Drama Manager to

accomplish (control difficulty, lead the player to more enjoyable plots, etc.)

•  That will determine what actions do you want the DM to be able to perform in the game

• Decide what technique you will use (search-based, CBR, etc.), and if it is search-based you will need to define the function to optimize

• Experiment with your DM: •  Ask some friends to play the game with or without it, and see their

reactions. Does the DM achieve its goal? Is the game more fun?

Page 43: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Project 3: Procedural Content Generation • Add procedural content

generation techniques to a game engine.

• Use the same game engine you used for Project 2

• You can choose whether you want the system to generate maps/rooms or story

Page 44: CS 680: GAME AI - Drexel CCI€¦ · • Real-time Strategy Games, Drama Management, Procedural Content Generation • ... • Automatic map and level generation • Automatic story

Project 3: Procedural Content Generation • Determine exactly the extent of what you want to be

procedurally generated: •  Given a story, generate maps? •  Given a story and a high-level map, generate rooms? •  Given a map and rooms, generate a story? •  Etc.

• Pick a PCG technique (search-based, CBR, etc.) • Experiment with the result:

•  Is the generated content better than the original one? •  Was it cheaper to generate? •  Are the games with content generated procedurally as fun as the

original one?