18
1 A Penguin Attack AI Jason Buck CS 470

A Penguin Attack AI

  • Upload
    drew

  • View
    27

  • Download
    0

Embed Size (px)

DESCRIPTION

A Penguin Attack AI. Jason Buck CS 470. 1. Project Overview. Goal Develop an AI that can play a competent game of Penguin Attack Why Ensures an opponent is always available. What is Penguin Attack? Created by myself and Tom Kircher Open source implementation of a Nintendo puzzle game - PowerPoint PPT Presentation

Citation preview

Page 1: A Penguin Attack AI

1

A Penguin Attack AIJason Buck

CS 470

Page 2: A Penguin Attack AI

Project Overview

• Goal– Develop an AI that can play a competent game of

Penguin Attack

• Why– Ensures an opponent is always available

Page 3: A Penguin Attack AI

• What is Penguin Attack?– Created by myself and Tom Kircher– Open source implementation of a Nintendo

puzzle game– Designed for network play

Page 4: A Penguin Attack AI

4

How is Penguin Attack Played?

Page 5: A Penguin Attack AI

How is Penguin Attack Played? (continued)

Page 6: A Penguin Attack AI

Project Requirements

• Network– AI is a network client

• Sends moves

– Game server sends game state information• Sends game state information• Sends control signals

Page 7: A Penguin Attack AI

Project Requirements (continued)

• AI– Search game state for potential combos– Generate move sequence to achieve combos

• Can send a string of sequential characters• Often sends one-character strings

– Must be competent• Typically able to last 3 min against me

Page 8: A Penguin Attack AI

System Design

• Written in Java– Not ideal, but “good enough”

• Network component– Largely isolated from AI– Connects to the server– Receive and store messages from the server– Send moves/commands from the AI to the

server

Page 9: A Penguin Attack AI

System Design (Continued)

• AI– Parse game state data– Update internal representation

• 2D-array of ADT “PenguinAttackBlock”

– Generate move sequence

Page 10: A Penguin Attack AI

Protocol

• Redesigned since proposal• Client requests state information as needed

– Commands are b, c, and t

• Client sends move sequences– Commands are u, d, l, r, s, m

• Client can notify server with quit• All other notifications are server to client

Page 11: A Penguin Attack AI

Protocol (Continued)

• Server notifications:– start– pause ... start– win– lose– closing connection

Page 12: A Penguin Attack AI

Protocol (Continued)

Board State:

b{ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 0n1.1n1h _ _ _ _ 0n5.1n3h1n4h _ _ 0n1.0n4.2n5h1n2h1n5h0n3.0n4.0n1. _ _ _ 0n2.0n2.0n5. _ _ 0n1.0n3.0n3.0n4.0n5.0n1.0n2.0n4.0n4.0n5.0n4.0n3.0n5.0n1.0n2.0n1.0n1.0n3.0n1.0n4.0n4.0n2.0n1.0n2.0n3.0n3.0n2.0n2.0n5.0n5.0n4.0n4.0n1.0n1.0n3q0n3q0n4q0n4q0n1q0n4q}

Mouse position:

<2 1>

Timing:

[1000 2000]

Page 13: A Penguin Attack AI
Page 14: A Penguin Attack AI

Algorithms

raiseStackToSafeHeight();

breakGarbage();

raiseStackToSafeHeight();

levelOffStack();

raiseStackToSafeHeight();

breakGarbage();

raiseStackToSafeHeight();

makeCombosAndChains();

• playPenguinAttack() loops through:

Page 15: A Penguin Attack AI

Evolutionary Prototyping

• Strategy needed to be refined– Different leveling algorithms– Keep improving the strategy– Much time spent testing

• Prototype was never ‘complete’ to my satisfaction– Never figured out how to make intentional

chains– Didn’t find a way to deal with ‘accidentals’

Page 16: A Penguin Attack AI

Schedule

• Didn’t keep detailed records of what happened when

• Worked on it whenever course load allowed• Made majority of progress during spring

break• Spent way more time than budgeted

Page 17: A Penguin Attack AI

17

What’s next?

• Will continue beyond the semester• Preventing accidentals and intentionally

making chains; AI will be brutal• Analyze the board in different ways while

waiting (Threads)• Improve efficiency (Synchronized clock?

Maintain own board state?)

17

Page 18: A Penguin Attack AI

Conclusion