Code Monkey home page Code Monkey logo

bevy_rl_shooter's Introduction

👾Multi-Agent 🎮 FPS Gym Environment with 🏋️ bevy_rl

Crates.io MIT/Apache 2.0 Crates.io Rust

app.2022-09-27.04-13-58.mp4

Project Description

This is a basic multi-agent gym environment for bevy_rl. It is a deathmatch free-for-all environment where agents spawn as red spheres and get +10 reward on kill. The environment is implemented in Rust using bevy game engine and bevy_rl plugin.

It implements very basics of a multi-agent environment. It is a good starting point for creating more complex environments.

  • Random initialization of agents
  • REST API for controlling agents (including state, reward and camera pixels)
  • REST API to reset an environment

You can wrap the environment with a python wrapper and use it with OpenAI Gym interface. (example in python/bevy_rl_rest_api.ipynb)

Environment Description

  • 16 agents spawn in a random position
  • Agents can move and rotate
  • Environment pauses every 0.1 second to fetch control commands from REST API
  • Reward: +10 on kill

Usage

  • follow bevy's setup guide to set up Rust
  • build an environment with cargo build +nightly --release;
  • run environment with ./target/release/bevy_rl_shooter --mode train
  • python/env.py implements a python wrapper for an environment
  • python/bevy_rl_rest_api.ipynb illustrates how to use the wrapper

bevy_rl_shooter's People

Contributors

stillonearth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bevy_rl_shooter's Issues

Index out of bounds error

When building and running with --mode train, I get an error:

❯ ./target/release/bevy_rl_shooter --mode train
2022-12-24T13:11:06.217342Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon Pro 5500M", vendor: 0, device: 0, device_type: DiscreteGpu, driver: "", driver_info: "", backend: Metal }
2022-12-24T13:11:06.692820Z  INFO gotham::start:  Gotham listening on http://127.0.0.1:7878
thread 'Compute Task Pool (4)' panicked at 'index out of bounds: the len is 0 but the index is 0', src/actors.rs:133:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/ari/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.9.1/src/task_pool.rs:273:45

Document required argument `-mode`

error: The argument '--mode <MODE>' requires a value but none was supplied

Running requires setting the mode argument, which is undocumented in the README.md. What value(s) are recommended?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.