Methods for installing the package differs for each game engine. For games building browser games (using Javascript), you can install the package as follows:
For studios that use Unity or Unreal engine, please directly message an NRN team member to get access to the package.
In order to start using the SDK, you will need to set your apiKey and gameId as static attributes on the AgentFactory class (in Javascript) or ModelWrapper class (in C#). Each apiKey only works for a specific gameId.
Now that you have your apiKey and gameId set, every HTTP request you make to the NRN Agents server will automatically use it.
In order for the NRN Agents SDK to know how to communicate with a game, we need to add 2 files. These files will define the and , which we begin to discuss in the section.
It is advised that game studios make an nrn-integration folder inside their helpers folder. Inside this folder, we need to add the files to define the state and action space.
It is advised that game studios make an NrnIntegration folder inside theScript folder. Inside this folder, we need to add the files to define the state and action space.
It is advised that game studios make an NrnIntegration folder inside the folder where they have all their game code. Inside this folder, we need to add the files to define the state and action space.
npm install nrn-agentsconst { AgentFactory } = require('nrn-agents');
AgentFactory.setApiKey("my-api-key");
AgentFactory.setGameId("my-game-id");using ArcAgents.MachineLearning;
ModelWrapper.SetApiKey("my-api-key");
ModelWrapper.SetGameId("your-game-id");.
βββ src/
βββ helpers/
βββ nrn-integration/
βββ nrn-state-space.js
βββ nrn-action-space.js.
βββ Assets/
βββ Scripts/
βββ NrnIntegration/
βββ NrnStateSpace.cs
βββ NrnActionSpace.cs.
βββ Source/
βββ Game/
βββ NrnIntegration/
βββ NrnStateSpace.cpp
βββ NrnStateSpace.h
βββ NrnActionSpace.cpp
βββ NrnActionSpace.h