Skip to main content

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.

Metadata

Release files for peaceful-pie 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peaceful-pie 2.1.0
File Size Uploaded Provenance
peaceful_pie-2.1.0.tar.gz 6.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for peaceful-pie 2.1.0
File Interpreter ABI Platform
peaceful_pie-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / peaceful_pie-2.1.0.tar.gz

Download URL peaceful_pie-2.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f7d3541b92a55239c40547e97d923426feb5513da957da797684958a5c8a33ca
BLAKE2b-256 checksum
How to use checksums
36f9807b55578f463569629463d9b358ea01a3623a2dac2b513960c2dcbcb06b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / peaceful_pie-2.1.0-py3-none-any.whl

Download URL peaceful_pie-2.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46f234298d4a341f5beb4ac183120b850e8c6eb81acfdc5262b445154498c9cc
BLAKE2b-256 checksum
How to use checksums
fa372517f653a39552b59aabe7a300f2004eb78fd4276d5cdb68ca32b949dcd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Security for peaceful-pie 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page