Inspiration
We were inspired to create a different kind of AI. AI's for games have been made since virtual games existed. However, we though an interesting design and possible research angle would be to instead focus on binding the AI to human performance. The main inspiration of this was to add a reaction time. As we worked on this project, we realized just how interesting implementing reaction times and memory could be, despite coming up short in the end.
What it does
This project plays a game of Tetris. It's really quite simple.
How we built it
We first started with coding the game. In the interest of time, we utilized an online tutorial, slightly adapting it to our own needs. The game was coded using pygame. With this out of the way we focused most of the rest of our time on the AI. We focused on writing a simple AI to get to adding the constraints as quickly as possible. We opted for the small goal of being able to successfully clear at least a few lines consistently, using a simple design of filling the smallest holes that were big enough for the current piece. This however proved tougher to execute then we were hoping as can be seen in the next section.
Challenges we ran into
The main challenge was getting the AI and the game to interface well. Admittedly, our final version of the AI had plenty of logic errors and incorrect assumptions. This did not end up mattering since the AI could not easily parse and simulate the game due to the non-optimal game logic within the borrowed game code. Interfacing with this borrowed game code proved the most challenging due to many of the design choices in representing the shapes and game state chosen. For example, each shape was represented by ascii art on a 5x5 grid, which made it very difficult to assess future positions of falling pieces, especially when considering rotation.
Accomplishments that we're proud of
The main accomplishment that we are proud of was creating an AI that is able to play the game. We were also able to interface with open source code in an effective manner.
What we learned
Through this project we learned the importance of the game model when writing an AI. Had we designed the game model ourselves and done so with the implementation of an AI in mind, we would've had a much easier time implementing the AI itself. Furthermore, we had not worked with pygame before starting this project, which proved to be an interesting learning experience.
What's next for Tetris-Human-AI
The next steps are going to be re-writing the game from scratch, utilizing a much better interface for the AI to parse and make decisions based off of. From there, improving the AI model with a slightly harder to implement, but ultimately smarter solution would be the next goal. Finally, we would add the human constraints and test the AI with varying values for the constraints and without the constraints entirely to get a better understanding of the effect they have on performance.
Log in or sign up for Devpost to join the conversation.