a penguin attack ai
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 PresentationTRANSCRIPT
![Page 1: A Penguin Attack AI](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/1.jpg)
1
A Penguin Attack AIJason Buck
CS 470
![Page 2: A Penguin Attack AI](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/3.jpg)
• 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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/4.jpg)
4
How is Penguin Attack Played?
![Page 5: A Penguin Attack AI](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/5.jpg)
How is Penguin Attack Played? (continued)
![Page 6: A Penguin Attack AI](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/11.jpg)
Protocol (Continued)
• Server notifications:– start– pause ... start– win– lose– closing connection
![Page 12: A Penguin Attack AI](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/13.jpg)
![Page 14: A Penguin Attack AI](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/14.jpg)
Algorithms
raiseStackToSafeHeight();
breakGarbage();
raiseStackToSafeHeight();
levelOffStack();
raiseStackToSafeHeight();
breakGarbage();
raiseStackToSafeHeight();
makeCombosAndChains();
• playPenguinAttack() loops through:
![Page 15: A Penguin Attack AI](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/15.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/16.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062304/568145b0550346895db2adf8/html5/thumbnails/18.jpg)
Conclusion