diff --git a/README.md b/README.md index d234fbd6..5880b7a9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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= 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. \ No newline at end of file diff --git a/docs/404.mdx b/docs/404.mdx new file mode 100644 index 00000000..b045ffab --- /dev/null +++ b/docs/404.mdx @@ -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. \ No newline at end of file diff --git a/docs/studios/api_reference/authentication.mdx b/docs/authenticating-with-api-keys.mdx similarity index 93% rename from docs/studios/api_reference/authentication.mdx rename to docs/authenticating-with-api-keys.mdx index 8aed10ff..040c655f 100644 --- a/docs/studios/api_reference/authentication.mdx +++ b/docs/authenticating-with-api-keys.mdx @@ -1,5 +1,5 @@ --- -sidebar_label: 'Authentication' +sidebar_label: 'Authenticating with API Keys' --- # Authenticating with API Keys @@ -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 diff --git a/docs/changelog.mdx b/docs/changelog.mdx index ac3717ad..6bae0294 100644 --- a/docs/changelog.mdx +++ b/docs/changelog.mdx @@ -18,10 +18,10 @@ try it out and provide feedback! Contact us at info@regression.gg 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 @@ -103,8 +103,8 @@ us at info@regression.gg 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 @@ -142,9 +142,9 @@ us at info@regression.gg 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'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'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 @@ -152,9 +152,9 @@ us at info@regression.gg for dedicated support and access. **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 diff --git a/docs/common/agent-builder/_adding-nodes.mdx b/docs/common/agent-builder/_adding-nodes.mdx deleted file mode 100644 index af9ac751..00000000 --- a/docs/common/agent-builder/_adding-nodes.mdx +++ /dev/null @@ -1,19 +0,0 @@ -New Agent Builder projects start with a root node and a sequence node to form the basis of your tree. - -![Default Tree](./img/default-tree.png) - -To begin building your tree, click the connector at the bottom of the sequence node and drag. -When you release, you'll be presented with different types of nodes that can be added to this sequence. -For this demonstration, we'll create an action node. -You can repeat this process for any node that is allowed to have children. - -![Select a Node Type](./img/select-node-type.png) -![Create an Action Node](./img/new-action-node.png) -![Example Tree](./img/example-tree-1.png) - -Clicking on a node opens a panel to the right side of your screen. -This panel contains information about the selected node including a description of the node's type and a label, as well as a button to delete the node from the tree. -It's a good idea to set labels to keep track of what you want each node or branch to do. -If the selected node is a leaf node, such as an action or condition, then the panel will also contain fields used for defining the node's behavior via code. - -![Open the Node Panel](./img/edit-node.png) \ No newline at end of file diff --git a/docs/common/agent-builder/_behavior-trees.md b/docs/common/agent-builder/_behavior-trees.md deleted file mode 100644 index 5cf106bd..00000000 --- a/docs/common/agent-builder/_behavior-trees.md +++ /dev/null @@ -1,42 +0,0 @@ -A behavior tree is a decision-making model used to determine which actions an agent (such as a character in a video game) should take in different situations. -You can think of a behavior tree as a flow chart that the AI follows, choosing appropriate actions based on what it knows about itself and its environment. -A behavior tree is composed of nodes organized into a hierarchical structure which starts with a root node and branches out to form different paths. -Each path represents a line of decision-making that results in one or more actions for the AI to perform. - -Each node in the tree executes logic and returns one of the following statuses as a result: - -- **Running** -> The task represented by this node's branch hasn't yet completed. -- **Success** -> The node has completed its task successfully. -- **Failure** -> The node has failed its task. This doesn't necessarily mean an error occurred. For example, a heal action might fail if the character doesn't have any potions. - -Different types of nodes have different responsibilities and may react differently to the statuses of other nodes. - -- **Root Node**: The beginning of the tree, where the AI starts its decision-making. - Its job is simply to execute whatever node is below it in the tree and return its status. -- **Sequence Node**: This node has one or more children and acts as a logical AND. - It executes its child nodes sequentially, and if any one of them fail then the Sequence Node immediately returns a failure status, skipping execution of any remaining children. -- **Selector Node**: This node also has one or more children, but acts as a logical OR. - It executes its child nodes sequentially, and if any one of them succeed then the Selector Node immediately returns a success status, skipping execution of any remaining children. - If none succeed, then the Selector Node returns a failure status instead. -- **Action Node**: This node is a leaf node, meaning it cannot have any children of its own. - This node represents an action for the AI to perform such as moving in a certain direction or interacting with an object in its environment. -- **Condition Node**: This node is also a leaf node. It evaluates whether one or more pre-conditions have been satisfied for a specific action. -- **Decorator Node**: There are several kinds of Decorator Nodes, each of which can have only one child. These nodes modify the child's status in some way. - For example, an "Inverter" Decorator will succeed if its child fails, and vice versa. - -Let's consider a practical example where we want our AI to talk to another character. -The "conversation" branch should fail if there isn't anyone to talk to. -Perhaps the character can't see anyone else from where they're standing, or perhaps everyone present is already engaged in conversation. -Returning the failure status allows our AI to evaluate other branches for potential actions. -Keep in mind that the conversation branch may fail even if it does find a valid target - -for instance, if the character we want to talk to is too far away, then the AI will need to approach them first. -If all preconditions for talking to the character are met, and we initiate conversation, then the branch will return the success status. -This indicates that the branch has accomplished its tasks and that we can evaluate other branches for things like choosing a conversation topic. - -What about the running status? This status is unique in that a parent node will immediately return running if any of its children return running, -essentially short-circuiting the tree. This is useful in cases where the action an AI wants to perform isn't instantaneous. -For example, initiating conversation with another character might trigger a greeting animation which takes several seconds to play out. -Our conversation branch could check whether the AI is in the middle of a greeting animation before evaluating other preconditions, -preventing it from repeating logic from this branch. - -For a deeper dive into behavior trees, their nodes, and practical examples of their usage in video games, [follow this link](https://www.gamedeveloper.com/programming/behavior-trees-for-ai-how-they-work). \ No newline at end of file diff --git a/docs/common/agent-builder/_loading-your-tree.mdx b/docs/common/agent-builder/_loading-your-tree.mdx deleted file mode 100644 index 39b68afb..00000000 --- a/docs/common/agent-builder/_loading-your-tree.mdx +++ /dev/null @@ -1,8 +0,0 @@ -If you've used the Agent Builder to create a bot before, then you can locate that bot in the Bot Manager and open the Agent Builder interface. - -![Open Agent Builder](./img/open-agent-builder.png) - -At any time, you can click the "Reload from Server" button at the top of the page to revert to your most recently-saved version -(this will discard any unsaved changes). Don't forget to save when you're done! - -![Load Your Tree](./img/load-tree.png) diff --git a/docs/common/agent-builder/_saving-your-tree.mdx b/docs/common/agent-builder/_saving-your-tree.mdx deleted file mode 100644 index d9381e09..00000000 --- a/docs/common/agent-builder/_saving-your-tree.mdx +++ /dev/null @@ -1,3 +0,0 @@ -Save your tree early and often! Any changes made to your AI will be lost if you leave the Agent Builder without saving. - -![Save Your Tree](./img/save-tree.png) \ No newline at end of file diff --git a/docs/common/agent-builder/img/create-for-minecraft.png b/docs/common/agent-builder/img/create-for-minecraft.png deleted file mode 100644 index bbae1241..00000000 Binary files a/docs/common/agent-builder/img/create-for-minecraft.png and /dev/null differ diff --git a/docs/common/agent-builder/img/reopen-validation-results-minecraft.png b/docs/common/agent-builder/img/reopen-validation-results-minecraft.png deleted file mode 100644 index 41e571e4..00000000 Binary files a/docs/common/agent-builder/img/reopen-validation-results-minecraft.png and /dev/null differ diff --git a/docs/common/agent-builder/img/validation-results-minecraft.png b/docs/common/agent-builder/img/validation-results-minecraft.png deleted file mode 100644 index b307019e..00000000 Binary files a/docs/common/agent-builder/img/validation-results-minecraft.png and /dev/null differ diff --git a/docs/studios/unity/unity-sdk/creating-bots/csharp/playtest-bots.mdx b/docs/creating-bots/csharp/adaptive-bots.mdx similarity index 91% rename from docs/studios/unity/unity-sdk/creating-bots/csharp/playtest-bots.mdx rename to docs/creating-bots/csharp/adaptive-bots.mdx index 8e829b12..edfa4248 100644 --- a/docs/studios/unity/unity-sdk/creating-bots/csharp/playtest-bots.mdx +++ b/docs/creating-bots/csharp/adaptive-bots.mdx @@ -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. @@ -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. ::: diff --git a/docs/studios/unity/unity-sdk/creating-bots/csharp/configuration.mdx b/docs/creating-bots/csharp/configuration.mdx similarity index 92% rename from docs/studios/unity/unity-sdk/creating-bots/csharp/configuration.mdx rename to docs/creating-bots/csharp/configuration.mdx index ab5cf4c7..1ff01284 100644 --- a/docs/studios/unity/unity-sdk/creating-bots/csharp/configuration.mdx +++ b/docs/creating-bots/csharp/configuration.mdx @@ -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. @@ -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 diff --git a/docs/studios/unity/unity-sdk/creating-bots/csharp/gizmos_imgs/editor.png b/docs/creating-bots/csharp/img/show-gizmos-in-editor.png similarity index 100% rename from docs/studios/unity/unity-sdk/creating-bots/csharp/gizmos_imgs/editor.png rename to docs/creating-bots/csharp/img/show-gizmos-in-editor.png diff --git a/docs/creating-bots/csharp/scenario-testing.mdx b/docs/creating-bots/csharp/scenario-testing.mdx new file mode 100644 index 00000000..76714211 --- /dev/null +++ b/docs/creating-bots/csharp/scenario-testing.mdx @@ -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 ... +::: + diff --git a/docs/studios/unity/unity-sdk/creating-bots/csharp/utilities.mdx b/docs/creating-bots/csharp/utilities.mdx similarity index 85% rename from docs/studios/unity/unity-sdk/creating-bots/csharp/utilities.mdx rename to docs/creating-bots/csharp/utilities.mdx index 6ced96b1..60aee036 100644 --- a/docs/studios/unity/unity-sdk/creating-bots/csharp/utilities.mdx +++ b/docs/creating-bots/csharp/utilities.mdx @@ -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(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 + + + + +```cs +public override void StartAction(Dictionary input) +{ + var targetInstanceId = int.Parse(input["targetId"].ToString()); + + var targetObject = RGFindUtils.Instance.FindOneByInstanceId(targetInstanceId); + if (targetObject != null) + { + // Set some class variable that is then used in the `Update()` function + targetTransform = targetObject.transform; + } +} +``` + + + + ## RGGizmos `RGGizmos` is a utility for drawing specific Gizmos and debug information within your Unity scene. It is @@ -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) @@ -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) ::: diff --git a/docs/studios/unity/unity-sdk/creating-bots/javascript/playtest-bots.mdx b/docs/creating-bots/javascript/adaptive-bots.mdx similarity index 96% rename from docs/studios/unity/unity-sdk/creating-bots/javascript/playtest-bots.mdx rename to docs/creating-bots/javascript/adaptive-bots.mdx index 42161f7f..7045c535 100644 --- a/docs/studios/unity/unity-sdk/creating-bots/javascript/playtest-bots.mdx +++ b/docs/creating-bots/javascript/adaptive-bots.mdx @@ -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)` method. @@ -22,7 +22,7 @@ These are displayed side-by-side with Bot actions in the Replay utility to help :::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. ::: @@ -123,7 +123,7 @@ async function selectAbility(rg) { const ability = getNextAbility(rg); if(!rg.entityHasAttribute(rg.getBot(), ["abilityAvailable", `${ability.name}`], true)) { - // this ability is still on cooldown + // this ability is still on cool-down return; } @@ -262,7 +262,7 @@ const objectState = rg.getState(mascot.id); ### `getBot();` Returns the current state information for this Bot. -Synonymous with [`rg.getState(rg.playerId)`](./playtest-bots#getstateid-number--null) +Synonymous with [`rg.getState(rg.playerId)`](#getstateid-number--null) #### Arguments None @@ -280,7 +280,7 @@ const myBot = rg.getBot(); Flags the current Bot as complete, which will stop Bot execution and send a teardown notification to your game for this Bot. This is particularly useful for [PERSISTENT Bots](./configuration#lifecycle) which must be stopped explicitly, -and for [Validation Bots](./validation-bots) which execute a specific set of commands and then are considered to have 'completed' their tasks +and for [Scenario Bots](./scenario-testing) which execute a specific set of commands and then are considered to have 'completed' their tasks regardless of whether the Unity Integration itself has signalled Bots to disconnect. #### Arguments @@ -343,8 +343,8 @@ if(!await rg.entityHasAttribute(bot, "equippedItem", "sword")) { Find an entity with the given Object Type in the game state. This method should be used when only one entity with the given Object Type is expected to exist in the state, or when any entity with this Object Type will satisfy the scenario. -For more control over finding specific entities in the game state, see [getState](./playtest-bots#getstateid-number--null) -and [findNearestEntity](./playtest-bots#findnearestentityobjecttype-string--null-position-object--null-filterfunc-function--entity--true). +For more control over finding specific entities in the game state, see [getState](#getstateid-number--null) +and [findNearestEntity](#findnearestentityobjecttype-string--null-position-object--null-filterfunc-function--entity--true). #### Arguments Argument Name | Type | Default | Description diff --git a/docs/studios/unity/unity-sdk/creating-bots/javascript/agent-builder.mdx b/docs/creating-bots/javascript/agent-builder.mdx similarity index 50% rename from docs/studios/unity/unity-sdk/creating-bots/javascript/agent-builder.mdx rename to docs/creating-bots/javascript/agent-builder.mdx index e2a36369..d79410a7 100644 --- a/docs/studios/unity/unity-sdk/creating-bots/javascript/agent-builder.mdx +++ b/docs/creating-bots/javascript/agent-builder.mdx @@ -2,11 +2,6 @@ sidebar_label: 'Agent Builder' --- -import BehaviorTree from '../../../../../common/agent-builder/_behavior-trees.md' -import LoadingYourTree from '../../../../../common/agent-builder/_loading-your-tree.mdx' -import AddingNodes from '../../../../../common/agent-builder/_adding-nodes.mdx' -import SavingYourTree from '../../../../../common/agent-builder/_saving-your-tree.mdx' - # Creating AIs Using the Agent Builder Regression Games' Agent Builder is an easy-to-use visual editor for constructing AI behavior trees. @@ -17,35 +12,84 @@ This makes Agent Builder an excellent tool for creating bots as you familiarize :::note We're constantly working to improve Agent Builder. -You can report issues and submit feature requests through our [Feedback Site](https://regression-games.sleekplan.app/feedback). +You can report issues and submit feature requests by sending an e-mail to info@regression.gg or joining our [Discord](https://discord.com/invite/925SYVse2H) server. ::: ## What Is a Behavior Tree? - +A behavior tree is a decision-making model used to determine which actions an agent (such as a character in a video game) should take in different situations. +You can think of a behavior tree as a flow chart that the AI follows, choosing appropriate actions based on what it knows about itself and its environment. +A behavior tree is composed of nodes organized into a hierarchical structure which starts with a root node and branches out to form different paths. +Each path represents a line of decision-making that results in one or more actions for the AI to perform. + +Each node in the tree executes logic and returns one of the following statuses as a result: + +- **Running** -> The task represented by this node's branch hasn't yet completed. +- **Success** -> The node has completed its task successfully. +- **Failure** -> The node has failed its task. This doesn't necessarily mean an error occurred. For example, a heal action might fail if the character doesn't have any potions. + +Different types of nodes have different responsibilities and may react differently to the statuses of other nodes. + +- **Root Node**: The beginning of the tree, where the AI starts its decision-making. +Its job is simply to execute whatever node is below it in the tree and return its status. +- **Sequence Node**: This node has one or more children and acts as a logical AND. +It executes its child nodes sequentially, and if any one of them fail then the Sequence Node immediately returns a failure status, skipping execution of any remaining children. +- **Selector Node**: This node also has one or more children, but acts as a logical OR. +It executes its child nodes sequentially, and if any one of them succeed then the Selector Node immediately returns a success status, skipping execution of any remaining children. +If none succeed, then the Selector Node returns a failure status instead. +- **Action Node**: This node is a leaf node, meaning it cannot have any children of its own. +This node represents an action for the AI to perform such as moving in a certain direction or interacting with an object in its environment. +- **Condition Node**: This node is also a leaf node. It evaluates whether one or more pre-conditions have been satisfied for a specific action. +- **Decorator Node**: There are several kinds of Decorator Nodes, each of which can have only one child. These nodes modify the child's status in some way. +For example, an "Inverter" Decorator will succeed if its child fails, and vice versa. + +Let's consider a practical example where we want our AI to talk to another character. +The "conversation" branch should fail if there isn't anyone to talk to. +Perhaps the character can't see anyone else from where they're standing, or perhaps everyone present is already engaged in conversation. +Returning the failure status allows our AI to evaluate other branches for potential actions. +Keep in mind that the conversation branch may fail even if it does find a valid target - +for instance, if the character we want to talk to is too far away, then the AI will need to approach them first. +If all preconditions for talking to the character are met, and we initiate conversation, then the branch will return the success status. +This indicates that the branch has accomplished its tasks and that we can evaluate other branches for things like choosing a conversation topic. + +What about the running status? This status is unique in that a parent node will immediately return running if any of its children return running, +essentially short-circuiting the tree. This is useful in cases where the action an AI wants to perform isn't instantaneous. +For example, initiating conversation with another character might trigger a greeting animation which takes several seconds to play out. +Our conversation branch could check whether the AI is in the middle of a greeting animation before evaluating other preconditions, +preventing it from repeating logic from this branch. + +For a deeper dive into behavior trees, their nodes, and practical examples of their usage in video games, [follow this link](https://www.gamedeveloper.com/programming/behavior-trees-for-ai-how-they-work). ## Creating a Bot Create a new AI from the Bot Manager and select `Agent Builder` from the list of creation options, give your new bot a name, and then finalize. It's that easy! -![Create new AI](../../../../../common/bot-creation/img/create-bot-button.png) -![Select Creation Option](../../../../../common/agent-builder/img/create-for-unity.png) +![Create new AI](img/agent-builder/create-bot-button.png) +![Select Creation Option](img/agent-builder/create-for-unity.png) ## Loading Your Tree - +If you've used the Agent Builder to create a bot before, then you can locate that bot in the Bot Manager and open the Agent Builder interface. + +![Open Agent Builder](img/agent-builder/open-agent-builder.png) + +At any time, you can click the "Reload from Server" button at the top of the page to revert to your most recently-saved version +(this will discard any unsaved changes). Don't forget to save when you're done! + +![Load Your Tree](img/agent-builder/load-tree.png) + ## Getting Started with the Agent Builder ### Agent Builder and Your Game Integration At its core, our Unity SDK revolves around defining actions that your bot can perform and defining -information about your game-state that the bot can analyze to make decisions. Actions and game-state information will be different +information about your game state that the bot can analyze to make decisions. Actions and game state information will be different for every game, so Agent Builder requires some simple setup for your unique integration. :::info -The Agent Builder is designed for the creation of [PlayTest bots](./playtest-bots), which form decisions every tick. +The Agent Builder is designed for the creation of [Adaptive bots](./adaptive-bots), which form decisions every tick. This means your Agent Builder tree will be executed once per game tick. Performing actions through our SDK queues them to be handled within your game asynchronously. @@ -60,23 +104,41 @@ Click the "Bot Settings" button in the Agent Builder interface to access a range See the [Bot Configuration section](./configuration) for information on each setting and how it affects bot startup and teardown. Bot configurations are applied at runtime before the first game-tick your tree is executed. -![Bot Settings](../../../../../common/agent-builder/img/bot-settings-button.png) -![Bot Configuration](../../../../../common/agent-builder/img/bot-configuration-tab.png) +![Bot Settings](img/agent-builder/bot-settings-button.png) +![Bot Configuration](img/agent-builder/bot-configuration-tab.png) #### Saving Your Unity Context From the Unity Editor, expand the "Regression Games" menu and select "Agent Builder > Extract Game Context". This will save your Unity Context as a .zip to your top-level project directory. -![Extract Game Context](../../../../../common/agent-builder/img/extract-game-context.png) +![Extract Game Context](img/agent-builder/extract-game-context.png) In the Agent Builder, click the "Bot Settings" button, then select the .zip from the "Upload Game Context" tab. -![Upload Game Context](../../../../../common/agent-builder/img/upload-game-context.png) +![Upload Game Context](img/agent-builder/upload-game-context.png) ### Adding Nodes - +New Agent Builder projects start with a root node and a sequence node to form the basis of your tree. + +![Default Tree](img/agent-builder/default-tree.png) + +To begin building your tree, click the connector at the bottom of the sequence node and drag. +When you release, you'll be presented with different types of nodes that can be added to this sequence. +For this demonstration, we'll create an action node. +You can repeat this process for any node that is allowed to have children. + +![Select a Node Type](img/agent-builder/select-node-type.png) +![Create an Action Node](img/agent-builder/new-action-node.png) +![Example Tree](img/agent-builder/example-tree-1.png) + +Clicking on a node opens a panel to the right side of your screen. +This panel contains information about the selected node including a description of the node's type and a label, as well as a button to delete the node from the tree. +It's a good idea to set labels to keep track of what you want each node or branch to do. +If the selected node is a leaf node, such as an action or condition, then the panel will also contain fields used for defining the node's behavior via code. + +![Open the Node Panel](img/agent-builder/edit-node.png) ### Generating Code @@ -84,7 +146,7 @@ In the Agent Builder, click the "Bot Settings" button, then select the .zip from All samples in this section are written in Typescript. We're constantly evaluating support for other languages. -Feel free to request others through our [Feedback Site](https://regression-games.sleekplan.app/feedback). +Feel free to request others by sending an e-mail to info@regression.gg or joining our [Discord](https://discord.com/invite/925SYVse2H) server. ::: The nodes in your tree won't be useful until you give them some logic to execute. @@ -103,7 +165,7 @@ All of your node's code must be defined within the `LeafNode` class, and the `ex You may encounter errors loading your AI into a game if these are not properly defined when you save your tree. ::: -You can either manually type code into the editor (see the [PlayTest Bots API](./playtest-bots)), +You can either manually type code into the editor (see the [Adaptive Bots API](./adaptive-bots)), or you can have our AI code assistant do the heavy lifting for you. To generate code using the assistant, describe what you want this node to do in the "GPT Prompt" field then click the "Generate Code" button. The editor will be disabled as code appears, and you can modify the output once it's finished. @@ -208,12 +270,14 @@ class LeafNode extends TreeNode { Clicking the "Validate Code" button should result in a warning that `findNearestEntity` should be awaited if we want to capture the actual "Enemy" entity. -![Validate Code](../../../../../common/agent-builder/img/validation-results-unity.png) +![Validate Code](img/agent-builder/validation-results-unity.png) You can close validation results at any time and reopen them by clicking the clipboard icon. -![ReOpen Validation Results](../../../../../common/agent-builder/img/reopen-validation-results-unity.png) +![ReOpen Validation Results](img/agent-builder/reopen-validation-results-unity.png) ## Saving Your Tree - +Save your tree early and often! Any changes made to your AI will be lost if you leave the Agent Builder without saving. + +![Save Your Tree](img/agent-builder/save-tree.png) diff --git a/docs/studios/unity/unity-sdk/creating-bots/javascript/configuration.mdx b/docs/creating-bots/javascript/configuration.mdx similarity index 91% rename from docs/studios/unity/unity-sdk/creating-bots/javascript/configuration.mdx rename to docs/creating-bots/javascript/configuration.mdx index 9ec0bea4..4268c3f4 100644 --- a/docs/studios/unity/unity-sdk/creating-bots/javascript/configuration.mdx +++ b/docs/creating-bots/javascript/configuration.mdx @@ -77,8 +77,8 @@ export function configureBot(rg) { For spawnable Bots. 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. #### Type `object` @@ -125,7 +125,7 @@ export function configureBot(rg) { 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. #### Type diff --git a/docs/common/agent-builder/img/bot-configuration-tab.png b/docs/creating-bots/javascript/img/agent-builder/bot-configuration-tab.png similarity index 100% rename from docs/common/agent-builder/img/bot-configuration-tab.png rename to docs/creating-bots/javascript/img/agent-builder/bot-configuration-tab.png diff --git a/docs/common/agent-builder/img/bot-settings-button.png b/docs/creating-bots/javascript/img/agent-builder/bot-settings-button.png similarity index 100% rename from docs/common/agent-builder/img/bot-settings-button.png rename to docs/creating-bots/javascript/img/agent-builder/bot-settings-button.png diff --git a/docs/common/bot-creation/img/create-bot-button.png b/docs/creating-bots/javascript/img/agent-builder/create-bot-button.png similarity index 100% rename from docs/common/bot-creation/img/create-bot-button.png rename to docs/creating-bots/javascript/img/agent-builder/create-bot-button.png diff --git a/docs/common/agent-builder/img/create-for-unity.png b/docs/creating-bots/javascript/img/agent-builder/create-for-unity.png similarity index 100% rename from docs/common/agent-builder/img/create-for-unity.png rename to docs/creating-bots/javascript/img/agent-builder/create-for-unity.png diff --git a/docs/common/agent-builder/img/default-tree.png b/docs/creating-bots/javascript/img/agent-builder/default-tree.png similarity index 100% rename from docs/common/agent-builder/img/default-tree.png rename to docs/creating-bots/javascript/img/agent-builder/default-tree.png diff --git a/docs/common/agent-builder/img/edit-node.png b/docs/creating-bots/javascript/img/agent-builder/edit-node.png similarity index 100% rename from docs/common/agent-builder/img/edit-node.png rename to docs/creating-bots/javascript/img/agent-builder/edit-node.png diff --git a/docs/common/agent-builder/img/example-tree-1.png b/docs/creating-bots/javascript/img/agent-builder/example-tree-1.png similarity index 100% rename from docs/common/agent-builder/img/example-tree-1.png rename to docs/creating-bots/javascript/img/agent-builder/example-tree-1.png diff --git a/docs/common/agent-builder/img/example-tree-2.png b/docs/creating-bots/javascript/img/agent-builder/example-tree-2.png similarity index 100% rename from docs/common/agent-builder/img/example-tree-2.png rename to docs/creating-bots/javascript/img/agent-builder/example-tree-2.png diff --git a/docs/common/agent-builder/img/extract-game-context.png b/docs/creating-bots/javascript/img/agent-builder/extract-game-context.png similarity index 100% rename from docs/common/agent-builder/img/extract-game-context.png rename to docs/creating-bots/javascript/img/agent-builder/extract-game-context.png diff --git a/docs/common/agent-builder/img/generate-code.png b/docs/creating-bots/javascript/img/agent-builder/generate-code.png similarity index 100% rename from docs/common/agent-builder/img/generate-code.png rename to docs/creating-bots/javascript/img/agent-builder/generate-code.png diff --git a/docs/common/agent-builder/img/load-tree.png b/docs/creating-bots/javascript/img/agent-builder/load-tree.png similarity index 100% rename from docs/common/agent-builder/img/load-tree.png rename to docs/creating-bots/javascript/img/agent-builder/load-tree.png diff --git a/docs/common/agent-builder/img/new-action-node.png b/docs/creating-bots/javascript/img/agent-builder/new-action-node.png similarity index 100% rename from docs/common/agent-builder/img/new-action-node.png rename to docs/creating-bots/javascript/img/agent-builder/new-action-node.png diff --git a/docs/common/agent-builder/img/open-agent-builder.png b/docs/creating-bots/javascript/img/agent-builder/open-agent-builder.png similarity index 100% rename from docs/common/agent-builder/img/open-agent-builder.png rename to docs/creating-bots/javascript/img/agent-builder/open-agent-builder.png diff --git a/docs/common/agent-builder/img/reopen-validation-results-unity.png b/docs/creating-bots/javascript/img/agent-builder/reopen-validation-results-unity.png similarity index 100% rename from docs/common/agent-builder/img/reopen-validation-results-unity.png rename to docs/creating-bots/javascript/img/agent-builder/reopen-validation-results-unity.png diff --git a/docs/common/agent-builder/img/save-tree.png b/docs/creating-bots/javascript/img/agent-builder/save-tree.png similarity index 100% rename from docs/common/agent-builder/img/save-tree.png rename to docs/creating-bots/javascript/img/agent-builder/save-tree.png diff --git a/docs/common/agent-builder/img/select-node-type.png b/docs/creating-bots/javascript/img/agent-builder/select-node-type.png similarity index 100% rename from docs/common/agent-builder/img/select-node-type.png rename to docs/creating-bots/javascript/img/agent-builder/select-node-type.png diff --git a/docs/common/agent-builder/img/upload-game-context.png b/docs/creating-bots/javascript/img/agent-builder/upload-game-context.png similarity index 100% rename from docs/common/agent-builder/img/upload-game-context.png rename to docs/creating-bots/javascript/img/agent-builder/upload-game-context.png diff --git a/docs/common/agent-builder/img/validation-results-unity.png b/docs/creating-bots/javascript/img/agent-builder/validation-results-unity.png similarity index 100% rename from docs/common/agent-builder/img/validation-results-unity.png rename to docs/creating-bots/javascript/img/agent-builder/validation-results-unity.png diff --git a/docs/studios/unity/unity-sdk/creating-bots/javascript/validation-bots.mdx b/docs/creating-bots/javascript/scenario-testing.mdx similarity index 93% rename from docs/studios/unity/unity-sdk/creating-bots/javascript/validation-bots.mdx rename to docs/creating-bots/javascript/scenario-testing.mdx index aef768de..e694803d 100644 --- a/docs/studios/unity/unity-sdk/creating-bots/javascript/validation-bots.mdx +++ b/docs/creating-bots/javascript/scenario-testing.mdx @@ -1,22 +1,22 @@ --- -sidebar_label: 'Validation Bots' +sidebar_label: 'Scenario Testing' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Defining Bots for Validation Testing +# Defining Bots that Execute Predetermined Scenarios Your Unity integration collects state information about GameObjects and notifies the Bot runtime with the updated state at a fixed tick interval. The game state can be monitored to test the impacts of GameObject behaviors on other GameObjects. -Validation Bots share the same APIs as [PlayTest Bots](./playtest-bots), with two important distinctions: +Validation Bots share the same APIs as [Adaptive Bots](./adaptive-bots), with two important distinctions: 1. Bot logic is implemented within a `startScenario(rg)` method rather than `processTick(rg)`. `startScenario` is invoked once after the Bot connects and will run to completion rather than being invoked repeatedly over the lifetime of the Bot. Like `processTick`, the `rg` object passed to `startScenario` exposes the Regression Games API. 2. Commands act as assertions. When a command is executed, it automatically waits and retries until the game state meets its expectations. If an expectation hasn't been met before a timeout is reached, then the command (and by extension the scenario) will fail. -For example, running the command `rg.findEntity("MyEntity")` for a PlayTest Bot will return the matching entity or null based on the current tick's game state, +For example, running the command `rg.findEntity("MyEntity")` for a Adaptive Bot will return the matching entity or null based on the current tick's game state, but running the same command for a Validation Bot will check the state across several tick intervals until a matching entity is found, or else the command will fail. :::tip @@ -45,7 +45,7 @@ export async function startScenario(rg) { // validate that we're in the game await rg.waitForScene("Dungeon"); - // find the closest human player and use a heal ability on them + // find the closest human player and use a healing ability on them let target = await rg.findNearestEntity("HumanPlayer"); await rg.entityExists(target); @@ -54,7 +54,7 @@ export async function startScenario(rg) { position: target.position }) - // validate that the heal recovers from cooldown + // validate that the healing ability recovers from cool-down await rg.entityHasAttribute(rg.getBot(), ["abilityAvailable", "Heal"], true); // find the closest enemy and use a basic attack until it dies. @@ -147,7 +147,7 @@ export async function startScenario(rg) { ## Methods -These methods are in addition to the APIs defined in the [PlayTest Bots section](./playtest-bots#variables). +These methods are in addition to the APIs defined in the [Adaptive Bots section](./adaptive-bots#variables). ### `recordValidation(validationName: string, result: "PASS" | "FAIL" | "WARNING", options);` diff --git a/docs/studios/api_reference/auth_images/generate_key.png b/docs/img/generate-api-key.png similarity index 100% rename from docs/studios/api_reference/auth_images/generate_key.png rename to docs/img/generate-api-key.png diff --git a/docs/studios/platform_features/marketplace_imgs/create_bot.png b/docs/img/marketplace/create-bot.png similarity index 100% rename from docs/studios/platform_features/marketplace_imgs/create_bot.png rename to docs/img/marketplace/create-bot.png diff --git a/docs/studios/platform_features/marketplace_imgs/detail.png b/docs/img/marketplace/detail.png similarity index 100% rename from docs/studios/platform_features/marketplace_imgs/detail.png rename to docs/img/marketplace/detail.png diff --git a/docs/studios/platform_features/marketplace_imgs/new_bot.png b/docs/img/marketplace/new-bot.png similarity index 100% rename from docs/studios/platform_features/marketplace_imgs/new_bot.png rename to docs/img/marketplace/new-bot.png diff --git a/docs/studios/platform_features/marketplace_imgs/overview.png b/docs/img/marketplace/overview.png similarity index 100% rename from docs/studios/platform_features/marketplace_imgs/overview.png rename to docs/img/marketplace/overview.png diff --git a/docs/studios/unity/tutorials/quickstart_images/overlay.png b/docs/img/quickstart/overlay.png similarity index 100% rename from docs/studios/unity/tutorials/quickstart_images/overlay.png rename to docs/img/quickstart/overlay.png diff --git a/docs/studios/unity/tutorials/quickstart_images/scene.png b/docs/img/quickstart/scene.png similarity index 100% rename from docs/studios/unity/tutorials/quickstart_images/scene.png rename to docs/img/quickstart/scene.png diff --git a/docs/studios/unity/tutorials/quickstart_images/signin.png b/docs/img/quickstart/signin.png similarity index 100% rename from docs/studios/unity/tutorials/quickstart_images/signin.png rename to docs/img/quickstart/signin.png diff --git a/docs/studios/unity/tutorials/quickstart_images/urp.png b/docs/img/quickstart/urp.png similarity index 100% rename from docs/studios/unity/tutorials/quickstart_images/urp.png rename to docs/img/quickstart/urp.png diff --git a/docs/studios/unity/tutorials/quickstart_images/welcome.png b/docs/img/quickstart/welcome.png similarity index 100% rename from docs/studios/unity/tutorials/quickstart_images/welcome.png rename to docs/img/quickstart/welcome.png diff --git a/docs/studios/unity/unity-sdk/img/vision.png b/docs/img/vision.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/vision.png rename to docs/img/vision.png diff --git a/docs/studios/unity/unity-sdk/BotInformation.mdx b/docs/integrating-with-unity/BotInformation.mdx similarity index 66% rename from docs/studios/unity/unity-sdk/BotInformation.mdx rename to docs/integrating-with-unity/BotInformation.mdx index d1ea10e8..fa5c3521 100644 --- a/docs/studios/unity/unity-sdk/BotInformation.mdx +++ b/docs/integrating-with-unity/BotInformation.mdx @@ -5,7 +5,7 @@ sidebar_label: 'BotInformation' # BotInformation A serializable class holding information about a bot that has been connected to the scene -through the [`RGBotSpawnManager`](./RGBotSpawnManager) +through the [`RGBotSpawnManager`](./seating-and-spawning-bots) ## Properties @@ -19,15 +19,14 @@ Name | Type | Description ### `public T ParseCharacterConfig()` -Parses the JSON from `characterConfig` ([C#](./creating-bots/csharp/configuration#characterconfig)) ([JavaScript](./creating-bots/javascript/configuration#characterconfig)) into the serialized data type -passed into the generic of this function. This `characterConfig` ([C#](./creating-bots/csharp/configuration#characterconfig)) ([JavaScript](./creating-bots/javascript/configuration#characterconfig)) -is the JavaScript Object that comes from the bot logic. +Parses the JSON from `characterConfig` ([C#](../../creating-bots/csharp/configuration#characterconfig)) ([JavaScript](../../creating-bots/javascript/configuration#characterconfig)) into the serialized data type +passed into the generic of this function. This `characterConfig` is the raw object that comes from the bot logic. #### Arguments None #### Return Value -The object of type `T` that has been deserialized from JSON in the `characterConfig` ([C#](./creating-bots/csharp/configuration#characterconfig)) ([JavaScript](./creating-bots/javascript/configuration#characterconfig)) field. +The object of type `T` that has been deserialized from JSON in the `characterConfig` field. #### Examples @@ -48,7 +47,7 @@ Debug.Log(myBotConfig.speed); ### `public void UpdateCharacterConfig(T newConfig)` -Overrides the `characterConfig` ([C#](./creating-bots/csharp/configuration#characterconfig)) ([JavaScript](./creating-bots/javascript/configuration#characterconfig)) defined in the JavaScript code for your bot. For example, when seating a bot, you may discover +Overrides the `characterConfig` ([C#](../../creating-bots/csharp/configuration#characterconfig)) ([JavaScript](../../creating-bots/javascript/configuration#characterconfig)) defined in the JavaScript code for your bot. For example, when seating a bot, you may discover that the requested character type is no longer available, and you need to let the bot know. The generic type you pass in must be [Serializable]. diff --git a/docs/studios/unity/unity-sdk/RGAction.mdx b/docs/integrating-with-unity/defining-actions.mdx similarity index 93% rename from docs/studios/unity/unity-sdk/RGAction.mdx rename to docs/integrating-with-unity/defining-actions.mdx index 361b0a8b..5e95f87f 100644 --- a/docs/studios/unity/unity-sdk/RGAction.mdx +++ b/docs/integrating-with-unity/defining-actions.mdx @@ -1,23 +1,23 @@ --- -sidebar_label: 'Defining Bot Actions' +sidebar_label: 'Defining Actions' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Defining Bot Actions +# Defining Actions This section refers to an "action" as any instruction that a bot can issue to its GameObject. This can be anything from movement to casting abilities to navigating UI components. -It is common for actions to interact with entities in the [game state](./RGState) and their corresponding GameObjects. -The [`RGFindUtils`](./RGFindUtils) class contains utility functions for finding such GameObjects within the scene and is +It is common for actions to interact with entities in the [game state](./defining-entities-and-their-states) and their corresponding GameObjects. +The [`RGFindUtils`](../creating-bots/csharp/utilities#rgfindutils) class contains utility functions for finding such GameObjects within the scene and is useful for these types of actions. ## Using the `RGAction` Attribute Defining an action is as simple as adding the `RGAction` attribute to a method. -This allows the Regression Games SDK to recognize this method as the entrypoint into a callable action from your bot code ([C#](./creating-bots/csharp/configuration)) ([JavaScript](./creating-bots/javascript/configuration)). +This allows the Regression Games SDK to recognize this method as the entrypoint into a callable action from your bot code ([C#](../creating-bots/csharp/configuration)) ([JavaScript](../creating-bots/javascript/configuration)). :::info The `RGAction` attribute must be used within a component, a class that inherits from `MonoBehavior`, or a class whose parent inherits from `MonoBehavior`. diff --git a/docs/studios/unity/unity-sdk/RGState.mdx b/docs/integrating-with-unity/defining-entities-and-their-states.mdx similarity index 97% rename from docs/studios/unity/unity-sdk/RGState.mdx rename to docs/integrating-with-unity/defining-entities-and-their-states.mdx index 3aa4df4b..dd0dc310 100644 --- a/docs/studios/unity/unity-sdk/RGState.mdx +++ b/docs/integrating-with-unity/defining-entities-and-their-states.mdx @@ -1,5 +1,5 @@ --- -sidebar_label: 'RGState' +sidebar_label: 'Defining Entities and their States' --- # RGState diff --git a/docs/studios/unity/unity-sdk/img/rg-action/add-action-script-to-game-object.png b/docs/integrating-with-unity/img/rg-action/add-action-script-to-game-object.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/rg-action/add-action-script-to-game-object.png rename to docs/integrating-with-unity/img/rg-action/add-action-script-to-game-object.png diff --git a/docs/studios/unity/unity-sdk/img/rg-action/generate-action-classes.png b/docs/integrating-with-unity/img/rg-action/generate-action-classes.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/rg-action/generate-action-classes.png rename to docs/integrating-with-unity/img/rg-action/generate-action-classes.png diff --git a/docs/studios/unity/unity-sdk/RGBotSpawnManager.mdx b/docs/integrating-with-unity/seating-and-spawning-bots.mdx similarity index 99% rename from docs/studios/unity/unity-sdk/RGBotSpawnManager.mdx rename to docs/integrating-with-unity/seating-and-spawning-bots.mdx index 1a466adb..911e5e5b 100644 --- a/docs/studios/unity/unity-sdk/RGBotSpawnManager.mdx +++ b/docs/integrating-with-unity/seating-and-spawning-bots.mdx @@ -1,5 +1,5 @@ --- -sidebar_label: 'RGBotSpawnManager' +sidebar_label: 'Seating and Spawning Bots' --- import Tabs from '@theme/Tabs'; diff --git a/docs/studios/unity/unity-sdk/overview.md b/docs/overview.md similarity index 67% rename from docs/studios/unity/unity-sdk/overview.md rename to docs/overview.md index 04a1a41b..b07f6845 100644 --- a/docs/studios/unity/unity-sdk/overview.md +++ b/docs/overview.md @@ -10,37 +10,35 @@ Regression Games is developing a platform where studios can **build and deploy b ## Current Stage of the Product -This product is currently a **release preview**. We are actively talking with studios and game developers to discover the best features and use cases to tackle, and we're making changes frequently. That being said, we do have -a set of initial features and documentation that you can try now - we would absolutely love to get your [feedback](https://regression-games.sleekplan.app/feedback). +This product is currently a **release preview**. We are actively talking with studios and game developers to discover the best features and use cases to tackle, and we're making changes frequently. The team has focused on the foundation of supporting use cases and initial infrastructure to get bots to connect to Unity. The bulk of our value will come from the interfaces to build bots, the scale of our infrastructure, the speed of integration, and the products built around these bots. -![timeline feature](img/replay/timeline.png) +![timeline feature](session-insights/img/replay/timeline.png) ## Availability Assurances The Regression Games team offers the following assurances for our initial testing with developers. Additionally, we have a dedicated Discord server for support, and can also create a Slack Connect channel, giving you direct access to our entire team. For access to -these channels, send an email to [aaron@regression.gg](mailto:aaron@regression.gg). +these channels, send an e-mail to [aaron@regression.gg](mailto:aaron@regression.gg). * A single account can run at least 10 bots concurrently * The time from requesting a bot to be started to the time it connects to Unity will take less than 10 seconds if the bot is relying on dependencies that are common to most bots. This does not cover bots that may have lots of library dependencies, which may take longer. ## Implemented Features -The table below details and links to documentation for the features implemented on our platform. You can provide feedback on these -features on our [feedback site](https://regression-games.sleekplan.app/feedback). +The table below details and links to documentation for the features implemented on our platform. -| **Feature** | **Description** | **Documentation** | -|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------| -| Unity Integration | A set of scripts and interfaces are provided to easily send state and actions between bots and your game objects. | [Link](./RGBotSpawnManager) | -| Timeline/Replay | All bot actions and states are preserved, with a timeline/replay feature available within Unity. | [Link](./in-editor-replay) | -| Unity C# SDK | A C# SDK for implementing bots locally in Unity. | [Link](./creating-bots/csharp/configuration) | -| JavaScript SDK | A JavaScript SDK for implementing bots remotely in Regression Games. | [Link](./creating-bots/javascript/configuration) | -| Live Reloading | Reload bots almost instantly without rebuilding your game, managed via GitHub. | _Docs coming soon_ | -| Bot Code Generation | _Only available in Minecraft, see proposals. Create bots with low-code tools such as behavior trees powered by GPT. | [Link](../../../players/creating-bots/agent-builder) | -| Platform and Language Agnostic | Our protocol permits bots to eventually be written in multiple engines and languages. Vote for support in the feedback link above. | _Docs coming soon_ | +| **Feature** | **Description** | **Documentation** | +|--------------------------------|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------| +| Unity Integration | A set of scripts and interfaces are provided to easily send state and actions between bots and your game objects. | [Link](integrating-with-unity/seating-and-spawning-bots) | +| Timeline/Replay | All bot actions and states are preserved, with a timeline/replay feature available within Unity. | [Link](session-insights/in-editor-replay) | +| Unity C# SDK | A C# SDK for implementing bots locally in Unity. | [Link](creating-bots/csharp/configuration) | +| JavaScript SDK | A JavaScript SDK for implementing bots remotely in Regression Games. | [Link](creating-bots/javascript/configuration) | +| Live Reloading | Reload bots almost instantly without rebuilding your game, managed via GitHub. | _Docs coming soon_ | +| Bot Code Generation | Create bots with low-code tools such as behavior trees powered by GPT. | [Link](creating-bots/javascript/agent-builder) | +| Platform and Language Agnostic | Our protocol permits bots to eventually be written in multiple engines and languages. | _Docs coming soon_ | ## Importing the Regression Games Unity Bots package @@ -55,6 +53,6 @@ https://github.com/Regression-Games/RGUnityBots.git#v0.0.1 - Note that this package utilizes TextMeshPro. If you are prompted by Unity to add TextMeshPro assets to your project, please add them. - Note that this package installs a dependency of Newtonsoft Json (https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.1/manual/index.html) for serializing/deserializing Json message payloads. -![Screenshot of the package imported into the project](../tutorials/first_bot_tutorial_images/tutorial_1_package.png) +![Screenshot of the package imported into the project](tutorials/img/building-your-first-bot/tutorial-1-package.png) -For a full walkthrough on getting started, see the [Building Your First Bot](../tutorials/first_tutorial.md) tutorial. \ No newline at end of file +For a full walkthrough on getting started, see the [Building Your First Bot](tutorials/building-your-first-bot) tutorial. \ No newline at end of file diff --git a/docs/players/account-setup.md b/docs/players/account-setup.md deleted file mode 100644 index 6428158e..00000000 --- a/docs/players/account-setup.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -sidebar_label: 'Account Setup' ---- - -# Account Setup - -An account-setup wizard will walk you through some required steps when you first create your [Regression Games account](https://play.regression.gg). -You can choose to skip this setup for now and provide required information via your [user profile](https://play.regression.gg/account) later on, -but certain content may be unavailable until your account setup is complete. - -First, we recommend you create a [GitHub account](https://www.github.com) if you don't already have one. -Regression Games uses GitHub to save and load the AIs you create. This is the fastest way to dive into Minecraft AIs and allows us to detect changes you make to your AIs in real-time. -If you'd rather manage files on your own, [you can upload an AI as a ZIP file](./creating-bots/coding/upload-zip) in the Bot Manager. - -Next, you'll be prompted for a Minecraft username (see our Minecraft requirements and setup [here](supported-games/minecraft/requirements)). -The Minecraft username associated to your Regression Games account must match the one displayed in your Minecraft Client. - -Regression Games' available games and modes involve using AI to control in-game characters and interact with gameplay elements and mechanics. -Before you hop into a game, you'll need to create an AI. -[See this section on creating AIs](./creating-bots/starter-templates) using Regression Games' various tools and libraries. \ No newline at end of file diff --git a/docs/players/creating-bots/agent-builder.mdx b/docs/players/creating-bots/agent-builder.mdx deleted file mode 100644 index d87ef43f..00000000 --- a/docs/players/creating-bots/agent-builder.mdx +++ /dev/null @@ -1,202 +0,0 @@ ---- -sidebar_label: 'Using the Agent Builder' ---- - -import BehaviorTree from '../../common/agent-builder/_behavior-trees.md' -import LoadingYourTree from '../../common/agent-builder/_loading-your-tree.mdx' -import AddingNodes from '../../common/agent-builder/_adding-nodes.mdx' -import SavingYourTree from '../../common/agent-builder/_saving-your-tree.mdx' - -# Creating AIs Using the Agent Builder - -Regression Games' Agent Builder is an easy-to-use visual editor for constructing AI behavior trees. -Agent Builder provides powerful features for bot development, including a code editor powered by our AI code assistant -(driven by [OpenAI's GPT-4](https://openai.com/blog/chatgpt)). -Our code assistant has all the knowledge required to write code for our supported games and game modes. -This makes our Agent Builder an excellent tool for those new to our AI libraries, or even to programming itself! - -:::note -We're constantly working to improve Agent Builder. -You can report issues and submit feature requests through our [Feedback Site](https://regression-games.sleekplan.app/feedback). -::: - -## What Is a Behavior Tree? - - - -## Getting Started with Agent Builder - -Create a new AI from the Bot Manager and select `Agent Builder` from the list of creation options, -give your new bot a name, and then finalize. It's that easy! - -![Create new AI](../../common/bot-creation/img/create-bot-button.png) -![Select Creation Option](../../common/agent-builder/img/create-for-minecraft.png) - -## Loading Your Tree - - - -## Adding Nodes - - - -### Adding Code - -:::note -All samples in this section are written in Typescript. - -We're constantly evaluating support for other languages. -Feel free to request others through our [Feedback Site](https://regression-games.sleekplan.app/feedback). -::: - -The nodes in your tree won't be useful until you give them some logic to execute. -Click on a leaf node to open the side-panel. You'll see the following stub provided in the code editor: - -```javascript -class LeafNode extends TreeNode { - public override async execute(): Promise { - return NodeStatus.SUCCESS; - } -} -``` - -:::info -All of your node's code must be defined within the `LeafNode` class, and the `execute` method must be defined as your entrypoint into the node. -You may encounter errors loading your AI into a game if these are not properly defined when you save your tree. -::: - -You can either manually type code into the editor (see the [rg-bot API](../supported-games/minecraft/apis/rg-bot-api)), -or you can have our AI code assistant do the heavy lifting for you. -To generate code using the assistant, describe what you want this node to do in the "GPT Prompt" field then click the "Generate Code" button. -The editor will be disabled as code appears, and you can modify the output once it's finished. - -There are a lot of different decision-making points and available actions for our supported games, -so let's start with something simple - getting the AI to walk around. -This example will have the code assistant use our [rg-bot library for Minecraft](https://github.com/Regression-Games/RegressionBot). - -:::caution -Generating Code will overwrite anything currently in the editor. It's a good idea to save your tree before trying out new prompts. -::: - -If you enter the following prompt: -```text -If "wanderDistance" is not defined, then set it to 5. Then wander up to the defined "wanderDistance". -``` - -then the assistant should output code similar to this: -```typescript -class LeafNode extends TreeNode { - public override async execute(): Promise { - const bot = this.getData("bot"); - if (!bot) { - return NodeStatus.FAILURE; - } - - let wanderDistance = this.getData("wanderDistance"); - if (!wanderDistance) { - wanderDistance = 5; - this.setData("wanderDistance", wanderDistance); - } - - const wanderResult = await bot.wander(0, wanderDistance); - if (wanderResult) { - return NodeStatus.SUCCESS; - } else { - return NodeStatus.FAILURE; - } - } -} -``` -The above output is a good example of how properly-formatted code should look when you're generating or writing it. - -You may notice that this code calls the `getData` and `setData` methods. -These can be used to share data between nodes. - -:::info -We recommend you specify a data type whenever you call `getData` to take advantage of type hints in the editor. -::: - -For instance: - -```typescript -// "bot" is available to you by default -const bot = this.getData("bot"); - -// you can also define and retrieve your own key-value pairs -this.setData("myString", "Hello World"); -const myString = this.getData("myString"); - -this.setData("myBool", true); -const myBool = this.getData("myBool"); -``` - -Using these methods, we could add a node to our tree that increases the "wanderDistance" whenever the AI has nothing important to do in the nearby area. -This effectively encourages the AI to move further and further from its current location if it repeatedly fails to perform any meaningful actions. -The prompt for this could be worded as: -```text -If "wanderDistance" is undefined, then set it to 5. Otherwise increase it by 2. Then succeed. -``` - -which should produce code similar to this: -```typescript -class LeafNode extends TreeNode { - public override async execute(): Promise { - let wanderDistance = this.getData("wanderDistance"); - if (wanderDistance === undefined) { - this.setData("wanderDistance", 5); - } else { - this.setData("wanderDistance", wanderDistance + 2); - } - return NodeStatus.SUCCESS; - } -} -``` - -You may occasionally receive code from the AI assistant that doesn't follow our expected format, -or code that functions differently in-game than your prompt intends. -If this happens, you may need to alter your prompt and re-submit it for new output, or fix the output manually. -For the above prompt, note that we explicitly prompt the assistant to succeed after incrementing "wanderDistance". -If we omit this instruction, the assistant assumes that we want to perform the wander action immediately, even though we haven't explicitly told it to do so. -This is a good example of how prompts sometimes need tweaking to achieve your intended result. - -### Validating Code - -The embedded code editor offers standard syntax highlighting and intelligent code completion features for Regressions Games APIs. -To take this a step further, our AI code assistant can analyze code from the editor and provide suggestions for fixing syntax errors, bugs, and inefficiencies. -Clicking the "Validate Code" button will cause a text box to appear with the assistant's analysis results. - -Let's give this a try with some code that we know is inefficient. -The following code attempts to find all the rabbits and chickens nearby, but it searches an unnecessarily large area. -Copy and paste it into your node: - -```typescript -class LeafNode extends TreeNode { - public override async execute(): Promise { - const bot = this.getData('bot'); - - const attackableAnimals = await bot.findEntities({ - entityNames: ['Rabbit', 'Chicken'], - attackable: true, - maxDistance: Infinity - }); - - if (attackableAnimals.length == 0) { - return NodeStatus.FAILURE; - } - - return NodeStatus.SUCCESS; - } -} -``` - -Clicking the "Validate Code" button should result in a warning that `maxDistance` should be set to `100` or less, rather than `Infinity`. - -![Validate Code](../../common/agent-builder/img/validation-results-minecraft.png) - -You can close validation results at any time and reopen them by clicking the clipboard icon. - -![ReOpen Validation Results](../../common/agent-builder/img/reopen-validation-results-minecraft.png) - -## Saving Your Tree - - \ No newline at end of file diff --git a/docs/players/creating-bots/blockly.mdx b/docs/players/creating-bots/blockly.mdx deleted file mode 100644 index d5d23f92..00000000 --- a/docs/players/creating-bots/blockly.mdx +++ /dev/null @@ -1,100 +0,0 @@ ---- -sidebar_label: 'Using the Blockly Editor' ---- - -# Creating Bots Using Blockly - -Regression Games' [Blockly](https://github.com/google/blockly) integration is an easy-to-use visual editor -for constructing AI logic using interlocking, graphical blocks that represent common code concepts -(like variables, logical expressions, loops, etc.). -This is an excellent tool for players who are new to our AI libraries, or even to programming itself! - -:::note -This tool is early in development - it is prone to change and may contain bugs. -Please report issues and feature requests for the Blockly editor [here](https://regression-games.sleekplan.app/feedback). -::: - -## Getting Started with Blockly - -Create a new bot from the Bot Manager and select `Blockly` from the list of creation options -(see the section on [Cloning a Starter Template](./starter-templates) to complete this step). - -![Create new AI](../../common/bot-creation/img/create-bot-button.png) -![Select Creation Option](./img/blockly/create-from-template.png) - -## Loading Your Workspace - -If you've used the Blockly editor to create a bot before, you can locate that bot in the Bot Manager and click on it to open the editor. -The editor should automatically load your workspace from GitHub, but it's always a good idea to click the "Load from GitHub" button -to make sure your workspace is up-to-date before making changes. - -![Load Workspace](./img/blockly/load-from-github.png) - -## Adding Blocks - -When you create a new Blockly AI, we'll start you out with some sample logic that makes the AI wander randomly and record how many times it dies. -This sample may not be the most exciting (or effective) strategy, but you can build off of it easily. - -![Default Blockly Logic](./img/blockly/template.png) - -To add a Block to your workspace, first click one of the tabs from the left-hand menu. -This will display a tray containing available Blocks for that tab. -Then, drag a Block from the menu and drop it into the worspace. - -![Available Blocks](./img/blockly/add-blocks.png) - -Hovering over the Block in your workspace will display a tooltip describing its current behavior. -Some Blocks have built-in dropdowns or text inputs that you can interact with to change the Block's behavior. - -![Block Options and Tooltips](./img/blockly/block-options.png) - -The tray will automatically close whenever you add a Block to the workspace, so you'll need to open it again to repeat this process. - -## Deleting Blocks - -Deleting a Block from your workspace is as easy as adding one. -Simply drag the Block to the trashcan in the lower right-hand corner of the editor. - -![Delete Block](./img/blockly/delete-block.png) - -## Saving Your Workspace - -Save your workspace early and often! -Our client keeps a local backup of your workspace as you make changes so that you won't lose your work when you visit different bots and site features, -but this may not always be foolproof. -It's always a good idea to save your changes before switching to a different Blockly workspace or leaving the Regression Games website. - -![Save Your Workspace](./img/blockly/save-to-github.png) - -## Editing an AI's Source Code - -Blockly translates the Blocks in your workspace into runnable JavaScript code. -You can view this code at any time by clicking the "Show Generated JavaScript" button. - -![Show Generated JavaScript](./img/blockly/show-generated-javascript.png) - -![JavaScript Modal](./img/blockly/javascript-modal.png) - -This code can be copied and pasted into the `index.js` file of a JavaScript AI project -(see our [Starter Templates](./starter-templates) section for a walkthrough on how to create one). -Then, you can make changes to the code in that new project. -This method prevents your modifications from inadvertently breaking your Blockly project or being overwritten. - -Alternatively, you can modify the Blockly project files directly in your favorite IDE. -Whenever you save your current Blocks, the following files are pushed to GitHub: -* A config file named `blocklyWorkspace.json` which defines the Blocks in your logic -* An `index.js` file containing JavaScript code generated from your Blocks. This is used to run your AI in-game. - -``` -├── blocklyWorkspace.json -├── index.js -├── package.json -└── .gitignore -``` - -:::danger -Changes made to files other than the `blocklyWorkspace.json` will be overwritten when you save your Blocks from the Blockly editor. -If you plan to modify files manually, we recommend creating a new GitHub repository to prevent losing your work. -::: - -See the [Writing Your Own Code section](./coding/dev-requirements) for more information. diff --git a/docs/players/creating-bots/coding/_ide-setup-code-snippets.mdx b/docs/players/creating-bots/coding/_ide-setup-code-snippets.mdx deleted file mode 100644 index 12d00804..00000000 --- a/docs/players/creating-bots/coding/_ide-setup-code-snippets.mdx +++ /dev/null @@ -1,41 +0,0 @@ -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - - -Make any modification to your code - for now, you can keep it simple by using the following snippet to make your bot say "Hello World" when it spawns into the game. -Copy and paste this into your `index.js` file (or `start.py` if your AI is a Python project): - - - - -```javascript -// inside configureBot -bot.on('spawn', async () => { - bot.chat('Hello World!'); -}); -``` - - - - -```typescript -// inside configureBot -bot.on('spawn', async () => { - bot.chat('Hello World!'); -}); -``` - - - - -```python -# inside configure_bot -@On(bot, 'spawn') -def bot_on_spawn(this): - bot.chat('Hello World!') -``` - - - - -Once you've made your change, you can save your code to the GitHub repository (this is called "pushing" your code). \ No newline at end of file diff --git a/docs/players/creating-bots/coding/dev-requirements.mdx b/docs/players/creating-bots/coding/dev-requirements.mdx deleted file mode 100644 index 231ad7ce..00000000 --- a/docs/players/creating-bots/coding/dev-requirements.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -sidebar_label: 'Development Requirements' ---- - -import CodeSnippets from './_ide-setup-code-snippets.mdx'; - -# Development Dependencies & Requirements - -Regression Games AIs are typically saved and managed as GitHub Repositories. -You can read more about how to clone starter templates for your AIs using GitHub in our [Starter Templates Walkthrough](../starter-templates). - -In this section, we'll walk you through requirements for developing your AIs. -This guide focuses on writing the AI yourself, but you can alternatively use one of our creation tools -such as [Blockly](../blockly) or [Agent Builder](../agent-builder) to generate code for you. - -## Choosing an IDE - -The first step to writing AI code is choosing an IDE that suits your needs. -An Integrated Development Environment (IDE) is a software application that helps programmers develop code -by providing convenient features like syntax highlighting and autocompletion. - -Regression Games recommends several free-to-use online code editors with built-in GitHub support. -These are great for players who want to jump into AI creation without installing additional software. -If you're already comfortable using Git and have a favorite IDE for JavaScript, Typescript, or Python, then you can skip this section. -If you're opting out of using GitHub with Regression Games, then skip right to the [Local Development](./dev-requirements#local-development) section. - -### Codespaces - -[Codespaces](https://github.com/features/codespaces) is the fastest way to get started with AI development for Regression Games. -Codespaces is a cloud IDE offered by GitHub and Microsoft, based on VSCode. -It allows you to edit your GitHub repositories straight from the GitHub website with minimal setup - it takes just a few clicks. - -:::caution -Please be mindful of the [usage limits for Codespaces](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces) -on free GitHub accounts (~60 hrs free per month). -::: - -First, log into your GitHub account and navigate to your AI's repository. -If you need help locating it, you can log into Regression Games and find a link to your AI's repository through the Bot Manager. -Click the "Code" button on your repository's GitHub page and then the "Codespaces" tab. -From here, click the "Create codespace on main" button to be redirected to an editor in your browser. -This is where you'll write your AI's code and push it to your GitHub repository. - -![Start Codespaces](../img/ide/codespaces-start.png) - -![Codespaces Editor](../img/ide/codespaces-editor.png) - -Next, we'll demonstrate how to save changes in Codespaces. - - - -Click the Source Control button in the left-hand pane (or use the shortcut `Ctrl+Shift+G`). -Here you'll be able to see which files you've changed, and inspect those changes line-by-line. -Enter a message to describe your changes (e.g. "This bot now says hello") and click "Commit". -You may see a message about adding unstaged changes - you can click **always** for this. - -![Codespaces Commit](../img/ide/codespaces-commit.png) - -At this point, your changes haven't actually been pushed to the repository, but they are prepared for upload. -Click "Sync Changes" to finish pushing your code. -You may see another dialog about where these changes are being saved - you can click "Ok, and don't show again". - -![Codespaces Sync](../img/ide/codespaces-sync.png) - -That's it! If you queue into a match, you should see your AI load and follow its new logic. -If you're in a match while performing updates like these, you should see your AI disconnect for a brief moment and then reconnect, -at which point it will follow its new logic. - -### Replit - -[Replit](https://replit.com/) is an online IDE with support for a variety of languages. -It offers convenient features such as collaborative editing, community templates, AI code completion, and a mobile app for programming on-the-go. -You'll need to create an account in order to use Replit. - -:::note -Before beginning: Replit is free to use, but your GitHub repository must be public unless you have an active Replit subscription. -If you wish to keep your repository private, then consider one of the other recommendations on this page. -Otherwise, you can make your repository public at the bottom of the repository's settings page in GitHub. - -![Replit Import](../img/ide/replit-privacy.png) -::: - -Once you're logged into Replit, click the "Create Repl" button and then "Import from GitHub". - -![Replit Create](../img/ide/replit-create.png) - -![Replit Import](../img/ide/replit-import.png) - -If this is your first time using Replit, you'll need to connect your GitHub account so that Replit can access your repositories. -Click the "Connect GitHub" link and follow the on-screen instructions. -When you're finished, you should be able to return to Replit and see that the search box allows you to search through your existing repositories. - -![Replit Github](../img/ide/replit-github.png) - -Search for your desired repository, select it, and then click "Import from GitHub". -You will be redirected to an editor containing your files. - -![Replit Select](../img/ide/replit-select.png) - -![Replit Editor](../img/ide/replit-editor.png) - -In order to push new code to your repository, Replit will need a bit more information from you. -From the bottom-left Tools menu, click "Secrets" - this is the option with the padlock icon. -If this is your first time using Replit, you'll be shown an explanation of Replit Secrets. -You can click “Got it” and then “Skip”. You should then see the screen below: - -![Replit Editor](../img/ide/replit-secrets.png) - -Click "Edit as JSON". - -![Replit JSON Entry](../img/ide/replit-json-entry.png) - -The JSON you'll need to copy and paste here can be found in your bot's details through the Bot Manager screen on the Regression Games website. -Navigate to your bot, and click the "replit Settings" button. You'll see a section with JSON that you can copy. -Paste this into Replit. - -![Replit JSON Info](../img/ide/replit-json-info.png) - -You may notice that the "GITHUB_TOKEN" secret isn't filled in. -For this, you'll need to generate a personal access token in GitHub. - -1. Open a new browser window, go to https://github.com/settings/tokens/new and sign into your GitHub account. -2. Enter a name for the token (ex. "RGToken" or "ReplitToken") -3. We recommend setting a reasonable expiration, such as 1 year, to secure your repositories -4. Select all permissions under "repo" -5. Click "Generate token" - -![Replit GitHub Token](../img/ide/replit-github-token.png) - -Once your token has been created, copy it and replace the placeholder text in Replit with your new token. -You're all set up! Let's make sure that you can save correctly. - - - -Simply click the "Run" button at the top of the Repl. The first run may take a bit of time, and you may need to click it twice. -When you're asked for a commit message, enter something that describes your changes. -In this case, you can enter something like “Initial code”. -When you hit enter, you should see the console print some information about uploading this code to git. - -:::tip -Whenever you click “Run” remember to enter a message (or leave the message blank) and hit enter. -Otherwise, your code won't upload. -::: - -### Local Development - -If our recommended online IDEs don't suit your development needs, then you'll need to choose and download your own IDE or text editor -([VSCode](https://code.visualstudio.com/), [WebStorm](https://www.jetbrains.com/webstorm/), [PyCharm](https://www.jetbrains.com/pycharm/), etc.) -as well as [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). - -Clone your repository from GitHub with `git clone git@github.com:.git` -(recommended but requires you to add [an ssh key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)) -or `git clone https://github.com/.git`. -If you need help locating the correct path, you can log into Regression Games and find a link to your AI's repository through the Bot Manager. - -For JavaScript and TypeScript AIs, you'll also need to install [Node.js](https://nodejs.org/en/download) version 16.x (which can be checked by running `node -v`). -You can use [nvm](https://github.com/nvm-sh/nvm) for managing multiple Node versions installed on a single machine. -Navigate to the project's root directory and install project dependencies with `npm install`. - -Now you can open your project in an IDE and start writing code for your AI. - -#### Developing AIs without Git - -You can use one of our starter templates to kick off your AI project even if you're not using Git to manage it. -Visit the [Regression Games GitHub page](https://github.com/Regression-Games?q=Template&type=all&language=&sort=) -for a variety of starter templates to choose from. Once you select one, click the "Code" button on that template's repository page and then click "Download ZIP". -Extract the contents of the downloaded ZIP, open the project in your IDE of choice, and you're ready to write some code. - -Alternatively, you can set up your own project from scratch. -Create a new directory and navigate to it from the terminal. Use `npm` to initialize the project and install dependencies: - -``` -npm init -y -npm i @types/node node-fetch rg-bot rg-match-info vec3 minecraft-data mineflayer mineflayer-armor-manager mineflayer-pathfinder prismarine-entity prismarine-item prismarine-viewer -``` - -Finally, create an `index.js`, `index.ts`, or `start.py` file (depending on which programming language you're using) at your project root. - diff --git a/docs/players/creating-bots/coding/upload-zip.mdx b/docs/players/creating-bots/coding/upload-zip.mdx deleted file mode 100644 index eac5fab8..00000000 --- a/docs/players/creating-bots/coding/upload-zip.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -sidebar_label: 'Uploading a ZIP' ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# Uploading Your AI as a ZIP File - -This section describes how to manually upload an AI project that you're managing locally or via a GitHub account that you haven't linked to Regression Games. - -## Preparing Your Project - -Once you've read the [Development Dependencies & Requirements](./dev-requirements) section, created an AI project, -and made some changes to test out in-game, then you'll need to compress your project using the `.zip` format. - -If you're pushing your project to GitHub, then you can navigate to your repository and click the "Code" button and then "Download as ZIP". - -![Download ZIP from GitHub](../img/github/download-zip.png) - -If you're managing your project locally, then compress the project into a ZIP yourself. - -:::info -Exclude the `node_modules` folder from your ZIP file. -This folder contains all of the Node dependencies that your code requires in order to run, and these can become quite large. -Regression Games automatically retrieves these dependencies for you when your bot is loaded into a game. -::: - - - - -* Navigate to your project's root folder -* Select all of its contents except for `node_modules` (if it is present) -* Right-click one of your selected files -* Click "Send To" -> "Compressed (zipped) folder" -* Move the ZIP to a convenient location to upload later - - - - -* Navigate to your project's root folder -* Select all of its contents except for `node_modules` (if it is present) -* Right-click one of your selected files -* Click "Compress" -* Move the ZIP to a convenient location to upload later - - - - -* Navigate outside of your project's root folder -* Run `zip -r .zip -x /node_modules/\*` - - - - -## Creating an AI from a ZIP File - -Log into Regression Games and create a new AI from the Bot Manager. - -![Create new AI](../../../common/bot-creation/img/create-bot-button.png) - -Select the option "I will upload a zip file of my bot code" from the available list. -Give your bot a name and use the "Select File" button to upload your ZIP file. -Select the correct programming language for your project then click "Create Bot". -It's that simple! - -![Create AI from ZIP](../img/zip/create-bot-from-zip.png) - -## Updating Your AI - -The first ZIP file you upload for an AI likely won't be its final form. -After making modifications to your project, create a fresh ZIP file and then find your existing bot through the Regression Games' Bot Manager. -From here, you can see the current file's size and when it was uploaded, download a copy of it, and select a new ZIP file to replace it. -You can change your current file as many times as you want until you've achieved your AI masterpiece. - -![Bot Manager ZIP Options](../img/zip/bot-manager-zip-options.png) - -:::caution -Regression Games __does not__ keep a historical record of your uploaded ZIP files or their contents. -Make sure you have a copy of your current bot code saved before overwriting it, so that you can revert your changes if needed. -::: \ No newline at end of file diff --git a/docs/players/creating-bots/img/blockly/add-blocks.png b/docs/players/creating-bots/img/blockly/add-blocks.png deleted file mode 100644 index 9d382f3e..00000000 Binary files a/docs/players/creating-bots/img/blockly/add-blocks.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/block-options.png b/docs/players/creating-bots/img/blockly/block-options.png deleted file mode 100644 index f90c3a13..00000000 Binary files a/docs/players/creating-bots/img/blockly/block-options.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/create-from-template.png b/docs/players/creating-bots/img/blockly/create-from-template.png deleted file mode 100644 index cc7f5948..00000000 Binary files a/docs/players/creating-bots/img/blockly/create-from-template.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/delete-block.png b/docs/players/creating-bots/img/blockly/delete-block.png deleted file mode 100644 index dde7bdcf..00000000 Binary files a/docs/players/creating-bots/img/blockly/delete-block.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/javascript-modal.png b/docs/players/creating-bots/img/blockly/javascript-modal.png deleted file mode 100644 index f22ac4ec..00000000 Binary files a/docs/players/creating-bots/img/blockly/javascript-modal.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/load-from-github.png b/docs/players/creating-bots/img/blockly/load-from-github.png deleted file mode 100644 index f6d867cf..00000000 Binary files a/docs/players/creating-bots/img/blockly/load-from-github.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/save-to-github.png b/docs/players/creating-bots/img/blockly/save-to-github.png deleted file mode 100644 index c89e1c3b..00000000 Binary files a/docs/players/creating-bots/img/blockly/save-to-github.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/show-generated-javascript.png b/docs/players/creating-bots/img/blockly/show-generated-javascript.png deleted file mode 100644 index cdc8c9ef..00000000 Binary files a/docs/players/creating-bots/img/blockly/show-generated-javascript.png and /dev/null differ diff --git a/docs/players/creating-bots/img/blockly/template.png b/docs/players/creating-bots/img/blockly/template.png deleted file mode 100644 index 81503b50..00000000 Binary files a/docs/players/creating-bots/img/blockly/template.png and /dev/null differ diff --git a/docs/players/creating-bots/img/bot-creation-options.png b/docs/players/creating-bots/img/bot-creation-options.png deleted file mode 100644 index c417fa44..00000000 Binary files a/docs/players/creating-bots/img/bot-creation-options.png and /dev/null differ diff --git a/docs/players/creating-bots/img/finish-creating-bot.png b/docs/players/creating-bots/img/finish-creating-bot.png deleted file mode 100644 index 3bbd2635..00000000 Binary files a/docs/players/creating-bots/img/finish-creating-bot.png and /dev/null differ diff --git a/docs/players/creating-bots/img/github/clone-template.png b/docs/players/creating-bots/img/github/clone-template.png deleted file mode 100644 index 2c5eaada..00000000 Binary files a/docs/players/creating-bots/img/github/clone-template.png and /dev/null differ diff --git a/docs/players/creating-bots/img/github/download-zip.png b/docs/players/creating-bots/img/github/download-zip.png deleted file mode 100644 index e701c8b0..00000000 Binary files a/docs/players/creating-bots/img/github/download-zip.png and /dev/null differ diff --git a/docs/players/creating-bots/img/github/install-github-app.png b/docs/players/creating-bots/img/github/install-github-app.png deleted file mode 100644 index e1e1143b..00000000 Binary files a/docs/players/creating-bots/img/github/install-github-app.png and /dev/null differ diff --git a/docs/players/creating-bots/img/github/refresh-repositories.png b/docs/players/creating-bots/img/github/refresh-repositories.png deleted file mode 100644 index eeb15816..00000000 Binary files a/docs/players/creating-bots/img/github/refresh-repositories.png and /dev/null differ diff --git a/docs/players/creating-bots/img/github/select-repositories.png b/docs/players/creating-bots/img/github/select-repositories.png deleted file mode 100644 index e1e22823..00000000 Binary files a/docs/players/creating-bots/img/github/select-repositories.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/codespaces-commit.png b/docs/players/creating-bots/img/ide/codespaces-commit.png deleted file mode 100644 index 40a332fa..00000000 Binary files a/docs/players/creating-bots/img/ide/codespaces-commit.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/codespaces-editor.png b/docs/players/creating-bots/img/ide/codespaces-editor.png deleted file mode 100644 index 9da23970..00000000 Binary files a/docs/players/creating-bots/img/ide/codespaces-editor.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/codespaces-start.png b/docs/players/creating-bots/img/ide/codespaces-start.png deleted file mode 100644 index dd8fab97..00000000 Binary files a/docs/players/creating-bots/img/ide/codespaces-start.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/codespaces-sync.png b/docs/players/creating-bots/img/ide/codespaces-sync.png deleted file mode 100644 index 70438799..00000000 Binary files a/docs/players/creating-bots/img/ide/codespaces-sync.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-create.png b/docs/players/creating-bots/img/ide/replit-create.png deleted file mode 100644 index 43976831..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-create.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-editor.png b/docs/players/creating-bots/img/ide/replit-editor.png deleted file mode 100644 index ebcc2d1d..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-editor.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-github-token.png b/docs/players/creating-bots/img/ide/replit-github-token.png deleted file mode 100644 index 1f8b8f71..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-github-token.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-github.png b/docs/players/creating-bots/img/ide/replit-github.png deleted file mode 100644 index 26a618b7..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-github.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-import.png b/docs/players/creating-bots/img/ide/replit-import.png deleted file mode 100644 index b1d50a76..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-import.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-json-entry.png b/docs/players/creating-bots/img/ide/replit-json-entry.png deleted file mode 100644 index d46863b3..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-json-entry.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-json-info.png b/docs/players/creating-bots/img/ide/replit-json-info.png deleted file mode 100644 index 090994a4..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-json-info.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-privacy.png b/docs/players/creating-bots/img/ide/replit-privacy.png deleted file mode 100644 index 60f152fa..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-privacy.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-secrets.png b/docs/players/creating-bots/img/ide/replit-secrets.png deleted file mode 100644 index 556b3c9b..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-secrets.png and /dev/null differ diff --git a/docs/players/creating-bots/img/ide/replit-select.png b/docs/players/creating-bots/img/ide/replit-select.png deleted file mode 100644 index cd6f4412..00000000 Binary files a/docs/players/creating-bots/img/ide/replit-select.png and /dev/null differ diff --git a/docs/players/creating-bots/img/zip/bot-manager-zip-options.png b/docs/players/creating-bots/img/zip/bot-manager-zip-options.png deleted file mode 100644 index 8304dd9a..00000000 Binary files a/docs/players/creating-bots/img/zip/bot-manager-zip-options.png and /dev/null differ diff --git a/docs/players/creating-bots/img/zip/create-bot-from-zip.png b/docs/players/creating-bots/img/zip/create-bot-from-zip.png deleted file mode 100644 index 5676e138..00000000 Binary files a/docs/players/creating-bots/img/zip/create-bot-from-zip.png and /dev/null differ diff --git a/docs/players/creating-bots/starter-templates.mdx b/docs/players/creating-bots/starter-templates.mdx deleted file mode 100644 index 344bb2c2..00000000 --- a/docs/players/creating-bots/starter-templates.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -sidebar_label: 'Cloning a Starter Template' ---- - -# Overview - -Regression Games offers multiple tools for creating and developing AIs - from block-style programming interfaces -to flexible code libraries that allow programmers of any skill-level to bring their imaginations to (virtual) life. -Our various creation options generally start you out with a template to provide the basic project structure so you can focus on your AI strategy instead of the setup. -This section will walk you through the process of creating a new AI by copying a starter template from GitHub. - -## GitHub - -Regression Games uses [GitHub](https://github.com/) to save, load, and version your AIs. -Our platform detects changes to your AI as soon as you push them to GitHub, which allows your AI to refresh itself and display new behaviors in real-time. -The majority of our development tools rely on access to GitHub and therefore will be unavailable to users without a valid account linked to Regression Games. - -However, we do offer alternatives to users who prefer not to use GitHub such as [uploading your AI as a ZIP file](./coding/upload-zip). -For this method, you can skip right to our sections on [writing your own AI code](./coding/dev-requirements#developing-ais-without-git) and [uploading it to our platform](./coding/upload-zip). - -## Creating a New AI - -### Creating a GitHub Repository - -AIs are created and managed within the [Bot Manager](https://play.regression.gg/bots). Click the "Create Bot" button and select one of our several creation options. -For the purpose of this demonstration, we'll keep the default option selected, but the process will be nearly identical for most options in this list. - -![Create new AI](../../common/bot-creation/img/create-bot-button.png) -![Select Creation Option](img/bot-creation-options.png) - -When you confirm your selection, Regression Games will open a new tab in your browser and redirect you to GitHub to create a new repository. -This repository will represent the AI you're about to create, and Regression Games will access this repository whenever you queue your new AI for a match. -Give it a name, continue, and wait for GitHub to finish creating it. - -![Clone Template](img/github/clone-template.png) - -### Granting Access to Repository Contents - -Regression Games values the security and comfort of our users. -We can see which repositories you have access to, but we can't read contents from or write contents to any repositories under your GitHub account by default. -Instead, you'll need to tell us which ones we're allowed to access. -To do this, return to the Regression Games tab in your browser and follow the green link under "Git Settings". -This will take you back to GitHub to authorize the Regression Games app on your GitHub Account. - -If you don't want to repeat this step for every AI you create, you can select the "All repositories" option. -If you want to explicitly restrict Regression Games to relevant repositories, then find your new repository under "Only select repositories." -Choose either of these options then click "Install." - -![Grant GitHub Access](img/github/install-github-app.png) -![Select GitHub Repositories](img/github/select-repositories.png) - -### Finish Setup - -Back in the Regression Games tab in your browser, refresh the repositories list, find your new AI repository, and select it. -Lastly, name your AI - this is the name other players will see in-game. You can also give it an optional description to help identify it from other AIs you'll create. -Finally, click the "Create Bot" button. - -![Refresh Repositories](img/github/refresh-repositories.png) -![Finish Bot Creation](img/finish-creating-bot.png) - -### Next Steps - -Depending on the type of AI you've created, you'll either be returned to the Bot Manager where you can see a complete list of your AIs, -or you'll be redirected to a new page to interact with one of our AI development tools. -Continue through this section to learn about all of our development tools and how to use them, or how to program your AI by hand using our code libraries. diff --git a/docs/players/faq.md b/docs/players/faq.md deleted file mode 100644 index 3a56c737..00000000 --- a/docs/players/faq.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sidebar_label: 'Player FAQ' ---- - -# Player FAQ \ No newline at end of file diff --git a/docs/players/supported-games/minecraft/apis/ctf-utils.md b/docs/players/supported-games/minecraft/apis/ctf-utils.md deleted file mode 100644 index 117081e0..00000000 --- a/docs/players/supported-games/minecraft/apis/ctf-utils.md +++ /dev/null @@ -1 +0,0 @@ -# Using the CTF-Utils Package \ No newline at end of file diff --git a/docs/players/supported-games/minecraft/apis/rg-bot-api.md b/docs/players/supported-games/minecraft/apis/rg-bot-api.md deleted file mode 100644 index 19471f41..00000000 --- a/docs/players/supported-games/minecraft/apis/rg-bot-api.md +++ /dev/null @@ -1 +0,0 @@ -# Using the RGBot Package \ No newline at end of file diff --git a/docs/players/supported-games/minecraft/capture-the-flag.md b/docs/players/supported-games/minecraft/capture-the-flag.md deleted file mode 100644 index 6ec5e63d..00000000 --- a/docs/players/supported-games/minecraft/capture-the-flag.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sidebar_label: 'Capture the Flag Game Mode' ---- - -# Minecraft: Capture the Flag \ No newline at end of file diff --git a/docs/players/supported-games/minecraft/img/minecraft-installation-1.png b/docs/players/supported-games/minecraft/img/minecraft-installation-1.png deleted file mode 100644 index e3cfb139..00000000 Binary files a/docs/players/supported-games/minecraft/img/minecraft-installation-1.png and /dev/null differ diff --git a/docs/players/supported-games/minecraft/img/minecraft-installation-2.png b/docs/players/supported-games/minecraft/img/minecraft-installation-2.png deleted file mode 100644 index cbb69082..00000000 Binary files a/docs/players/supported-games/minecraft/img/minecraft-installation-2.png and /dev/null differ diff --git a/docs/players/supported-games/minecraft/img/minecraft-installation-3.png b/docs/players/supported-games/minecraft/img/minecraft-installation-3.png deleted file mode 100644 index 3c6692d5..00000000 Binary files a/docs/players/supported-games/minecraft/img/minecraft-installation-3.png and /dev/null differ diff --git a/docs/players/supported-games/minecraft/requirements.md b/docs/players/supported-games/minecraft/requirements.md deleted file mode 100644 index 4bc355f3..00000000 --- a/docs/players/supported-games/minecraft/requirements.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_label: 'Setup and Requirements' ---- - -# Minecraft Setup and Requirements - -In order to begin building AIs for Minecraft, you'll need a [Regression Games account](https://play.regression.gg), -a valid [Minecraft account](https://www.minecraft.net/en-us/login) and a copy of [Minecraft: Java Edition](https://www.minecraft.net/en-us/store/minecraft-java-bedrock-edition-pc). - -## Installing Minecraft 1.18.2 - -Download the Minecraft launcher, then [change your game version](https://help.minecraft.net/hc/en-us/articles/360034754852-Change-Game-Version-for-Minecraft-Java-Edition) to **1.18.2**. -This step is important because Regression Games' custom Minecraft plugins may be incompatible with other versions. - -![Open Installations](./img/minecraft-installation-1.png) -![Open Installations](./img/minecraft-installation-2.png) -![Open Installations](./img/minecraft-installation-3.png) - -## Connecting Your Minecraft account to Regression Games - -Before jumping into your first match, make sure that the Minecraft username associated to your Regression Games account matches the one displayed in your Minecraft Client. -If you didn't enter a username during account setup, or if you don't remember what it was, you can view and update it from [your profile page](https://play.regression.gg/account) at any time. diff --git a/docs/players/supported-games/minecraft/tutorials/hunter-bot.md b/docs/players/supported-games/minecraft/tutorials/hunter-bot.md deleted file mode 100644 index 52b00360..00000000 --- a/docs/players/supported-games/minecraft/tutorials/hunter-bot.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sidebar_label: 'Hunting for Points' ---- - -# A Tutorial for Hunting Animals and Collecting Drops diff --git a/docs/players/supported-games/minecraft/tutorials/trash-talking-bot.md b/docs/players/supported-games/minecraft/tutorials/trash-talking-bot.md deleted file mode 100644 index 88f670bb..00000000 --- a/docs/players/supported-games/minecraft/tutorials/trash-talking-bot.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sidebar_label: 'Demoralize the Enemy' ---- - -# A Tutorial for Trash-Talking \ No newline at end of file diff --git a/docs/players/supported-games/minecraft/ultimate-collector.md b/docs/players/supported-games/minecraft/ultimate-collector.md deleted file mode 100644 index a8fc1e28..00000000 --- a/docs/players/supported-games/minecraft/ultimate-collector.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sidebar_label: 'Ultimate Collector Game Mode' ---- - -# Minecraft: Ultimate Collector \ No newline at end of file diff --git a/docs/studios/platform_features/marketplace.mdx b/docs/pre-made-bots.mdx similarity index 86% rename from docs/studios/platform_features/marketplace.mdx rename to docs/pre-made-bots.mdx index 09c1a262..9b2ab8e1 100644 --- a/docs/studios/platform_features/marketplace.mdx +++ b/docs/pre-made-bots.mdx @@ -1,5 +1,5 @@ --- -sidebar_label: 'Bot Marketplace' +sidebar_label: 'Pre-Made Bots' --- # Bot Marketplace @@ -12,7 +12,7 @@ range of genres, and for both single-player and multiplayer environments. To visit the Marketplace, visit our site [here](https://play.regression.gg/marketplace) or click on the "Marketplace" tab on the site. -![Marketplace overview](./marketplace_imgs/overview.png) +![Marketplace overview](img/marketplace/overview.png) ## Learn About the Bots in the Marketplace @@ -26,7 +26,7 @@ Click on a bot within the Marketplace to learn more about how this bot works. Ev Once you are ready to use the bot, click "Create Bot". -![Marketplace details](./marketplace_imgs/detail.png) +![Marketplace details](img/marketplace/detail.png) ## Creating a Bot from a Marketplace Bot @@ -36,5 +36,5 @@ entry has a reference to the bot it was created it from, so you can always go ba From your bot details, you can always download and upload the bot code via a zip file. -![Create a new bot](./marketplace_imgs/create_bot.png) -![View the new bot](./marketplace_imgs/new_bot.png) \ No newline at end of file +![Create a new bot](img/marketplace/create-bot.png) +![View the new bot](img/marketplace/new-bot.png) \ No newline at end of file diff --git a/docs/studios/unity/tutorials/quickstart_sample_scene.mdx b/docs/quickstart.mdx similarity index 68% rename from docs/studios/unity/tutorials/quickstart_sample_scene.mdx rename to docs/quickstart.mdx index cca94dc4..368717a8 100644 --- a/docs/studios/unity/tutorials/quickstart_sample_scene.mdx +++ b/docs/quickstart.mdx @@ -1,12 +1,12 @@ --- -sidebar_label: 'Quickstart - Sample Scene and Bot' +sidebar_label: 'Quickstart' --- # Quickstart - Sample Scene and Bot **_Time to complete: 10 minutes_** -This quick walkthrough will show you an example scene and bot using the Regression Games Unity SDK. Within a few minutes, +This quick walk-through will show you an example scene and bot using the Regression Games Unity SDK. Within a few minutes, you will have your first bot running in Unity! @@ -16,11 +16,11 @@ To try out the sample scene, you will need to open or create a project that uses Within your Unity Hub, search for a template called **3D (URP)**, download it if you haven't already, and create a new project from that template. -![Create a new project from the 3D URP template](./quickstart_images/urp.png) +![Create a new project from the 3D URP template](img/quickstart/urp.png) ## Step 2: Import the Regression Games Unity Bots SDK -Our package is available via GitHub [here](https://github.com/Regression-Games/RGUnityBots). Import the repository by +[Our package is available via GitHub](https://github.com/Regression-Games/RGUnityBots). Import the repository by clicking **Add package from git URL** in the **Package Manager** window (this window can be opened in the **Window > Package Manager** menu) and pasting in the following URL. @@ -29,31 +29,31 @@ https://github.com/Regression-Games/RGUnityBots.git#v0.0.15 ``` - Note that this package utilizes TextMeshPro. If you are prompted by Unity to add TextMeshPro assets to your project, please add them. -- Note that this package installs a dependency of Newtonsoft Json (https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.1/manual/index.html) for serializing/deserializing Json message payloads. +- Note that this package installs a dependency of [Newtonsoft Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.1/manual/index.html) for serializing/deserializing Json message payloads. -![Screenshot of the package imported into the project](./first_bot_tutorial_images/tutorial_1_package.png) +![Screenshot of the package imported into the project](./tutorials/img/building-your-first-bot/tutorial-1-package.png) ## Step 3: Login (optional) and load the scene Once the package is imported, a welcome pane will open with the ability to login to Regression Games. Create -an account to sync your bot and get access to other [ready-to-go bots](/studios/platform_features/marketplace) and our -[Agent Builder tool](/players/creating-bots/agent-builder), or skip the login (you can access this later from the +an account to sync your bot and get access to other [ready-to-go bots](pre-made-bots) and our +[Agent Builder tool](creating-bots/javascript/agent-builder), or skip the login (you can access this later from the **Regression Games** > **Getting Started** menu). -![Screenshot of the welcome pane](./quickstart_images/signin.png) +![Screenshot of the welcome pane](img/quickstart/signin.png) Once you click continue, you will see a screen that links to documentation and has an option to load a sample scene. Click that button, which will import the sample scene into a new folder within your Assets directory. Once imported, the scene will auomatically open! -![Screenshot of the welcome pane](./quickstart_images/welcome.png) +![Screenshot of the welcome pane](img/quickstart/welcome.png) ## Step 4: Run the bot! Once the scene is open, run the scene by clicking play. Once running, click the Regression Games logo in the bottom right, and click "Start Bot" button to start the `QuickstartBot` that is provided with the scene. -![Screenshot of the welcome pane](./quickstart_images/overlay.png) +![Screenshot of the welcome pane](img/quickstart/overlay.png) You should see the bot move around the platform and attack the enemy! diff --git a/docs/studios/platform_features/validations.mdx b/docs/session-insights/client-dashboard.mdx similarity index 68% rename from docs/studios/platform_features/validations.mdx rename to docs/session-insights/client-dashboard.mdx index 3c7a2b78..2e6008c1 100644 --- a/docs/studios/platform_features/validations.mdx +++ b/docs/session-insights/client-dashboard.mdx @@ -1,18 +1,15 @@ --- -sidebar_label: 'Validations' +sidebar_label: 'Client Dashboard' --- -# Validations +# Viewing Validations Validations are used to assert the state of your bots at a point in time. You can think of them as tests that can be run to ensure that your bots are behaving as you expect. Beyond functioning as tests, validations can be used to locate tricky errors -and to fine-tune your game's balance. +and to fine-tune your game's balance. To get started with validations, check out our docs for both [C#](../creating-bots/csharp/scenario-testing) +and [JavaScript](../creating-bots/javascript/scenario-testing) bots. -To get started with validations, check out our docs for both [C#](https://docs.regression.gg/studios/unity/unity-sdk/creating-bots/csharp/validation-bots) and [JavaScript](https://docs.regression.gg/studios/unity/unity-sdk/creating-bots/javascript/validation-bots) bots. - -![Validations Page](./validations_imgs/validations_page.png) - -## Viewing Validations +![Validations Page](img/validation-dashboard/home.png) On the Validations Page you can see all the bot instances for a particular bot. An instance can be expanded to show each individual validation asserted during the course of that bot instance's lifetime. Validations can be filtered by passed, @@ -27,9 +24,9 @@ the screenshot will show it at a larger size. Visit the **Running Bots** tab and click on the **History** filter to see a list of your previous bot instances. Navigate to the Validations Page for a bot instance by clicking on the **Go To Validations** button. -![Validations Page Via Bot History](./validations_imgs/validations_on_bot_history.png) +![Validations Page Via Bot History](img/validation-dashboard/navigate-from-bot-history.png) Visit the **Bot Manager** tab and select a bot whose validations you would like to view. Navigate to the Validations Page for the selected bot by clicking on the **Go To Validations** button in the panel on the right. -![Validations Page Via Bot Manager](./validations_imgs/validations_on_bot_details.png) \ No newline at end of file +![Validations Page Via Bot Manager](img/validation-dashboard/bot-details-preview.png) \ No newline at end of file diff --git a/docs/studios/unity/unity-sdk/img/replay/configure-replay-models.png b/docs/session-insights/img/replay/configure-replay-models.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/replay/configure-replay-models.png rename to docs/session-insights/img/replay/configure-replay-models.png diff --git a/docs/studios/unity/unity-sdk/img/replay/replay-data-download.png b/docs/session-insights/img/replay/replay-data-download.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/replay/replay-data-download.png rename to docs/session-insights/img/replay/replay-data-download.png diff --git a/docs/studios/unity/unity-sdk/img/replay/replay-model-manager.png b/docs/session-insights/img/replay/replay-model-manager.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/replay/replay-model-manager.png rename to docs/session-insights/img/replay/replay-model-manager.png diff --git a/docs/studios/unity/unity-sdk/img/replay/rg-top-menu.png b/docs/session-insights/img/replay/rg-top-menu.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/replay/rg-top-menu.png rename to docs/session-insights/img/replay/rg-top-menu.png diff --git a/docs/studios/unity/unity-sdk/img/replay/timeline-panel.png b/docs/session-insights/img/replay/timeline-panel.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/replay/timeline-panel.png rename to docs/session-insights/img/replay/timeline-panel.png diff --git a/docs/studios/unity/unity-sdk/img/replay/timeline.png b/docs/session-insights/img/replay/timeline.png similarity index 100% rename from docs/studios/unity/unity-sdk/img/replay/timeline.png rename to docs/session-insights/img/replay/timeline.png diff --git a/docs/studios/platform_features/validations_imgs/validations_on_bot_details.png b/docs/session-insights/img/validation-dashboard/bot-details-preview.png similarity index 100% rename from docs/studios/platform_features/validations_imgs/validations_on_bot_details.png rename to docs/session-insights/img/validation-dashboard/bot-details-preview.png diff --git a/docs/studios/platform_features/validations_imgs/validations_page.png b/docs/session-insights/img/validation-dashboard/home.png similarity index 100% rename from docs/studios/platform_features/validations_imgs/validations_page.png rename to docs/session-insights/img/validation-dashboard/home.png diff --git a/docs/studios/platform_features/validations_imgs/validations_on_bot_history.png b/docs/session-insights/img/validation-dashboard/navigate-from-bot-history.png similarity index 100% rename from docs/studios/platform_features/validations_imgs/validations_on_bot_history.png rename to docs/session-insights/img/validation-dashboard/navigate-from-bot-history.png diff --git a/docs/studios/unity/unity-sdk/in-editor-replay.mdx b/docs/session-insights/in-editor-replay.mdx similarity index 96% rename from docs/studios/unity/unity-sdk/in-editor-replay.mdx rename to docs/session-insights/in-editor-replay.mdx index 29620356..8416f539 100644 --- a/docs/studios/unity/unity-sdk/in-editor-replay.mdx +++ b/docs/session-insights/in-editor-replay.mdx @@ -1,5 +1,5 @@ --- -sidebar_label: 'Bot Replay' +sidebar_label: 'In-Editor Replay' --- # Replaying Bot Behaviors in the Unity Editor @@ -62,7 +62,7 @@ For the entity in the tick representing the Bot Instance that the replay data wa Shows any command(s) that the Bot sent to the game for the current tick. These could be movements, performed abilities, object interactions, etc #### Validations -Shows any validation(s) that the Bot performed on the current tick. These are normally test cases coded into the Bot to validate that the tick data changed as expected based on prior actions or other factors in the game state. See Validation Bots ([C#](./creating-bots/csharp/validation-bots)) ([JavaScript](./creating-bots/javascript/validation-bots)) for more information. +Shows any validation(s) that the Bot performed on the current tick. These are normally test cases coded into the Bot to validate that the tick data changed as expected based on prior actions or other factors in the game state. See Validation Bots ([C#](../creating-bots/csharp/scenario-testing)) ([JavaScript](../creating-bots/javascript/scenario-testing)) for more information. ### Registering Custom Models For Replay Objects When viewing a replay, entities that are dynamically spawned into the scene (not defined in the scene itself) need to be told what model to render with. By default they will load as a pink capsule, but they can be configured with a specific model based on their type. diff --git a/docs/studios/faq.md b/docs/studios/faq.md deleted file mode 100644 index 3d3cad67..00000000 --- a/docs/studios/faq.md +++ /dev/null @@ -1 +0,0 @@ -# Studio FAQ \ No newline at end of file diff --git a/docs/studios/unity/unity-sdk/RGFindUtils.mdx b/docs/studios/unity/unity-sdk/RGFindUtils.mdx deleted file mode 100644 index a2eff2fd..00000000 --- a/docs/studios/unity/unity-sdk/RGFindUtils.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -sidebar_label: 'RGFindUtils' ---- - -# RGFindUtils - -`RGFindUtils` is a singleton providing a set of utility functions for finding GameObjects. This -is extremely useful when implementing [`RGAction`](./RGAction)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 -``` - -# Class Methods - -### `public T FindOneByInstanceId(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 - - - - -```cs -public override void StartAction(Dictionary input) -{ - var targetInstanceId = int.Parse(input["targetId"].ToString()); - - var targetObject = RGFindUtils.Instance.FindOneByInstanceId(targetInstanceId); - if (targetObject != null) - { - // Set some class variable that is then used in the `Update()` function - targetTransform = targetObject.transform; - } -} -``` - - \ No newline at end of file diff --git a/docs/studios/unity/unity-sdk/creating-bots/csharp/validation-bots.mdx b/docs/studios/unity/unity-sdk/creating-bots/csharp/validation-bots.mdx deleted file mode 100644 index b936a93a..00000000 --- a/docs/studios/unity/unity-sdk/creating-bots/csharp/validation-bots.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -sidebar_label: 'Validation Bots' ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# Defining Bots for Validation Testing - -:::info -Support for Unity C# Validation Bots is coming soon ... -::: - diff --git a/docs/studios/unity/tutorials/first_tutorial.md b/docs/tutorials/building-your-first-bot.md similarity index 87% rename from docs/studios/unity/tutorials/first_tutorial.md rename to docs/tutorials/building-your-first-bot.md index 9cf1afce..67e3de66 100644 --- a/docs/studios/unity/tutorials/first_tutorial.md +++ b/docs/tutorials/building-your-first-bot.md @@ -25,7 +25,7 @@ power ups (represented by blue spheres). We will cover: - How to add various state and actions scripts to your game for bots to understand - How to build your first bot -![A Unity scene with a cube and a sphere](first_bot_tutorial_images/tutorial_0_start.png) +![A Unity scene with a cube and a sphere](img/building-your-first-bot/tutorial-0-start.png) ## Create an account on Regression Games @@ -67,9 +67,9 @@ https://github.com/Regression-Games/RGUnityBots.git#v0.0.1 ``` - Note that this package utilizes TextMeshPro. If you are prompted by Unity to add TextMeshPro assets to your project, please add them. -- Note that this package installs a dependency of Newtonsoft Json (https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.1/manual/index.html) for serializing/deserializing Json message payloads. +- Note that this package installs a dependency of [Newtonsoft Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.1/manual/index.html) for serializing/deserializing Json message payloads. -![Screenshot of the package imported into the project](first_bot_tutorial_images/tutorial_1_package.png) +![Screenshot of the package imported into the project](img/building-your-first-bot/tutorial-1-package.png) ## Restart Unity and your IDE @@ -88,7 +88,7 @@ Enter the following information: * **RG Password:** `` * Make sure both "Enable Screen Overlay" and "Use Global Settings" are checked on -![Screenshot of the settings page.](first_bot_tutorial_images/tutorial_2_settings.png) +![Screenshot of the settings page.](img/building-your-first-bot/tutorial-2-settings.png) ## Add the RGOverlayCanvas @@ -106,7 +106,7 @@ this into each scene - the SDK will ensure that only one instance is present. You can find this prefab by searching in the project file window for `RGOverlayCanvas` (make sure the "In Packages" filter is selected), or by navigating to the **Packages** > **Regression Games Unity Bots** > **Runtime** > **Prefabs** folder. -![Screenshot of the search pane for the RGOverlayCanvas.](first_bot_tutorial_images/tutorial_3_RGOverlay1.png) +![Screenshot of the search pane for the RGOverlayCanvas.](img/building-your-first-bot/tutorial-3-RGOverlay1.png) Drag this overlay onto your scene. Once you have this overlay available, you can click play to see this in action! A Regression Games logo will appear at the bottom of your screen. Click this button to see a dropdown for your bots. You @@ -120,14 +120,14 @@ _You only need to do this if you plan on interacting with the canvas_. ::: -![Screenshot of the RGOverlayCanvas.](first_bot_tutorial_images/tutorial_4_RGOverlay2.png) +![Screenshot of the RGOverlayCanvas.](img/building-your-first-bot/tutorial-4-RGOverlay2.png) ## Implement the RGBotSpawnManager The RGBotSpawnManager is the primary point of configuration for how your bots are spawned into the game. This component provides a few methods that can be overridden to control how bots are spawned into the scene, how they are seated into your game logic before spawning, how they are destroyed, etc... For this particular tutorial, we need to define one -method, [`SpawnBot()`](/studios/unity/unity-sdk/RGBotSpawnManager#public-virtual-void-seatbotbotinformation-bottospawn). +method, [`SpawnBot()`](../integrating-with-unity/seating-and-spawning-bots#public-virtual-void-seatbotbotinformation-bottospawn). This method will define how our bot prefab is spawned into the scene. First, create a `RegressionGames/Runtime/` folder in your `Assets` folder. Then, create a file called `CharacterBotSpawnManager.cs`. @@ -137,7 +137,7 @@ that the file is opened as part of the solution / project as a whole, so that co Copy and paste the following code into this file. This component allows us to drag and drop a prefab for our bots and a spawn point directly within our editor, and informs our SDK of these via those overridden functions. -See the [full reference](/studios/unity/unity-sdk/RGBotSpawnManager) for all the ways you can modify +See the [full reference](../integrating-with-unity/seating-and-spawning-bots) for all the ways you can modify the spawning of bots. Sometimes you may need to add this bot to a multiplayer network protocol, configure information like the character type, or define special start logic. This can all be done through the interface provided by `RGBotSpawnManager`. @@ -177,18 +177,18 @@ and attach this `CharacterBotSpawnManager` component to that object. Then, creat position it within the scene wherever you want to spawn your bot (ideally above the platform), and drag that game object into the **Bot Spawn Point** entry of the RGBotSpawner's `CharacterBotSpawnManager` component. Finally, find the **Player** prefab provided by the sample project (located within **Assets** > **Prefabs**), and drag this into the **Rg Bot Prefab** entry. Regression Games now knows how to load and unload bots from your scene! Make sure to save the scene. -![Screenshot of the RGOverlayCanvas.](first_bot_tutorial_images/tutorial_5_spawner.png) +![Screenshot of the RGOverlayCanvas.](img/building-your-first-bot/tutorial-5-spawner.png) ## Add state information to relevant GameObjects The next step is to indicate what state in your scene is available to bots. This state is used by bots to -make decisions on what actions to take. State is relayed to bots by attaching [`RGState`](/studios/unity/unity-sdk/RGState) +make decisions on what actions to take. State is relayed to bots by attaching [`RGState`](../integrating-with-unity/defining-entities-and-their-states) components to any game object or prefab that you want your bots to know about. -The base implementation of [`RGState`](/studios/unity/unity-sdk/RGState) provided by Regression Games relays default +The base implementation of [`RGState`](../integrating-with-unity/defining-entities-and-their-states) provided by Regression Games relays default information such as a `type`, `position`, and a unique identifier. In this sample scene, we will use this default state information, but of course you may need to provide additional state, such as a players team, health, if a door is open, etc... -You can do this by checking out the docs and examples for [`RGState.GetState()`](/studios/unity/unity-sdk/RGState#public-virtual-dictionarystring-object-getstate). +You can do this by checking out the docs and examples for [`RGState.GetState()`](../integrating-with-unity/defining-entities-and-their-states#public-virtual-dictionarystring-object-getstate). In this scene, open the `Player` prefab located in the **Assets > Prefabs** folder by double clicking the prefab, click **Add Component**, and then add the `RGState` component by searching for "RG State" in the component @@ -197,14 +197,14 @@ that both `Is Player` and `Is Runtime Object` are checked. Make sure to save the prefabs by clicking **Save**! Repeat this process for the `PowerUp` prefab, but change the `Object Type` to `PowerUp`, and only have `Is Runtime Object` checked (`Is Player` should be off). -![Screenshot of the prefab with a RG State script.](first_bot_tutorial_images/tutorial_6_prefab.png) +![Screenshot of the prefab with a RG State script.](img/building-your-first-bot/tutorial-6-prefab.png) That's all you need to do for your bot to see the state of the game! ## Implement actions your bot can take Finally, we need to provide an interface that allows bots to control these characters in your game. This is -done using the [`RGAction`](/studios/unity/unity-sdk/RGAction) interface. +done using the [`RGAction`](../integrating-with-unity/defining-actions) interface. ```cs /** @@ -281,9 +281,9 @@ public class RGPlayerMoveAction : RGAction } ``` -You can think of [`RGAction`](/studios/unity/unity-sdk/RGAction) as a task that your bot can run. In this case, +You can think of [`RGAction`](../integrating-with-unity/defining-actions) as a task that your bot can run. In this case, we define a move action, which tells the bot to move to a location until they are in range of the target location. -Because [`RGAction`](/studios/unity/unity-sdk/RGAction) is a MonoBehaviour, `Awake()` and `Update()` methods are +Because [`RGAction`](../integrating-with-unity/defining-actions) is a MonoBehaviour, `Awake()` and `Update()` methods are implemented that run the logic for this type of action. An action can triggered by a Regression Games bot, and the action script can execute the logic to perform that action. @@ -299,12 +299,12 @@ bot should approach. Finally, search for and add the `RGAgent` script to the Player prefab - this tells Regression Games to find all `RGAction`s on this prefab and register them with the agent, and informs Regression Games that this prefab will act as an agent. -![Screenshot of the prefab with a RG Action script.](first_bot_tutorial_images/tutorial_7_action.png) +![Screenshot of the prefab with a RG Action script.](img/building-your-first-bot/tutorial-7-action.png) :::info It is common that you will want to find GameObjects and other components within your scene to perform actions. -See the [`RGFindUtils`](../unity-sdk/RGFindUtils) class for helper functions which find GameObjects and components +See the [`RGFindUtils`](../creating-bots/csharp/utilities#rgfindutils) class for helper functions which find GameObjects and components within your scene based on information coming in from an action. ::: @@ -361,9 +361,9 @@ then back on the Regression Games site, select that repo (click the refresh butt you can't see your repository, or click the link to connect the repository if it is private), the main branch, and the root directory. Give your bot a name, select the Unity bot type, and then click **Create Bot**. -![Screenshot of the bot creation page.](first_bot_tutorial_images/create_bot_1.png) -![Screenshot of the bot github page.](first_bot_tutorial_images/create_bot_2.png) -![Screenshot of the bot details page.](first_bot_tutorial_images/create_bot_3.png) +![Screenshot of the bot creation page.](img/building-your-first-bot/create-bot-1.png) +![Screenshot of the bot github page.](img/building-your-first-bot/create-bot-2.png) +![Screenshot of the bot details page.](img/building-your-first-bot/create-bot-3.png) Once the bot is created, clone the repository and open the `index.js` file. @@ -393,7 +393,7 @@ from the Regression Games overlay (click the button in the bottom right of the s After a few seconds, you will see your bot spawn and collect the power up! If something is not working, send us a message on Slack or Discord and we will respond almost immediately! -![Video of the bot performing.](first_bot_tutorial_images/tutorial_8_demo.gif) +![Video of the bot performing.](img/building-your-first-bot/tutorial-8-demo.gif) ## Extensions - Configuring your bot @@ -437,7 +437,8 @@ the bot live reload and change its speed! ## Next steps -For immediate next steps, we recommend checking out our guide on [creating bots that can do QA validations](/studios/unity/unity-sdk/creating-bots/javascript/validation-bots). In soon-to-be-added guides, tutorials will walk you through: +For immediate next steps, we recommend checking out our guide on [creating bots that run predetermined scenarios](../creating-bots/javascript/scenario-testing). +In soon-to-be-added guides, tutorials will walk you through: - Creating bots with abilities - Pairing a Regression Games bot with dialog systems such as character.ai diff --git a/docs/studios/unity/tutorials/github_actions.md b/docs/tutorials/github-actions.md similarity index 94% rename from docs/studios/unity/tutorials/github_actions.md rename to docs/tutorials/github-actions.md index be75d04a..fdfb803b 100644 --- a/docs/studios/unity/tutorials/github_actions.md +++ b/docs/tutorials/github-actions.md @@ -13,9 +13,9 @@ This tutorial will walk you through the following steps to create a QA Bot for y 4. Learn how to view test results. This tutorial assumes you have some familiarity with GitHub Actions, and that you have a working -bot within your game (see more on this in the [Creating Bots in JavaScript section](/studios/unity/unity-sdk/creating-bots/javascript/configuration)). +bot within your game (see more on this in the [Creating Bots in JavaScript section](../creating-bots/javascript/configuration)). By the end of this tutorial, every push to your GitHub repo will build your Unity project and start bots for testing. -You can find a working example in [this repository](https://github.com/Regression-Games/RGUnitySample) for reference, which has +You can find a working example in [our sample repository](https://github.com/Regression-Games/RGUnitySample), which has a GitHub Action configuration and Unity Test Runner file incorporating the ideas of this tutorial. :::caution @@ -31,7 +31,7 @@ tutorial is a first-pass at supporting CI/CD, but more features are coming soon This feature requires a Unity license, as CI/CD builds for Unity are only available to those with a Unity license. If you want to use an existing CI/CD pipeline, you can skip ahead to the sections -below regarding [test configurations](#3-add-the-qa-bot-workflow-file-to-your-project) and +below regarding [test configurations](#add-the-workflow-file-to-your-project) and [test files](#add-a-test-to-your-unity-project). ::: @@ -148,15 +148,15 @@ the following secrets by clicking the green **New repository secret** button. 1. `RG_HOST` - `https://play.regression.gg` 2. `RG_API_KEY` - Your API key from Regression Games, which can be found in your [account settings](https://play.regression.gg/account). - Full instructions for this can be found in the [Authentication docs](studios/api_reference/authentication). + Full instructions for this can be found in the [Authentication docs](../authenticating-with-api-keys). 3. `RG_BOT` - The ID of the bot you want to run. You can find this through the bot's details within the Regression Games [Bot Manager page](https://play.regression.gg/bots). -![Bot ID](./github_actions_images/bot_id.png) +![Bot ID](img/github-actions/bot-id.png) Once you are done adding these secrets, your secrets section should look similar to the following: -![Secrets for GitHub Actions](./github_actions_images/secrets.png) +![Secrets for GitHub Actions](img/github-actions/secrets.png) ## Add a Test to Your Unity Project @@ -171,7 +171,7 @@ in your Unity project. Before adding the test, make sure your desired test scenes are placed inside your build. You can add your scenes to the build using the menu option **File** > **Build Settings**. -![Build settings](./github_actions_images/build.png) +![Build settings](img/github-actions/build.png) ### Configure Test Runner for Your Project @@ -358,7 +358,7 @@ At a high level, this test is doing the following: ### Test it out with an Existing Bot Our test is now setup! Before we commit and push our changes, let's test it out locally with an existing bot. To do this, you can -follow the [first bot guide](/studios/unity/tutorials/first_tutorial) or [creating bots reference](/studios/unity/unity-sdk/creating-bots/javascript/configuration) +follow the [first bot guide](../tutorials/building-your-first-bot) or [creating bots reference](../creating-bots/javascript/configuration) to create and configure a bot. As a quick test, you can make a bot that simply waits for a few seconds before completing its test. Note that **having your bot call `rg.complete()` is extremely important! Without this line of code, your bot will run forever!** @@ -387,12 +387,12 @@ Once you are satisfied with your local test, you can commit and push your change GitHub Actions workflow, which will build your Unity project and start your bot. You can view the status of your workflow by going to the **Actions** tab of your GitHub repository. -![Actions tab](./github_actions_images/actions_tab.png) +![Actions tab](img/github-actions/actions-tab.png) Once your workflow has completed, you can view the results of your test by clicking on the **Build my project** step of your workflow. You should see that the bot successfully started and executed! -![Build step](./github_actions_images/build_step.png) +![Build step](img/github-actions/build-step.png) ## Viewing Test Results @@ -400,8 +400,8 @@ Once your tests have completed, you can view their results on Regression Games b [Running Bots](https://play.regression.gg/running-bots) tab. From this page you can download bot logs for the test session which contain output from your bot-code. You can also download in-game replay data which can be loaded in the Unity Editor to watch the movements and actions of each bot, as well as analyze the validations they performed. See the -[In-Editor Replay](/studios/unity/unity-sdk/in-editor-replay) for instructions on how to load replay data. +[In-Editor Replay](../session-insights/in-editor-replay) for instructions on how to load replay data. -![Downloads](./github_actions_images/downloads.png) +![Downloads](img/github-actions/downloads.png) -![The timeline feature](./github_actions_images/timeline.png) \ No newline at end of file +![The timeline feature](img/github-actions/timeline.png) \ No newline at end of file diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/create_bot_1.png b/docs/tutorials/img/building-your-first-bot/create-bot-1.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/create_bot_1.png rename to docs/tutorials/img/building-your-first-bot/create-bot-1.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/create_bot_2.png b/docs/tutorials/img/building-your-first-bot/create-bot-2.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/create_bot_2.png rename to docs/tutorials/img/building-your-first-bot/create-bot-2.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/create_bot_3.png b/docs/tutorials/img/building-your-first-bot/create-bot-3.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/create_bot_3.png rename to docs/tutorials/img/building-your-first-bot/create-bot-3.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_0_start.png b/docs/tutorials/img/building-your-first-bot/tutorial-0-start.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_0_start.png rename to docs/tutorials/img/building-your-first-bot/tutorial-0-start.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_1_package.png b/docs/tutorials/img/building-your-first-bot/tutorial-1-package.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_1_package.png rename to docs/tutorials/img/building-your-first-bot/tutorial-1-package.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_2_settings.png b/docs/tutorials/img/building-your-first-bot/tutorial-2-settings.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_2_settings.png rename to docs/tutorials/img/building-your-first-bot/tutorial-2-settings.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_3_RGOverlay1.png b/docs/tutorials/img/building-your-first-bot/tutorial-3-RGOverlay1.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_3_RGOverlay1.png rename to docs/tutorials/img/building-your-first-bot/tutorial-3-RGOverlay1.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_4_RGOverlay2.png b/docs/tutorials/img/building-your-first-bot/tutorial-4-RGOverlay2.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_4_RGOverlay2.png rename to docs/tutorials/img/building-your-first-bot/tutorial-4-RGOverlay2.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_5_spawner.png b/docs/tutorials/img/building-your-first-bot/tutorial-5-spawner.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_5_spawner.png rename to docs/tutorials/img/building-your-first-bot/tutorial-5-spawner.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_6_prefab.png b/docs/tutorials/img/building-your-first-bot/tutorial-6-prefab.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_6_prefab.png rename to docs/tutorials/img/building-your-first-bot/tutorial-6-prefab.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_7_action.png b/docs/tutorials/img/building-your-first-bot/tutorial-7-action.png similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_7_action.png rename to docs/tutorials/img/building-your-first-bot/tutorial-7-action.png diff --git a/docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_8_demo.gif b/docs/tutorials/img/building-your-first-bot/tutorial-8-demo.gif similarity index 100% rename from docs/studios/unity/tutorials/first_bot_tutorial_images/tutorial_8_demo.gif rename to docs/tutorials/img/building-your-first-bot/tutorial-8-demo.gif diff --git a/docs/studios/unity/tutorials/github_actions_images/actions_tab.png b/docs/tutorials/img/github-actions/actions-tab.png similarity index 100% rename from docs/studios/unity/tutorials/github_actions_images/actions_tab.png rename to docs/tutorials/img/github-actions/actions-tab.png diff --git a/docs/studios/unity/tutorials/github_actions_images/bot_id.png b/docs/tutorials/img/github-actions/bot-id.png similarity index 100% rename from docs/studios/unity/tutorials/github_actions_images/bot_id.png rename to docs/tutorials/img/github-actions/bot-id.png diff --git a/docs/studios/unity/tutorials/github_actions_images/build_step.png b/docs/tutorials/img/github-actions/build-step.png similarity index 100% rename from docs/studios/unity/tutorials/github_actions_images/build_step.png rename to docs/tutorials/img/github-actions/build-step.png diff --git a/docs/studios/unity/tutorials/github_actions_images/build.png b/docs/tutorials/img/github-actions/build.png similarity index 100% rename from docs/studios/unity/tutorials/github_actions_images/build.png rename to docs/tutorials/img/github-actions/build.png diff --git a/docs/studios/unity/tutorials/github_actions_images/downloads.png b/docs/tutorials/img/github-actions/downloads.png similarity index 100% rename from docs/studios/unity/tutorials/github_actions_images/downloads.png rename to docs/tutorials/img/github-actions/downloads.png diff --git a/docs/studios/unity/tutorials/github_actions_images/secrets.png b/docs/tutorials/img/github-actions/secrets.png similarity index 100% rename from docs/studios/unity/tutorials/github_actions_images/secrets.png rename to docs/tutorials/img/github-actions/secrets.png diff --git a/docs/studios/unity/tutorials/github_actions_images/timeline.png b/docs/tutorials/img/github-actions/timeline.png similarity index 100% rename from docs/studios/unity/tutorials/github_actions_images/timeline.png rename to docs/tutorials/img/github-actions/timeline.png diff --git a/docusaurus.config.js b/docusaurus.config.js index 3f3cb411..4734c922 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -73,17 +73,10 @@ const config = { items: [ { type: 'docSidebar', - sidebarId: 'playersSidebar', + sidebarId: 'unitySidebar', position: 'left', - label: 'Players', + label: 'Developer Reference', }, - { - type: 'docSidebar', - sidebarId: 'studiosSidebar', - position: 'left', - label: 'Studios', - }, - // {to: '/blog', label: 'Blog', position: 'left'}, { type: 'doc', docId: 'changelog', @@ -104,12 +97,12 @@ const config = { title: 'Docs', items: [ { - label: 'For Studios', - to: '/studios/unity/unity-sdk/overview', + label: 'Overview', + to: 'overview', }, { - label: 'For Players', - to: '/players/account-setup', + label: 'Quickstart', + to: 'quickstart', }, ], }, @@ -150,8 +143,7 @@ const config = { }), scripts: [ { - src: - '/js/loadposthog.js', + src: '/js/loadposthog.js', async: false, }, ] diff --git a/sidebars.js b/sidebars.js index 27ed11c7..c69351ba 100644 --- a/sidebars.js +++ b/sidebars.js @@ -5,7 +5,6 @@ - provide next/previous navigation The sidebars can be generated from the filesystem, or explicitly defined here. - Create as many sidebars as you want. */ @@ -14,127 +13,71 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { - playersSidebar: [ - 'players/account-setup', + unitySidebar: [ + 'overview', + 'quickstart', { type: 'category', - label: 'Supported Games', + label: 'Tutorials', items: [ - { - type: 'category', - label: 'Minecraft', - items: [ - 'players/supported-games/minecraft/requirements', - 'players/supported-games/minecraft/ultimate-collector', - 'players/supported-games/minecraft/capture-the-flag', - { - type: 'category', - label: 'APIs', - items: ['players/supported-games/minecraft/apis/rg-bot-api', 'players/supported-games/minecraft/apis/ctf-utils'] - }, - { - type: 'category', - label: 'Tutorials', - items: ['players/supported-games/minecraft/tutorials/trash-talking-bot', 'players/supported-games/minecraft/tutorials/hunter-bot'] - } - ], - }, - ] + 'tutorials/building-your-first-bot', + 'tutorials/github-actions' + ], }, { - type: 'category', - label: 'Creating AIs', - items: [ - 'players/creating-bots/starter-templates', - 'players/creating-bots/blockly', - 'players/creating-bots/agent-builder', - { - type: 'category', - label: 'Writing Your Own Code', - items: ['players/creating-bots/coding/dev-requirements', 'players/creating-bots/coding/upload-zip'] - } - ] + // horizontal divider + type: 'html', + value: '', + defaultStyle: true, + className: 'horizontal-divider' }, - 'players/faq' - ], - - studiosSidebar: [ - 'studios/unity/unity-sdk/overview', + 'authenticating-with-api-keys', { type: 'category', - label: 'REST API Reference', + label: 'Integrating with Unity', items: [ - 'studios/api_reference/authentication', + 'integrating-with-unity/defining-entities-and-their-states', + 'integrating-with-unity/defining-actions', + 'integrating-with-unity/BotInformation', + 'integrating-with-unity/seating-and-spawning-bots', ] }, { type: 'category', - label: 'Regression Games Unity Bots', + label: 'Creating Bots', items: [ { type: 'category', - label: 'SDK Reference', + label: 'C# Reference', items: [ - 'studios/unity/unity-sdk/RGBotSpawnManager', - 'studios/unity/unity-sdk/BotInformation', - 'studios/unity/unity-sdk/RGState', - 'studios/unity/unity-sdk/RGAction', - 'studios/unity/unity-sdk/RGFindUtils', + 'creating-bots/csharp/configuration', + 'creating-bots/csharp/adaptive-bots', + 'creating-bots/csharp/scenario-testing', + 'creating-bots/csharp/utilities' ] }, { type: 'category', - label: 'Creating Bots', + label: 'JavaScript Reference', items: [ - { - type: 'category', - label: 'C# Reference', - items: [ - 'studios/unity/unity-sdk/creating-bots/csharp/configuration', - 'studios/unity/unity-sdk/creating-bots/csharp/playtest-bots', - 'studios/unity/unity-sdk/creating-bots/csharp/validation-bots', - 'studios/unity/unity-sdk/creating-bots/csharp/utilities' - ] - }, - { - type: 'category', - label: 'JavaScript Reference', - items: [ - 'studios/unity/unity-sdk/creating-bots/javascript/configuration', - 'studios/unity/unity-sdk/creating-bots/javascript/playtest-bots', - 'studios/unity/unity-sdk/creating-bots/javascript/validation-bots', - 'studios/unity/unity-sdk/creating-bots/javascript/agent-builder' - ] - }, + 'creating-bots/javascript/configuration', + 'creating-bots/javascript/adaptive-bots', + 'creating-bots/javascript/scenario-testing', + 'creating-bots/javascript/agent-builder' ] }, - { - type: 'category', - label: 'Tooling', - items: ['studios/unity/unity-sdk/in-editor-replay',] - }, - { - type: 'category', - label: 'Tutorials and Guides', - items: [ - 'studios/unity/tutorials/quickstart_sample_scene', - 'studios/unity/tutorials/first_tutorial', - 'studios/unity/tutorials/github_actions' - ], - } ] }, + 'pre-made-bots', { type: 'category', - label: 'Platform Features', + label: 'Session Insights', items: [ - 'studios/platform_features/marketplace', - 'studios/platform_features/validations', + 'session-insights/client-dashboard', + 'session-insights/in-editor-replay' ] - }, - 'studios/faq', - 'changelog', - ], + } + ] }; module.exports = sidebars; diff --git a/src/css/custom.css b/src/css/custom.css index 2bc6a4cf..50fb2aac 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -17,6 +17,10 @@ --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); } +[data-theme='light'] { + --ifm-color-light-gray: #dadada; +} + /* For readability concerns, you should choose a lighter palette in dark mode. */ [data-theme='dark'] { --ifm-color-primary: #25c2a0; @@ -27,4 +31,5 @@ --ifm-color-primary-lighter: #32d8b4; --ifm-color-primary-lightest: #4fddbf; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); + --ifm-color-light-gray: #444444; } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e83256b7..4f409cef 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -16,12 +16,12 @@ const HomepageHeader = () => (
+ to="tutorials/building-your-first-bot"> Get Started + to="overview"> Full Reference