rusty-bird

Crates.iorusty-bird
lib.rsrusty-bird
version0.2.0
sourcesrc
created_at2021-06-08 13:49:07.287261
updated_at2021-06-14 22:56:44.420086
descriptionRusty bird is a simple flappy bird implementation that can be controlled by external applications via TCP. So the user is able to plug a reinforcement learning agent to it and play the game.
homepage
repositoryhttps://github.com/mawilms/rusty-bird
max_upload_size
id407819
size134,995
Marius Wilms (mawilms)

documentation

README

Rusty Bird

Github testing GitHub issues GitHub Latest version

Another Flappy Bird clone? :duck: Rusty bird is more than a Flappy Bird clone. Rusty bird was programmed to make your entry into reinforcement learning as easy as possible. With the help of Rusty Bird you can train your own independent agent to play the game.

Want to build an agent classically in Python? Maybe something more exotic like Haskell or Elixir? No problem. Rusty Bird uses a TCP stream that you can simply connect to and get the state and current score of the game.

You should definitely try Elixir! :eyes:

Table of contents

Features

  • Full fledged Flappy bird game
  • TCP Server to extract the state and score out of the game

Usage

Rust bird is a CLI application which starts the flappy bird game. Currently the only thing you need is the executable and Rust installed.

For precompiled versions:

You can start the game with rusty-bird start.

To run the app from source:

Clone the repo and execute the crate with cargo run -- start or build your own executable with cargo build

FAQ

How does the state information look like?

The state is send as a JSON struct. It contains the y-position of the Player, the score and the distance of the first three pipe obstacles and the player.

This is how the schema is looking:

{
  "player": <player y-position>,
  "score": <int>,
  "pipes": [
    [
      [<lower x distance>, <lower y distance>],
      [<upper x distance>, <upper y distance>]
    ],
    [
      [<lower x distance>, <lower y distance>],
      [<upper x distance>, <upper y distance>]
    ],
    [
      [<lower x distance>, <lower y distance>],
      [<upper x distance>, <upper y distance>]
    ]
  ]
}

This is example data:

{
  "player": 103.79996,
  "score": 0,
  "pipes": [
    [
      [168.0, 267.20004],
      [168.0, -182.79996]
    ],
    [
      [418.0, 98.20004],
      [418.0, -351.79996]
    ],
    [
      [668.0, 111.20004],
      [668.0, -338.79996]
    ]
  ]
}

Will you add new features to Rusty Bird?

Definitely! This project is a great learning experience for me. There are already a few features planned to make the development for your agents easier. Since I'm not a data scientist, I need your help! :blush:

License

Rusty Bird is release under the GNU GPLv3

Commit count: 15

cargo fmt