Giter Site home page Giter Site logo

hughperkins / peaceful-pie Goto Github PK

View Code? Open in Web Editor NEW
14.0 6.0 3.0 3.24 MB

Control Unity from Python! Use for reinforcement learning.

License: MIT License

C# 53.45% Python 37.47% Shell 3.07% Dockerfile 6.01%
python reinforcement-learning unity

peaceful-pie's Introduction

Peaceful Pie

Connect Python with Unity for reinforcement learning!

Video:

Control Unity from Python WITHOUT mlagents

CI

CircleCI

Examples

Installation

You need to install both into Unity project, and into your Python environment.

In Unity

  • In Unity, go to Window | Package Manager
    • change the dropdown in top left to 'Packages: In Project'
    • check that Newtonsoft Json appears
    • if Newtonsoft Json is not already in your project:
      • click on the '+' in the top left, and choose 'Add package by name...'
      • put the name com.unity.nuget.newtonsoft-json, then click 'Add'
  • In Unity, in your project's "Assets" folder, create a "Plugins" folder, if it doesn't already exist
  • First install AustinHarris.JsonRPC:
    • Download https://www.nuget.org/api/v2/package/AustinHarris.JsonRpc/1.2.3
    • rename to have filename suffix be .zip (you might need to turn on options to see all file extensions)
    • unzip the resulting zip file
    • copy lib/netstandard2.1/AustinHarris.JsonRpc.dll into your Plugins folder
    • select the file, in your Plugins, and in 'Inspector' unselect 'validate references', and click 'Apply'
  • Click on 'Releases', on the right of the github page
    • in the most recent release, download PeacefulPie.dll
  • Copy PeacefulPie.dll into your Unity project's Plugins folder
  • If on Mac silicon:
    • in Unity, goto Plugins, click on PeacefulPie.dll
    • in Inspector, change 'CPU' setting from 'Intel' to 'Any CPU', then click 'Apply'
    • do the same for AustinHarris.JsonRpc.dll

You should be good to go :)

In Python

pip install -U peaceful-pie

Requirements

  • currently tested with:
    • python 3.10
    • Unity 2021.3.16.f1
  • support Python version: >=3.8.0, <4.0.0
  • please create an issue if your preferred platform is not supported (I'm guessing I might need to downgrade Python a little? Let me know!)

Dev

I'm usng Visual Studio for Mac to write this.

peaceful-pie's People

Contributors

hughperkins avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

peaceful-pie's Issues

ConnectionError

I follow the same instruction from the tutorial but cannot connect to Unity, It's just output "requests.exceptions.ConnectionError => ignoring, retrying". Can anyone help me to resolve this?

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.