-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REG-2230, REG-2231] Implement Validations Within Segments #370
Conversation
using UnityEngine; | ||
using UnityEngine.UIElements; | ||
|
||
namespace RegressionGames.Editor.Validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related or relevant to the current PR... will remove in a moment, so you can ignore this for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been removed
...ession.unity.bots/Runtime/Scripts/StateRecorder/BotSegments/BotSegmentsPlaybackController.cs
Outdated
Show resolved
Hide resolved
src/gg.regression.unity.bots/Runtime/Scripts/StateRecorder/BotSegments/Models/BotSegment.cs
Show resolved
Hide resolved
...e/Scripts/StateRecorder/BotSegments/Models/SegmentValidations/ScriptSegmentValidationData.cs
Outdated
Show resolved
Hide resolved
...e/Scripts/StateRecorder/BotSegments/Models/SegmentValidations/ScriptSegmentValidationData.cs
Outdated
Show resolved
Hide resolved
// } | ||
|
||
// Validation is expected to perform its actions in its own 'Update' or 'LateUpdate' calls... we don't directly call it | ||
// TODO(vontell): When it reaches its own self-determined end condition, it should destroy itself |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be adjusted as part of my behaviour rewrite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed/added really I guess (added the part where it actually does process based on some outside update loop)
@@ -0,0 +1,248 @@ | |||
# Prototype - Code-based Validations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops also need to remove this old readme from IF, skip this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed and will add back new docs later today.
...ession.unity.bots/Runtime/Scripts/StateRecorder/BotSegments/BotSegmentsPlaybackController.cs
Outdated
Show resolved
Hide resolved
src/gg.regression.unity.bots/Runtime/Scripts/Validation/RGValidateBehaviour.cs
Outdated
Show resolved
Hide resolved
@RG-nAmKcAz this is now ready for an actual review, thank you for the high level points, I think things are much cleaner now. I do need to work on the merge conflicts since I bet there are a lot of changes in bot segments I might need to worry about... but will try it out. Also update the boss room PR with the relevant changes: https://github.com/Regression-Games/RGBossRoom/pull/81 |
@vontell The merge will restructure your code in the Controller completely, so let's do that first |
Back to you, @RG-nAmKcAz. I do need to add even more tests to bossroom, mine are very very simple, but I will be doing that tonight. No rush to review this tonight of course, but note that I do plan on giving Kachi an experimental branch to play around with since I promised them a timeline (this was intentional, I needed to get this to them in the first half of the week), but I expect to continuously making fixes over the next few days depending on whether they use it or not. Appreciate all the comments so far! |
Update on this from evening work (TLDR; no new review needed yet unless you want to be proactive): I actually need a few more hours on this to think through a few small pieces... see this video if you are interested in seeing what I changed (hint: I reasoned that I need to support validations over sequences or multiple segments to really get any utility out of this). https://www.loom.com/share/31165d0f9a9f471db710b1d3b48f68a3?sid=4c8b3ec9-b2e9-4882-93ab-c295353fe804 |
...ession.unity.bots/Runtime/Scripts/StateRecorder/BotSegments/BotSegmentsPlaybackController.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to better understand
//Debug.LogError($"Validation method {validator.Method.Name} was never passed or failed, so it is technically passed.");
but beyond that it looks good.
I skimmed the infrastructure and set up parts, nothing popped out to me but I am deferring to Zack's comments there.
...ntime/Scripts/StateRecorder/BotSegments/Models/SegmentValidations/SegmentValidationStatus.cs
Show resolved
Hide resolved
src/gg.regression.unity.bots/Runtime/Scripts/Validation/RGValidationScript.cs
Outdated
Show resolved
Hide resolved
src/gg.regression.unity.bots/Runtime/Scripts/Validation/RGValidationScript.cs
Outdated
Show resolved
Hide resolved
src/gg.regression.unity.bots/Runtime/Scripts/Validation/RGValidationScript.cs
Show resolved
Hide resolved
@vontell For my understanding and speeding up reviews, this is a good example of a PR that I would have appreciated a top level walkthrough in the form of a video. I am realizing that I spend a good amount of time identifying which of the 30+ file changes I should give my attention and trying to simulate the code flow to resolve assumptions. Things clicked when I got to BossRoom/.../ValidateUI.cs but it took a sec. I think the 'code walkthrough video' helps especially when I don't have the context in (SDK in this case) in my recent memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaron, marking this approved while you test / iterate as I agree with the fundamental design.
Co-authored-by: RG-nAmKcAz <[email protected]>
@batu back to you! Really like your suggestion of a loom video, I will do that in the future upfront, but also for other reviewers here is that video: https://www.loom.com/share/d6e9a506ccbd4605bdb7bdaa0d2448a0?sid=8ce1048a-d759-481f-b059-8fd58e98c046 |
@vontell this looks good to me! I really appreciate the loom video, it helped my understanding drastically, and it is very useful to me to see the thought process of the author. |
Note to reviewers: I am headed to lunch rn so will make my own self-review changes when I get back, but I didn't want to stall having people take a look at this, so opening it now.
This review is now ready... This PR implements an initial validations-in-editor feature. This doesn't report or record the results of the validations (as that is going to be done next as part of this ticket), but it implements all of the internal-facing parts of this. More particularly, it does the following:
validations
field to the bot segments which will contain the types of validations to run for that segmentScript
validation type that is essentially a C# file inheriting from a MonoBehaviour-esque class specifically for writing validations.Here is where I have some questions and might need some help with some debates:
I'll make some notes about other concerns in the PR - TLDR; I am very open to changing things in here, there are some concepts and ways this work that I am not tied to.
If you are curious, here is the associated Boss Room PR: https://github.com/Regression-Games/RGBossRoom/pull/81