We thought space could get pretty boring without anything to do, so we made a space "station." With our space station you can:
- Play Polite Invaders (our Space Invaders spin-off),
- Get an AI to play Polite Invaders (A trained model is included in the repository),
- Watch the AI learn to play Polite Invaders,
- Monitor the latest tweets about the Mars Perseverance Rover, and
- Listen to music (it is a "station" after all...)
We wanted our hack to be an unnecessarily over-engineered goofy and cool project that combined different technologies under a single metaphorical space umbrella.
Polite Invaders - Our spin-off space invaders where both you and the villainous invaders (consisting of space creepers, death stars, and space cookies) have one thing in common, politeness. The invaders may be villanous, but in our game, you don't need to shoot them to drive them away. Instead, you aim and shoot polite emails at them, so they apologize and leave. They will also respectfully apologize and leave if they bump into you on the way down. Getting the invaders to leave gets you 1 point each. You win if you reach a total of 42 points or if you survive for 99 seconds. 99 seconds equal 15 space minutes, and the invaders legally have to leave if they can't invade you in that time. If any one of them manages to move past the bottom, though, you lose. The invaders appear more frequently as you rack up points, so the game only gets harder.... until 15 space minutes pass, of course.
AI - Left, Right, Stay and Shoot isn't really something you need a neural network for... but since our goal was overengineering, we used an evolving neural network. Specifically, we used the NeuroEvolution of Augmenting Topologies method of evolving neural networks in a reinforcement learning model. Multiple generations of genomes play the game and make decisions that are either rewarded or punished, depending on the outcome. Eventually, the neural network figures out how to play the game, and when it reaches a certain score threshold, the model is stored in a file. This file is later loaded when you want the AI to play in a non-training scenario. The training runs at a much higher fps with a lot of the eye candy stripped, while the testing is a copy of the standard game for humans except for the neural network making the decisions.
Music - Space is cool to look at, but it'd probably be cooler to listen to music while gazing into the gorgeous abyss on the way to the moon. We added a simple music player with space tunes to jam out to.
Perseverance - We like to keep an eye on Perseverance and thought you might too, so we used Twitter's API to show you the latest progress tweets :)
What we used
- neat-python for the evolving neural network architecture
- pygame for the game, space AI and music visuals
- The Twitter API for Perseverance tweets
- We made our own space art inspired by Starwars, Minecraft, and Rick and Morty made using Pixilart
- Astronaut background from UHDPaper.com
- Daniel Zawadzki's CSS from templatemonster.com which served as the basis for our modifications
- Space Music at www.bensound.com" from Bensound
- List of songs for our radio:
- Starwars Theme
- Imperial March
- Rick and Morty Theme
- Star Trek 2009 Theme
- Rocket Man
- Space Oddity
Not much. We added all the space functionality we were aiming for, and we are particularly proud of how it looks. We wish the eel library worked better with pygame implicitly; our hacky workaround using subprocesses works but at a small cost to the user experience.
I think our biggest challenge was coming up with a vision to combine all these technologies into a single project in the given time. The game, AI and music player components of the space station could serve as apps in their own right, so it was pretty hectic (but fun) to plan out and implement a game, write a training model for the AI and create a music player while making sure the project looked good and performed consistently. We also hadn't built an app with such diverse sub functionalities before, so we ended up spending a fair bit of time learning how to get them to work together. We also spent a little bit of time debugging differences in the app when running on Windows vs Linux.