GithubHelp home page GithubHelp logo

aws-samples / amazon-sagemaker-unity-game-simulation Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 6.0 307.79 MB

License: MIT No Attribution

Dockerfile 0.41% C# 2.46% Shell 0.90% Jupyter Notebook 5.83% Python 90.40%

amazon-sagemaker-unity-game-simulation's Introduction

unity-roller-ball-simulation

This is a sample unity project for Unity Game Simulation with ML-Agents running on Amazon SageMaker RL.

Preparation

Download this repo

First, download a zip file from the repo and open it.

Github repo

You will find a folder called unity-roller-ball-simulation-master.

Unity

Start Unity Hub. In Projects window, press Add and select RollerBall folder in the folder described above.

Unity Hub_0

You may need to download the version 2019.3.14.f1 version of Unity with Linux support module.

This is how the sample game, RollerBall looks like.

Unity Hub_1 Unity Hub_3

There are three important scripts, ObstacleManager.cs, RollerAgent.cs, and RollerBallConfig.json.

RollerBallConfig.json is found in Resources/Congig/.

Build the project for Linux platform

Open Player Settings (menu: Edit > Project Settings > Player).

  • Under Resolution and Presentation, ensure that Run in Background is checked.

Open the Build Settings window (menu:File > Build Settings).

  • Select Linux as Target Platform
  • (Optional) Development Build is checked.

Unity Hub_3

Press Build And Run

Unity Hub_4

We name a collection of built files as RollerBall_build_000.

Here is how the built files look like in the RollerBall folder.

Unity Hub_5

Copy the flowing files and folder and upload them to S3.

  • LinuxPlayer_s.debug
  • RollerBall_build_000_Data/
  • RollerBall_build_000.x86_64
  • UnityPlayer_s.debug
  • UnityPlayer.so

Unity Hub_6

Please take note of S3 URI. You are going to need that for rl_unity_cloud_simulation_sample.ipynb

Amazon SageMaker RL

Amazon SageMaker RL on SageMaker notebook

Start Amazon SageMaker and create Notebook Instance. (menu:Notebook > Notebook instance > Create notebook instance).

  • t3.xlarge instance is adequate.

Click Open Jupyter and select SageMaker Examples

SageMaker provides dozens of sample notebooks. You can find a samle notebook named rl_unity_ray under Reinforcement Learning tab.

SageMaker_1

Select rl_unity_ray and press Use botton. A new directry will be created.

/home/ec2-user/SageMaker/rl_unity_ray_YYYY-MM-DD

Go to rl_unity_ray_YYYY-MM-DD

SageMaker_1

Upload the following files of this repo to the directory above.

  • rl_unity_cloud_simulation_sample.ipynb
  • Dockerfile
  • entrypoint.sh

Replace the following files of the directory above with those in this repo.

  • src/evaluate-unity.py
  • src/train-unity.py

Proceed rl_unity_cloud_simulation_sample.ipynb

You are ready to start the notebook.

amazon-sagemaker-unity-game-simulation's People

Contributors

amazon-auto avatar araitats avatar yoheigon avatar zentahori avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.