Skip to content

Motion Generation for Imaginary Creatures

License

Notifications You must be signed in to change notification settings

dwango/RLCreature

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RLCreature for Unity (日本語)

Install

0. Install Unity

  • We are using 2018
  • Set ScriptingRuntimeVersion to .NET4.X

1. Clone Repository

  • git clone --recursive https://github.com/dwango/RLCreature.git
  • git-lfs is required

2. Install Dependencies

3. Open Demo Scenes

  • Assets/RLCreature/Sample/RandomCreatures
  • Assets/RLCreature/Sample/DesignedCreatures
  • Assets/RLCreature/Sample/VariousHeights
  • Assets/RLCreature/Sample/Driving
  • Assets/RLCreature/Sample/SimpleHunting

Create Original Creatures

see Assets/RLCreature/Sample/DesignedCreatures/DesignedCreaturesEntryPoint.cs

// Instantiate prefab (see Assets/RLCreature/Sample/DesignedCreatures/CreaturePrefabs)
var centralBody = Instantiate(creaturePrefab);

// Add Sensor and Mouth for food
Sensor.CreateComponent(centralBody, typeof(Food), State.BasicKeys.RelativeFoodPosition, range: 100f);
Mouth.CreateComponent(centralBody, typeof(Food));

// Initialize Brain
var actions = LocomotionAction.EightDirections();
var sequenceMaker = new EvolutionarySequenceMaker(epsilon: 0.1f, minimumCandidates: 30);
var decisionMaker = new ReinforcementDecisionMaker();
var souls = new List<ISoul>() {new GluttonySoul()};

var brain = new Brain(decisionMaker, sequenceMaker);
var agent = Agent.CreateComponent(creatureRootGameObject, brain, new Body(centralBody), actions, souls);

Reference

@inproceedings{ogaki2018,
  author = {Keisuke Ogaki and Masayoshi Nakamura},
  title = {Real-Time Motion Generation for Imaginary Creatures Using Hierarchical Reinforcement Learning},
  booktitle = {ACM SIGGRAPH 2018 Studio},
  year = {2018},
  publisher = {ACM}
}