e-dong / space-war-rl Goto Github PK
View Code? Open in Web Editor NEWRecreating Bill Seiler's 1985 version of Space War and training RL agents with Self-Play
Home Page: https://e-dong.itch.io/spacewar
License: GNU General Public License v3.0
Recreating Bill Seiler's 1985 version of Space War and training RL agents with Self-Play
Home Page: https://e-dong.itch.io/spacewar
License: GNU General Public License v3.0
This is a good way to start developing the DQN algorithm. The dummy player does not move or shoot back, so this should be an easy task. The goal of the agent is to eliminate the target as fast as possible while staying alive.
I can't use dist * cos(rad)
and dist* sin(rad)
, because that assumes the intercept is always the same. The intercept can change, so I would have to calculate a new line formula or copy the rect
and translate it correctly.
This is low priority and not that noticeable.
Implement zero gravity physics, when activating the thrusters the player will keep moving at the same velocity. It will be alot easier for the player to go out of bounds. I can either setup boundaries around the edges of the screen or implement the parallax of wrapping around the screen when the player goes out of bounds. I will probably do the latter since the original game does that.
This should run unit tests and deploy to itchio with butler.
I should make the scripts window's friendly for more access.
There are two weapons in the game:
In the original game, I noticed the image is different based on the angle the player fires them. For simplicity, I may keep them the same. Explosion animations will most likely be skipped for now. There can be multiple torpedoes, so the sprite class will make these easier to manage. There should be a timeout if the torpedoes do not hit anything and disappear.
This will probably be the simplest to implement. I can just draw a straight line. I can probably use pygame.draw
to draw a line. I will need to check if the rect collides with a player
Replace the "Get Started" code and create a player sprite class. Movements in space war will be implemented in #2 , so I will use the same movements from the get started code. (WASD)
Create pixel art for the player 2 sprite and render it in the game
In the 1985 game, the ship would wrap around to the other side of the screen. I should implement this as well.
#4 should be done first, collision with the projectiles will cause the shields to go down. Once shields are depleted, implement player death. When energy is depleted, ship cannot move and fire weapons until energy regenerates.
Extract the logic into util functions to create unit tests
This would be good for those who want to download rather than play on the web.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.