Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[REG-1293] Update Agent Builder documentation for Unity SDK #39

Merged
merged 6 commits into from
Oct 26, 2023

Conversation

abeizer
Copy link
Collaborator

@abeizer abeizer commented Oct 20, 2023

  • Moved some pages into a /common directory to share between players and studios routes
  • Added "Agent Builder" page to studios sidebar
  • Updated images of Agent Builder's UI, since it has changed a bit since the last time we updated the docs
    • Added new images for Unity bots
  • Reorganized studios sidebar a bit to make it flow more nicely
    • Updated alllllll the links... this was killer
Screenshot 2023-10-20 at 1 51 57 PM

@nAmKcAz
Copy link
Contributor

nAmKcAz commented Oct 20, 2023

Is there a loom with the new content ?

Why did we drop the top level Unity header in the sidebar ? I'm sure we will need to support other engines going forward.

Copy link
Contributor

@addisonbgross addisonbgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments. These are some nice, descriptive docs

@nAmKcAz
Copy link
Contributor

nAmKcAz commented Oct 20, 2023

I think we need to make some changes to clarify or get some consistency with the language around Extract Data and Upload Generated Game Context.

Something about the word generated being there doesn't jive with me.

Maybe these 2 phrasings as a starting point so their connection is more explicit.
Extract Game Context
Upload Game Context

Copy link
Contributor

@vontell vontell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving in spirit, but want to give others a chance to approve rather than myself as well, so just adding this as a comment!

@abeizer
Copy link
Collaborator Author

abeizer commented Oct 23, 2023

I think we need to make some changes to clarify or get some consistency with the language around Extract Data and Upload Generated Game Context.

Something about the word generated being there doesn't jive with me.

Maybe these 2 phrasings as a starting point so their connection is more explicit. Extract Game Context Upload Game Context

I'm always for simplifying our labels + user-facing concepts. We'll have to update docs after making changes to the actual projects so they're consistent.
Tagging @rcornwall-reg for Unity-side

@abeizer
Copy link
Collaborator Author

abeizer commented Oct 23, 2023

Why did we drop the top level Unity header in the sidebar ? I'm sure we will need to support other engines going forward.

This is what the headers previously looked llke:
Screenshot 2023-10-23 at 11 47 27 AM

"Overview" was duplicated under both "Unity" and "Unity SDK Reference", which was redundant. Once I removed one of the Overview instanced, "Unity" and "Unity SDK Reference" became redundant. If we add more tooling around Unity and need to reintroduce the header, then it's a three-line change to sidebars.js (no changes needed to routes or file structure). For now, I think this looks cleaner.

Is there a loom with the new content ?

Loom where I scroll poorly, but should be slow enough that you can pause to read through each section: https://www.loom.com/share/0c77c81dd9ad421fa4d7743c37e78d56?sid=ce8a90b6-e1c6-489c-842b-88d3c62ae00d

Copy link
Contributor

@nAmKcAz nAmKcAz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving PENDING a task number being linked for the Button renames around context.

@nAmKcAz
Copy link
Contributor

nAmKcAz commented Oct 23, 2023

I think we need to make some changes to clarify or get some consistency with the language around Extract Data and Upload Generated Game Context.
Something about the word generated being there doesn't jive with me.
Maybe these 2 phrasings as a starting point so their connection is more explicit. Extract Game Context Upload Game Context

I'm always for simplifying our labels + user-facing concepts. We'll have to update docs after making changes to the actual projects so they're consistent. Tagging @rcornwall-reg for Unity-side

Please open a task for this as the work can be done on one task to update unity/ui/doc. The screenshots will be the most 'work' of the task, but other 2 parts are 1 liner wording updates

@abeizer
Copy link
Collaborator Author

abeizer commented Oct 23, 2023

Upload Game Context

Added here

Copy link
Contributor

@analogrelay analogrelay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I had some copy-editing nitpicks, but the core content is great. My comments come largely from opinion and just how it "reads" to me, so please feel free to carry on with a different approach!

@@ -197,12 +151,10 @@ This is a good example of how GPT sometimes needs additional coaching to reach y

### Validating Code

The embedded code editor offers standard syntax highlighting and Intellisense features for Regressions Games APIs.
The embedded code editor offers standard syntax highlighting and intelligent code completion features for Regressions Games APIs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta watch out for those pesky trademarks ™️ 🤣

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should've been addressed already 🤔
I made sure there are no other references to "Intellisense" left

# Creating AIs Using the Agent Builder

Regression Games' Agent Builder is an easy-to-use visual editor for constructing AI behavior trees.
Our editor utilizes large language models like [OpenAI's GPT-4](https://openai.com/blog/chatgpt) to write code for you.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Our editor utilizes large language models like [OpenAI's GPT-4](https://openai.com/blog/chatgpt) to write code for you.
Agent Builder provides powerful tools for developing your bots, including a code editor that includes an AI code assistant (powered by [OpenAI's GPT-4](https://openai.com/blog/chatgpt) that can understand our APIs and your game.

A mostly stylistic rewording suggestion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your suggestion - made some tweaks to it but the flow should be similar

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)), or you can have GPT do the heavy lifting for you.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to be a little more generic when we refer to the AI tools. Rather than "GPT", maybe just calling it our "AI assistant". We can certainly talk about what powers the AI assistant, but I think there's value in being a little less coupled to GPT in our docs and UI copy (for example, if we change models, all our docs remain accurate).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all references to GPT so they're now some permutation of "AI code assistant"

Comment on lines 160 to 164
These can be used to share data between nodes, and it's a good practice to specify a data type for `getData` to take advantage of the editor's Intellisense.

:::note
Classes to represent available state variables for entities are coming soon
:::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code, I think this is a little more accurate (I noticed that the data appears to be shared across ticks too and that was initially surprising to me, but I think it's useful):

Suggested change
These can be used to share data between nodes, and it's a good practice to specify a data type for `getData` to take advantage of the editor's Intellisense.
:::note
Classes to represent available state variables for entities are coming soon
:::
These can be used to share data between nodes and across each tick of your bot.
:::note
We recommend you specify a data type in `getData` so you can take full advantage of autocomplete in the editor.
:::

And again, no need for a "Coming Soon" here I think. We don't know when "soon" is, and when "soon" does come, it'd be better if we don't have to update this note.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only comment that I disagree with. I think it's going to be very confusing for someone to read "make sure you specify a type!" in the docs when the relevant types don't exist yet. We need some indication that we recommend the use of types where they can be applied, but that we're still working on implementing types to represent your states and actions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "under development" is a better phrase since you're right that we don't know how soon "soon" is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's going to be very confusing for someone to read "make sure you specify a type!" in the docs when the relevant types don't exist yet.

A very fair point, though perhaps one that argues for just omitting the "make sure you specify a type" comment until we actually have the type infrastructure in place?

Either way, I'm OK with it. I'm certainly not significantly opposed to referencing future work. I think in a previous iteration (before I saved the comment) I had something like this:

Suggested change
These can be used to share data between nodes, and it's a good practice to specify a data type for `getData` to take advantage of the editor's Intellisense.
:::note
Classes to represent available state variables for entities are coming soon
:::
These can be used to share data between nodes and across each tick of your bot.
:::note
We recommend you specify a data type in `getData` so you can take full advantage of autocomplete in the editor. The types available in the editor are limited, but we're continually adding more!
:::

Comment on lines 17 to 18
This tool is early in development - it is prone to change and may contain bugs.
Please report issues and feature requests for the Agent Builder [here](https://regression-games.sleekplan.app/feedback).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I've learned from writing docs is to avoid writing content you know will change over time, if you can avoid it.

Also "here" links are less accessible, as screen readers don't do a great job of describing them. It's better to give the link text that is specific to where the link goes, rather than relying on previous context in the sentence or paragraph.
 
So maybe rephrase this as:

Suggested change
This tool is early in development - it is prone to change and may contain bugs.
Please report issues and feature requests for the Agent Builder [here](https://regression-games.sleekplan.app/feedback).
We're constantly working to improve Agent Builder. You can report issues and submit feature requests on our [Feedback Site](https://regression-games.sleekplan.app/feedback).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

Comment on lines 82 to 83
All samples in this section are written in Typescript, which is the only language currently supported by the Agent Builder.
If you'd like to see support for other languages, like C#, let us know [here](https://regression-games.sleekplan.app/feedback).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my point above, we don't know if/when C# support will land. And while we certainly should update the docs when it does, it's easiest to just describe the situation now rather than predicting the future. We are, and always will be, "constantly evaluating support for other languages".

Suggested change
All samples in this section are written in Typescript, which is the only language currently supported by the Agent Builder.
If you'd like to see support for other languages, like C#, let us know [here](https://regression-games.sleekplan.app/feedback).
All samples in this section are written in TypeScript.
We're constantly evaluating support for other languages. Feel free to request others on our [Feedback Site](https://regression-games.sleekplan.app/feedback)!.

Copy link
Collaborator Author

@abeizer abeizer Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! I believe Sleekplan has a public roadmap feature. I don't think we're currently using it, but it could be really helpful for simplifying our documentation. ex. "See our roadmap for language support" ( @vontell )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great way to do this. Centralizing where we talk about the future makes it easier to ensure we keep it relatively up-to-date :). My main concern is having lots of different docs referencing future features that may or may not actually exist at the time the reader is looking at the page.

@@ -15,7 +15,7 @@ make decisions, and interact with game elements.

## Project Setup

A Bot project is structured as an npm package.
A Javascript Bot project is structured as an npm package.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A Javascript Bot project is structured as an npm package.
A JavaScript Bot project is structured as an npm package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all occurrences of "Javascript"

- **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 skips execution of the remaining children and returns a failure status.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It executes its child nodes sequentially, and if any one of them fail then the Sequence Node skips execution of the remaining children and returns a failure status.
It executes its child nodes sequentially, and if any one of them fail then the Sequence Node immediately returns the Failure status and stops executing child nodes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, kept the wording similar to the updated verbiage for Selector Node

@abeizer abeizer merged commit a7bb14a into main Oct 26, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants