slm-env-3dball v2.0.0
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.git
git clone https://github.com/kengz/ml-agents.gitThen 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
- npmpackage name prepended with- slm-env-, e.g.- slm-env-3dball
Build Unity Environment
- Build your Unity environment and commit asset source code to - ml-agentsrepo. 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 on- npmthat the name- slm-env-3dballis not already taken, so you can release.
- Come to this - SLM-Envrepo, create a new git branch from- master:- cd SLM-Env git checkout master git checkout -b 3dball
- Build these versions of binaries and save to - SLM-Env/build/:
- MacOSX version- make Academy > Training Configurationas 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 Configurationsame as MacOSX
- Headless Mode (checked)
- save name: 3dball
 
- make 
Next, ready to release.
Release
- Open up package.jsonand update:
- replace envnameas 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 and- package.json:- git add build/ git add package.json git commit -m 'add 3dball' git push --set-upstream origin 3dball
- Release to - npm(make sure you are logged in first, by- npm login):- npm publish- Since the binaries are huge, - npmwill throw an error near the end of it. Just ignore that.- npm ERR! registry error parsing json npm ERR! publish Failed PUT 403 npm ERR! code E403 npm 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-Labfor usage:- yarn add slm-env-3dball