Skip to content

Commit

Permalink
[REG-1483] Reorganize sidebar (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeizer authored Dec 6, 2023
1 parent fa3e15f commit 3d6f42a
Show file tree
Hide file tree
Showing 147 changed files with 346 additions and 1,161 deletions.
44 changes: 20 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation
## Installation

```
$ yarn
```

### Local Development
## Local Development

```
$ yarn start -p 3005
Expand All @@ -18,26 +18,22 @@ $ yarn start -p 3005

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

When merging a PR or commit into main, the site will automatically deploy to https://Regression-Games.github.io/RegressionDocs
## Best Practices for this Project

### Naming Conventions
* Names of markdown files and images are kebab-case
* Names of markdown files should match either their `sidebar_label` or top-level title
* Images should be given descriptive filenames that reflect what they're being used to demonstrate
* Markdown partials begin with an underscore (ex. `_shared_section.mdx`)

### File Structure
* Markdown files are organized in a way that mimics their layout in the site's sidebar. This makes it easier to locate a file or link from one page to another.
* Ex. If the "Client Dashboard" page appears under "Session Insights" in the sidebar, then its path should be `docs/session-insights/client-dashboard.mdx`
* An image is always located within an `/img` directory at a reasonable depth in relation to the md that requires that image. The idea here is to make it easy to locate and link to images, so keep them close-by.
* Rule of thumb -> either same level as the md, or at its parent's level (`img/my-image.png` or `../img/my-image.png`)
* If an `/img` dir contains many images or is shared by many pages, organize images into subdirectories that match the names of the markdown files they belong to.
* Ex. images belonging to `docs/tutorials/building-your-first-bot` should be located under `docs/tutorials/img/building-your-first-bot/`

### Misc.
* DO NOT include important headers in partials - Docusaurus won't include these in the table-of-contents for any pages they are used in.
3 changes: 3 additions & 0 deletions docs/404.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Page Not Found

This page no longer exists. It may have moved, or its content is no longer supported by Regression Games.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_label: 'Authentication'
sidebar_label: 'Authenticating with API Keys'
---

# Authenticating with API Keys
Expand All @@ -15,7 +15,7 @@ the bottom of the screen within the **API Keys** section, enter a unique name fo
click **Generate New Key**. This token should be copied and stored somewhere safe - you won't be
able to see it again after it is generated. Keys have a default expiration date of 1 year.

![Generate API Key](./auth_images/generate_key.png)
![Generate API Key](img/generate-api-key.png)

:::danger

Expand Down
18 changes: 9 additions & 9 deletions docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ try it out and provide feedback! Contact us at [email protected] for dedicated
**New Features**

- New welcome screen added to the SDK, with docs and **sample scene/bot** options
- Introducing C# bots that run **directly in Unity** (reference materials [here](/studios/unity/unity-sdk/creating-bots/csharp/configuration))
- Introducing [**Bot Marketplace**](/studios/platform_features/marketplace) (Beta), which provides ready-to-go bots and integration instructions for those bots
- Introducing C# bots that run **directly in Unity** (reference materials [here](creating-bots/csharp/configuration))
- Introducing [**Bot Marketplace**](pre-made-bots) (Beta), which provides ready-to-go bots and integration instructions for those bots
- Introducing **Validation Dashboard** (Beta), which provides an interface to view validation runs for a bot, complete with screenshots, state information, and historical records of previous runs
- Introducing [**Agent Builder**](/players/creating-bots/agent-builder) (Beta), which provides a fast, low-code way to develop bots
- Introducing [**Agent Builder**](creating-bots/javascript/agent-builder) (Beta), which provides a fast, low-code way to develop bots
- Improved debug utilities like RGGizmos to see what your bot is thinking
- Bots can now be directly synced into your Unity projects
- New tutorials and guides for getting started
Expand Down Expand Up @@ -103,8 +103,8 @@ us at [email protected] for dedicated support and access.

**New Platform Features**

- New [RGAction attribute](/studios/unity/unity-sdk/RGAction) within RG Unity SDK to make actions easier to define
- [GitHub Actions and Unity Test Runner Support](/studios/unity/tutorials/github_actions) - New samples and guides for running bots
- New [RGAction attribute](integrating-with-unity/defining-actions) within RG Unity SDK to make actions easier to define
- [GitHub Actions and Unity Test Runner Support](tutorials/github-actions) - New samples and guides for running bots
in GitHub Actions (and other CI/CD systems via [GameCI](https://game.ci))
- UI improvements to Behavior Tree Beta
- Updated defaults for RG Unity SDK to be more user-friendly
Expand Down Expand Up @@ -142,19 +142,19 @@ us at [email protected] for dedicated support and access.

**New Platform Features**

- [Agent Builder](/players/creating-bots/agent-builder) Beta - Our GPT-enabled agent builder product is live for select players, now with improved validation tools. If you&apos;d like to try it out, let us know!
- [Agent Builder](404) Beta - Our GPT-enabled agent builder product is live for select players, now with improved validation tools. If you&apos;d like to try it out, let us know!
- Our documentation site is now live! This docs site includes API/SDK references, tutorials, guides, and FAQs for both players and developers.
- [API Keys](/studios/api_reference/authentication) - developers and players can now create API keys to interact with RG services
- [API Keys](authenticating-with-api-keys) - developers and players can now create API keys to interact with RG services
- New onboarding flow for players and game developers
- The ID of a bot can now be seen and copied within the Bot Manager
- Zip Bots - Bots uploaded via zip can now be downloaded
- The home page has been redesigned to provide players more information about getting started.

**Unity SDK Features**

- An early preview of our [Unity SDK](/studios/unity/unity-sdk/overview) for building AI agents is now live! Our docs site has a getting started guide - message us for access.
- An early preview of our [Unity SDK](overview) for building AI agents is now live! Our docs site has a getting started guide - message us for access.
- Developers can now create Unity bots from the Bot Manager
- Logs for bots can now be downloaded - available via API or through the [Bot History dashboard](/studios/unity/unity-sdk/in-editor-replay)
- Logs for bots can now be downloaded - available via API or through the [Bot History dashboard](session-insights/in-editor-replay)
- Character configuration for Unity bots is more flexible and customizable
- Validation results for QA testing bots are now saved to Unity Replay files, allowing for viewing the validation directly within Unity
- Default settings for the SDK have been adjusted for increased ease of use
Expand Down
19 changes: 0 additions & 19 deletions docs/common/agent-builder/_adding-nodes.mdx

This file was deleted.

42 changes: 0 additions & 42 deletions docs/common/agent-builder/_behavior-trees.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/common/agent-builder/_loading-your-tree.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/common/agent-builder/_saving-your-tree.mdx

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
sidebar_label: 'PlayTest Bots'
sidebar_label: 'Creating Adaptive Bots'
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Defining Bots for PlayTesting
# Defining Bots that Adapt to the Game State

Your Unity integration collects state information about GameObjects and notifies the Bot runtime with the updated state at a fixed tick interval.
Whenever the Bot runtime receives an update, Regression Games calls the `ProcessTick(RG rgObject)` method.
Expand All @@ -20,12 +20,12 @@ API methods that filter state objects and check conditions will record additiona
These are displayed side-by-side with Bot actions in the Replay utility to help debug your Bot by showing which decisons led to resulting behaviors.

:::info
If you are using the [[RGAction]](../../RGAction) attribute to generate your actions, then there are also typed `RGActionRequest` classes generated for that action. The snippets below provide examples for using both typed and untyped actions.
If you are using the [`[RGAction]` attribute](../../integrating-with-unity/defining-actions) to generate your actions, then there are also typed `RGActionRequest` classes generated for that action. The snippets below provide examples for using both typed and untyped actions.
:::

:::caution
Commands within `ProcessTick` interact with the game state represented by the current tick only.
This contrasts with [Validation Bots](./validation-bots), which can delay execution of commands for several ticks until expected conditions are met.
This contrasts with [Scenario Bots](./scenario-testing), which can delay execution of commands for several ticks until expected conditions are met.
:::

<Tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Implementing the `ConfigureBot` method is optional, but should be implemented wh

For spawnable Bots, `rgObject.CharacterConfig` is an object containing character configurations to help seat your Bot as the appropriate class/prefab/etc.
This is a freeform object to be interpreted by your game's implementation of the
[`RGBotSpawnManager.SeatBot`](../../RGBotSpawnManager#public-virtual-void-seatbotbotinformation-bottospawn)
and [`RGSpawnManager.SpawnBot`](../../RGBotSpawnManager#canbenull-public-abstract-gameobject-spawnbotbool-latejoin-botinformation-botinformation) interfaces.
[`RGBotSpawnManager.SeatBot`](../../integrating-with-unity/seating-and-spawning-bots#public-virtual-void-seatbotbotinformation-bottospawn)
and [`RGSpawnManager.SpawnBot`](../../integrating-with-unity/seating-and-spawning-bots#canbenull-public-abstract-gameobject-spawnbotbool-latejoin-botinformation-botinformation) interfaces.

<Tabs>
<TabItem value="character_config_simple" label="Simple definition" default>
Expand Down Expand Up @@ -103,7 +103,7 @@ protected override bool GetIsSpawnable()

Bots can be either `MANAGED` or `PERSISTENT`.
A `MANAGED` Bot will automatically disconnect when `RGBotServerListener.GetInstance()?.StopGame()` is called from the Unity Integration.
A `PERSISTENT` Bot must either terminate itself (see [complete()](./playtest-bots#complete)) when its tasks are complete or be terminated manually from the RG Overlay.
A `PERSISTENT` Bot must either terminate itself (see [complete()](adaptive-bots#complete)) when its tasks are complete or be terminated manually from the RG Overlay.
This allows `PERSISTENT` bots to stay active across multiple scenes/sessions.

#### Examples
Expand Down
13 changes: 13 additions & 0 deletions docs/creating-bots/csharp/scenario-testing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
sidebar_label: 'Scenario Testing'
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Defining Bots for Scenario Testing

:::info
Support for Unity C# Scenario Testing Bots is coming soon ...
:::

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,54 @@ import TabItem from '@theme/TabItem';

# Utilities for C# Bots

## RGFindUtils

`RGFindUtils` is a singleton providing a set of utility functions for finding GameObjects. This
is extremely useful when implementing [`RGAction`](../../integrating-with-unity/defining-actions)s that need to find other GameObjects in the scene.

The instance of `RGFindUtils` is automatically created when the scene is loaded, and can be accessed
with the following function:

```cs
RGFindUtils.Instance
```

### `public T FindOneByInstanceId<T>(int instanceId) where T: MonoBehaviour`

Finds an object of type `T` by its Instance ID. This Instance ID is the ID of the transform for that GameObject.
The type `T` is used to filter and cache objects in the scene of that type for efficient lookup.

#### Arguments
Argument Name | Type | Default | Description
---|---|---|---|
`instanceId` | `int` | required | The instance ID of the GameObject to find. This is often the ID within the state given by
Regression Games.

#### Return Value
The MonoBehaviour of type `T` that has been found in the scene on the GameObject within the given Instance ID.

#### Examples

<Tabs>
<TabItem value="rg_action_example" label="Start an action to follow another object" default>

```cs
public override void StartAction(Dictionary<string, object> input)
{
var targetInstanceId = int.Parse(input["targetId"].ToString());

var targetObject = RGFindUtils.Instance.FindOneByInstanceId<RGState>(targetInstanceId);
if (targetObject != null)
{
// Set some class variable that is then used in the `Update()` function
targetTransform = targetObject.transform;
}
}
```

</TabItem>
</Tabs>

## RGGizmos

`RGGizmos` is a utility for drawing specific Gizmos and debug information within your Unity scene. It is
Expand All @@ -21,7 +69,7 @@ The RGGizmos library currently supports three main features:
**Skip to the end of the RGGizmos section to see a video of these in action.**

All methods below can be accessed via the `RGGizmos` variable in your `ProcessTick(RG rgObject)` method that is
defined in your bot code (see the [Playtest Bots documentation](./playtest-bots) for more on implementing `ProcessTick`).
defined in your bot code (see the [Adaptive Bots documentation](./adaptive-bots) for more on implementing `ProcessTick`).

```csharp
public override void ProcessTick(RG rgObject)
Expand All @@ -37,7 +85,7 @@ public override void ProcessTick(RG rgObject)
You must have Gizmos enabled to see these features. While in Play mode, you can turn on the Gizmos in the top-right of
the editor:

![Gizmos](./gizmos_imgs/editor.png)
![Gizmos](img/show-gizmos-in-editor.png)

:::

Expand Down
Loading

0 comments on commit 3d6f42a

Please sign in to comment.