Practical Game AI (give or take)

24
Practical Game AI (give or take) Dave Pottinger, President/CEO @dcpottinger www.bonusxp.com

description

Practical Game AI (give or take). Dave Pottinger, President/CEO @ dcpottinger www.bonusxp.com. What is this talk?. ½ AI Programming bits ½ Designer-y stuff ½ Hard/Fun/ Sh * tty Lessons Learned Q&A. WTF do I know?. Increasingly little;) Making games since 1993 - PowerPoint PPT Presentation

Transcript of Practical Game AI (give or take)

Page 1: Practical Game AI (give or take)

Practical Game AI(give or take)

Dave Pottinger, President/CEO@dcpottinger

www.bonusxp.com

Page 2: Practical Game AI (give or take)

What is this talk?

• ½ AI Programming bits• ½ Designer-y stuff• ½ Hard/Fun/Sh*tty Lessons Learned• Q&A

Page 3: Practical Game AI (give or take)

WTF do I know?• Increasingly little;)• Making games since 1993• Programmer, Designer, Reluctant Biz Guy

Page 4: Practical Game AI (give or take)

What is Practical Game AI?

“…more what you’d call guidelines than actual rules.”

Page 5: Practical Game AI (give or take)

Buzzwords vs. Basics

• Sexy– Genetic Algorithms– Neural Nets, Learning Code– Expert Systems– A*

• Useful– Data driven code– Understandable, reusable code– Good team dev skills– A*

Page 6: Practical Game AI (give or take)

So, let’s design an AI!

• Unit/Character vs. Player• Player AI Questions– Does it have to play a symmetric game?– Can it Cheat? Should it Cheat?– Difficulty levels?– Replayable?– Learning?

Page 7: Practical Game AI (give or take)

RTS Unit AI

• Action system– Idle, Attack, Gather– Animation management

• Player Commands• Entity Logic– Searching, Attack Response

• Pathfinding & Movement• Player AI interface

Page 8: Practical Game AI (give or take)

RTS Player AI

• Basics– Resource Gathering– Base Construction– Attacking

• Advanced– Situational Response– Planning & Unit Coordination– Variety, Replay

• Strategic Layers

Page 9: Practical Game AI (give or take)

OMFFFG, where do I start?

• Play the Game• Blank files are scary, therefore…

“Baby Steps”

Page 10: Practical Game AI (give or take)

Breadth Example: RTS Attacking

• Attack components– Troops (which require buildings & resources)– Target– Path– Timing/Coordination– Difficulty level– Etc

This is a HUGE task!

Page 11: Practical Game AI (give or take)

Breadth Example: RTS Attacking

• TLDR: Fake everything;)• Phase 1:– Pre-placed troops– Specific target– TASK: Get the troops to attack the target

Page 12: Practical Game AI (give or take)

Breadth Example: RTS Attacking

• Phase 2:– Pre-placed troops– Multiple targets– TASK: Data-drive the target priorities

Page 13: Practical Game AI (give or take)

Breadth Example: RTS Attacking

• Phase 3:– Pre-placed buildings– Cheat the resources– TASK: Train the troops

Page 14: Practical Game AI (give or take)

Breadth Tidbits

• Get an End Result ASAP• Designers must use it• Ingame debug display• Love the Iteration

Page 15: Practical Game AI (give or take)

Representation Example #1: Abstract Type System

• Like hashtags• Blends base types and logical types• Lists are precomputed• Use everywhere– Searching– Research Prereqs

Page 16: Practical Game AI (give or take)

Representation Example #2:Resource Site Aggregation

• Combine individual items• Done at load time• Makes AI play more “like a human”• Faster to search

Page 17: Practical Game AI (give or take)

Representation Example #3:Terrain Analysis

• Make areas @ load• More “human”, etc.• Add data• Feed into Strategy

Page 18: Practical Game AI (give or take)

Managing the Player

• Context Hook– Give Players a way to believe– They will fill in the gaps

• Some randomness is important• No one likes to lose to an AI– Make them sweat– Create excuse options

Page 19: Practical Game AI (give or take)

General Advice

• AI should be fun for players, not you• Build & Iterate, don’t Plan• Get it running quickly!• Build a good test harness

Page 20: Practical Game AI (give or take)

Programmer Advice #1

• Ideally, wait until the game is fun• Stick to what you know• 90% of effective AI is simple code• Everyone should do AI… Yay?

Page 21: Practical Game AI (give or take)

Programmer Advice #2

• Structure and Representation are the keys

• Write defensive logic• Don’t be afraid to refactor• If you can’t recite A*, you’re

doing it wrong

Page 22: Practical Game AI (give or take)

Design Advice

• Learn how to program;)• Pick the team’s battles• Players will fill in the gaps• One exploit ruins everything• Exaggerate the AI

Page 23: Practical Game AI (give or take)

Side Effects of Good AI

• You’ll find– Misplaced game logic– New & exciting ways to break the game– Performance problems– Hard to understand game systems– Multiplayer exploits

• Automated Testing potential

Page 24: Practical Game AI (give or take)

Questions?

Dave Pottinger, President/CEO@dcpottinger

www.bonusxp.com