Space War RL Project Introduction


Hello everyone! I'm a software engineer  by trade and I recently discovered ML/RL in one of my research projects. I only scratched the surface and wanted to get more into it than my work allows. I also wanted to do some game dev. As the result this side project was born.

Reinforcement Learning is perfect for games. I think what's intriguing about RL is that the AI agent does not have to be explicitly programmed to play the game. The agent can learn from interactions from the environment to improve itself during training. I chose to remake Space War 1985 because this was the first game my dad showed me as a child growing up. This is probably my first real project, because I found something passionate in to press on.

This is a project that combines:

  • ML/RL
  • Video Games
  • Nostalgia

My goal is to train some AI agents to play against. As a challenge, I will try to implement everything from scratch with pytorch and Playing Atari with Deep Reinforcement Learning paper. Instead of passing in the video frames as input to the neural network, I will attempt passing in numeric data like the enemy's position and velocity.  I think this will be easier for me to get started and this is something I can do later to compare training/evaluation performance.

BLOG

https://dev.to/edong/space-war-rl-0-series-introduction-25dh

SOURCE

https://github.com/e-dong/space-war-rl

STABLE SANDBOX

This gets updated when a pull request merges into main.

https://e-dong.itch.io/spacewar

DEV SANDBOX

This gets updated when every push to a pull request branch.

https://e-dong.itch.io/spacewar-dev



Some of my recent updates include new weapons and basic ship collision physics. I have started a blog to keep track of my progress and things I learn on the way!

Weapons

  • Added long range photon torpedoes
  • Added short range phasers
  • Added player death on hit

Blog Post

Ship Collisions

  • Added some energy loss due to ship collisions
  • Handle overlapping sprites

Blog Post

Next Steps

First, I will add a blog post on dev.to on automating my deployment to itch.io. Next, I will start implementing DQN from the atari paper and setting up the observation and action space of my simulation. I will start with the simple task of training an agent to destroy the enemy player quickly as possible. I will plot a graph of time to kill enemy over the training epoch. For my baseline, I will use an agent that only does random actions. Plotting both of these on the same graph will show me if the trained agent is improving over time.

Leave a comment

Log in with itch.io to leave a comment.