SLM-Env
Unity environment binaries for SLM-Lab, built from kengz/ml-agents.
If you're just using prebuilt environments for the Lab, just install the released binaries via yarn
: e.g. yarn add slm-env-3dball
.
This repository hosts the built Unity environment binaries released to npm
.
Installation
You need this repo SLM-Env
and the builder repo kengz/ml-agents
(use the fork as opposed to Unity/ml-agents
).
git clone https://github.com/kengz/SLM-Env.gitgit clone https://github.com/kengz/ml-agents.git
Then follow the setup instruction and intro from ml-agents
for Unity.
Naming Convention
Since the binaries are committed to Github, released on npm
, and used by SLM-Lab, follow the convention compatible to all of them.
- Unity raw assets can follow Unity convention:
CamelCase
, e.g.3DBall
- built binaries
env_name
:kebab-case
, e.g.3dball
- git branch name the same as
env_name
:kebab-case
, e.g.3dball
npm
package name prepended withslm-env-
, e.g.slm-env-3dball
Build Unity Environment
-
Build your Unity environment and commit asset source code to
ml-agents
repo. For the most part follow the original doc. Remember the core settings:Player > Resolution and Presentation > Run in Background (checked)
Player > Resolution and Presentation > Display Resolution Dialog (Disabled)
Academy > Brain > External
-
When ready to build binary, decide on an
env_name
, e.g.3dball
. You may want to check onnpm
that the nameslm-env-3dball
is not already taken, so you can release. -
Come to this
SLM-Env
repo, create a new git branch frommaster
:
cd SLM-Envgit checkout mastergit checkout -b 3dball
- Build these versions of binaries and save to
SLM-Env/build/
:
- MacOSX version
- make
Academy > Training Configuration
as follow (or leave as-is if smaller thanInference Configuration
):- Width: 128
- Height: 72
- Quality Level: 0
- Time Scale: 100
- build directory:
SLM-Env/build/
- save name:
3dball
- make
- Linux version
- make
Training Configuration
same as MacOSX Headless Mode (checked)
- save name:
3dball
- make
Next, ready to release.
Release
- Open up
package.json
and update:
- replace
envname
as proper:"name": "slm-env-3dball",
- if this is an update, bump version. Default is
"version": "1.0.0",
- commit and push the new
build/
folder andpackage.json
:
git add build/git add package.jsongit commit -m 'add 3dball'git push --set-upstream origin 3dball
- Release to
npm
(make sure you are logged in first, bynpm login
):
npm publish
Since the binaries are huge, npm
will throw an error near the end of it. Just ignore that.
npm ERR! registry error parsing jsonnpm ERR! publish Failed PUT 403npm ERR! code E403npm ERR! You cannot publish over the previously published version 1.0.0. : slm-env-3dball
It should be available on npmjs.com, just search for your package slm-env-3dball
.
- Add the release to
SLM-Lab
for usage:yarn add slm-env-3dball