-
Notifications
You must be signed in to change notification settings - Fork 38
Dylan/onboarding-upgrades #28
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
Dylan/onboarding-upgrades #28
Conversation
78e2bc8
to
1b4d40d
Compare
refactor: Whats next cleanup, +unity, -bloat Removed redundant text while there refactor: Unity quickstart fixes, impr, prettify refactor: Unity pt1 fixes, impr, prettify fix(README): Rm "see test edits below" ref * !exists refactor(minor): General onboarding cleanup * Shorter, prettier, consistent fix(sdks/c#): Broken unitypackage url feat(sdks/c#): Add OneTimeQuery api ref
1b4d40d
to
60472af
Compare
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.
Nice, these are largely good improvements 👍
Left a few specific questions/concerns below
|
||
https://sdk.spacetimedb.com/SpacetimeDBUnitySDK.unitypackage | ||
In Unity navigate to the `Assets > Import Package > Custom Package` menu in the menu bar. Select your `SpacetimeDB.Unity.Comprehensive.Tutorial.unitypackage` file and leave all folders checked. |
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.
hm, you're right, but I don't know that this name change was intentional.. @jdetter ?
docs/unity/part-1.md
Outdated
@@ -105,6 +112,8 @@ At this point you should have the single player game working. In your CLI, your | |||
spacetime start | |||
``` | |||
|
|||
💡Below examples Rust language, [but you may also use C#](../modules/c-sharp/index.md) at the cost of 1/2 the speed. |
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'm not sure that we should advertise/codify this speed difference 🤔 it's kind of in flux. @jdetter do you have thoughts?
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.
On a second pass, there's a chance it could sound like we're passively-aggressively pushing them towards Rust, but at the same time... this would probably explain why a Unity tutorial shows Rust server code instead of C# (that was the question in my head that triggered the speed addition suggestion)? I had no clue the diff was so huge.
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.
For now, I removed the speed memo, but left the C# link. After talking with @jdetter , we'll actually soon diverge this Unity pt1 section into C# as well - not just Rust. There's a draft for this for the future onboarding upgrades (pt2)
docs/unity/part-1.md
Outdated
PlayerMovementController.Local.GetModelRotation(), | ||
PlayerMovementController.Local.IsMoving()); | ||
bool hasUpdatedRecently = lastUpdateTime.HasValue && | ||
Time.time - lastUpdateTime.Value > 1.0f / movementUpdateSpeed; |
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 like breaking up these variables 💯
..but this line break/indent is super confusing 😅
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.
also, you didn't introduce this issue, but since we're here: this code is wrong!
Maybe we can add another variable?
float? deltaTime = Time.time - lastUpdateTime;
bool hasUpdatedRecently = deltaTime.HasValue && deltaTime.Value < 1.0f / movementUpdateSpeed;
bool isConnected = SpacetimeDBClient.instance.IsConnected();
if (hasUpdatedRecently || !isConnected)
{
return;
}
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.
Got it -- also, I'm wondering how you folks feel about this:
if (hasUpdatedRecently || !isConnected)
return;
Do you like the shortcut versions for simple if
s? I didn't touch these, just in case.
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'm indifferent - @jdetter does it matter to you?
## Call Reducers | ||
|
||
You can use the CLI (command line interface) to run reducers. The arguments to the reducer are passed in JSON format. | ||
|
||
```bash | ||
spacetime call <module-name> send_message '["Hello, World!"]' | ||
spacetime call <module-name> send_message "Hello, World!" |
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 assume it caused some cryptic error with the square brackets? 😅
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.
'twas a cryptic err ;)
- PR review change requests - Additionally: hasUpdatedRecently fix and reformatting
✅ Went through all the raised issues |
0ae22ff
to
f54d3d4
Compare
Edited in the Google Doc draft with screenshots and verbose details (only Clockwork can view+comment for now): |
- Used FindBy since that was what the tutorial used, and also looking for a single Identity. - Note: There may be a similar rust discrepancy in the Unity pt1 tutorial. It'll work with Filter, but just simply less consistent. Holding off on that since my Rust syntax knowledge !exists.
f54d3d4
to
47b473b
Compare
* Duplicate comments found both above and within funcs
* Removed `System.Runtime.CompilerServices` * SpacetimeDB.Module seems to already include this (merged the info)
New minor commit: Add a memo that standalone mode will run in the foreground, which may throw some off when you need to publish (and keep this open). Thanks for the idea, @PuruVJ (I experienced the same friction, myself) (Final addendum for this shift, and perhaps for this entire PR minus other suggestions) |
docs/getting-started.md
Outdated
|
||
```bash | ||
spacetime start | ||
``` | ||
|
||
The server listens on port `3000` by default, customized via `--listen-addr`. | ||
|
||
💡 Standalone mode will run in the foreground: new commands will require a new terminal window. |
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.
How about writing in first person: Standalone mode will run in the foreground. Open a new terminal to run new commands
It feels easier to parse
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.
That's a good one, too. In the end, I changed it to "💡 Standalone mode will run in the foreground", since there are numerous ways to do this (someone pointed out you can also add &
to make it run in the bg). Perhaps we don't need too much info, as long as they know the gist?
* At general quickstart for `spacetime start`
80156cb
to
4986db6
Compare
* Also, removed the "speed" loss mention of C#
There's another fix I want to add, but didn't yet since it's a bit more complex:
Edit: How about this?Edit 2:[Internal] Discussion: https://discord.com/channels/931210784011321394/1205409581120102451 Edit 3: |
PlayerMovementController.Local.GetModelRotation(), | ||
PlayerMovementController.Local.IsMoving()); | ||
float? deltaTime = Time.time - lastUpdateTime; | ||
bool hasUpdatedRecently = deltaTime.HasValue && deltaTime.Value < 1.0f / movementUpdateSpeed; |
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.
(review note: I asked to switch this to <
, because as far as I can tell the >
was a bug)
- After a verbose discussion, we will eventually swap to FindBy for single-result queries, but not in this PR. - For now, the syntax err is fixed by making the var nullable and suffixing a LINQ FirstOrDefault(). Approved by Tyler in Discord. - We never *actually* created a player in the tutorial. This creates the player. Approved by Tyler in Discord.
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, thanks for the bump - meant to approve this! These improvements look great 👍
But let's not merge until John's had a chance to glance.
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 think this looks good. We synced with @jdetter in a meeting as well.
One last question
After being informed there was only 1 remaining question (answered+fixed), merging! |
Problem
Onboarding towards the path of C# and Unity experiences a minor block, alongside minor inconsistencies, bloat and room for UX improvements.
Solution
Unity3d
refs to the modern-namedUnity
and added "or Rider" appended to Visual Studio mentions.OneTimeQuery
C# api ref.spacetime-web
that fixes all external links that are currently showing as unstyled.Testing
There was a README note instructing how to test below, but there seemed to be no instructions below (I also removed this note). However, I was able to use the preview pane in Rider to ensure expected visuals.
(Edit: Squashed for clarity)