Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Conversation

@dylanh724
Copy link
Contributor

Prereqs

This PR is dependent on my other PR, #28. If the other PR is still open, please review that 1st.

About

  • Overview was added to the Unity tutorial section.
  • In the Unity pt1 tutorial, a C# variant was added to parity the Rust module in a tutorial split.
  • Unity tutorial was split into Basic Multiplayer and Advanced sections.

Why?

  • Despite being a Unity tutorial (where the user likely already knows C#), the tutorial exampled only a Rust module.
  • Having Rust as the only tutorial option created friction when the user is already learning multiple new things: The SpacetimeDB architecture, the CLI, the client SDK and server SDK. If they previously did not know Rust, this could add some weight to the onboarding friction.
  • The Unity tutorial could use an overview since it's lengthy and progressive.
  • Part1 should be split, anyway - it covers way too much for a single section to handle (especially since it jumps between client and server).
  • Splitting the sections between basic multiplayer + advanced makes things more-manageable and less intimidating.

Before

  • UNITY TUTORIAL
    • Part1 (Client + Rust Server)
    • Part2 (Resources and Scheduling)
    • Part3 (BitCraft Mini)

After

  • UNITY TUTORIAL - BASIC MULTIPLAYER
    • Overview
    • Part1 (Setup)
    • Part2a (Rust Server)
    • Part2b (C# Server)
    • Part3 (Client)
  • UNITY TUTORIAL - ADVANCED
    • Part4 (Resources and Scheduling)
    • Part5 (BitCraft Mini)

Note

I linked the entire file to a public gist post. This may look more professional if this was moved to a more "official" looking account for either now (this PR) or in the future.

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
- PR review change requests
- Additionally: hasUpdatedRecently fix and reformatting
- 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.
* Duplicate comments found both above and within funcs
* Removed `System.Runtime.CompilerServices`
* SpacetimeDB.Module seems to already include this (merged the info)
* At general quickstart for `spacetime start`
* Also, removed the "speed" loss mention of C#
- 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.
- Why?
  - Despite being a Unity tutorial (we 100% know the user knows C#), the server example used Rust.
  - This creates friction when the user is already learning multiple new things: The SpacetimeDB architecture, the CLI, the client SDK and server SDK. If they previously did not know Rust, this could add some weight to the onboarding friction.
  - The Unity tutorial could use an overview since it's quite lengthy and progressive.
  - Part1 should be split, anyway - it covers way too much for a single section to handle (especially since it jumps between client and server). Splitting between basic multiplayer + advanced makes things more-manageable and less intimidating.

- Before:
  - UNITY TUTORIAL
    - Part1 (Client + Rust Server)
    - Part2 (Resources and Scheduling)
    - Part3 (BitCraft Mini)

- After:
  - UNITY TUTORIAL - BASIC MULTIPLAYER
    - Overview
    - Part1 (Setup)
    - Part2a (Rust Server)
    - Part2b (C# Server)
    - Part3 (Client)
  - UNITY TUTORIAL - ADVANCED
    - Part4 (Resources and Scheduling)
    - Part5 (BitCraft Mini)
@dylanh724 dylanh724 requested review from bfops and jdetter February 23, 2024 09:44
@dylanh724 dylanh724 changed the title Dylan/unity tutorials csharp parity Dylan/feat-unity-tutorials-csharp-parity Feb 26, 2024
@dylanh724 dylanh724 changed the title Dylan/feat-unity-tutorials-csharp-parity Dylan/unity-tutorials-csharp-parity Feb 26, 2024
@dylanh724 dylanh724 added the documentation Improvements or additions to documentation label Feb 26, 2024
@dylanh724
Copy link
Contributor Author

dylanh724 commented Mar 29, 2024

⚠️All of the Unity section is deprecated in this PR and will be replaced by spacetime-docs::Dylan/refactor/unity tutorial revamp, thanks to a new Unity tutorial that was assigned later.

There are still outside edits here worth visiting:

image

Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

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

This largely looks great, thanks @dylanh724 🙏

Left some small notes, typos etc.

dylanh724 and others added 6 commits April 24, 2024 09:19
Rust -> C#

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
- `--lang=rust` to `=csharp`

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
- Rm RustRover mention

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
- Rust -> C#

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
- Server issues shouldn't link to Client troubleshooting that has no answer
@dylanh724
Copy link
Contributor Author

All issues resolved ( @bfops )

@bfops bfops self-assigned this Apr 24, 2024
@bfops
Copy link
Collaborator

bfops commented Apr 24, 2024

Thanks @dylanh724 ! I think this looks good, but possibly one last tweak?

dylanh724 and others added 2 commits April 25, 2024 15:08
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
@dylanh724
Copy link
Contributor Author

Thanks @dylanh724 ! I think this looks good, but possibly one last tweak?

Sure thing - done!

Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks Dylan 🎉

@bfops bfops merged commit 6ed040b into clockworklabs:master Apr 25, 2024
@dylanh724 dylanh724 deleted the dylan/unity-tutorials-csharp-parity branch April 29, 2024 01:25
bfops added a commit that referenced this pull request Aug 5, 2025
* doc: Onboarding impr, fixes, consistency, cleanup

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

* doc: Onboarding impr, fixes, consistency, cleanup

* fix: Rm redundant 'module_bindings' mention

* fix: Floating period, "arbitrary", "important":

- PR review change requests
- Additionally: hasUpdatedRecently fix and reformatting

* fix: Mentioned FilterBy, used FindBy

- 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.

* fix(Unity-pt1): Rm copy+paste redundant comments

* Duplicate comments found both above and within funcs

* fix(unity): Rm unused using statement +merged info

* Removed `System.Runtime.CompilerServices`
* SpacetimeDB.Module seems to already include this (merged the info)

* refactor(minor): Code spacing for grouping/clarity

* feat: 'Standalone mode runs in foreground' memo

* At general quickstart for `spacetime start`

* refactor(unity-pt1): Standalone mode foreground memo

* Also, removed the "speed" loss mention of C#

* fix(syntaxErr): Fix err, keep FilterBy, handle null

- 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.

* doc!(unity-tutorial): Add C# module parity + split

- Why?
  - Despite being a Unity tutorial (we 100% know the user knows C#), the server example used Rust.
  - This creates friction when the user is already learning multiple new things: The SpacetimeDB architecture, the CLI, the client SDK and server SDK. If they previously did not know Rust, this could add some weight to the onboarding friction.
  - The Unity tutorial could use an overview since it's quite lengthy and progressive.
  - Part1 should be split, anyway - it covers way too much for a single section to handle (especially since it jumps between client and server). Splitting between basic multiplayer + advanced makes things more-manageable and less intimidating.

- Before:
  - UNITY TUTORIAL
    - Part1 (Client + Rust Server)
    - Part2 (Resources and Scheduling)
    - Part3 (BitCraft Mini)

- After:
  - UNITY TUTORIAL - BASIC MULTIPLAYER
    - Overview
    - Part1 (Setup)
    - Part2a (Rust Server)
    - Part2b (C# Server)
    - Part3 (Client)
  - UNITY TUTORIAL - ADVANCED
    - Part4 (Resources and Scheduling)
    - Part5 (BitCraft Mini)

* Update docs/unity/part-2b-c-sharp.md

Rust -> C#

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>

* Update docs/unity/part-2b-c-sharp.md

- `--lang=rust` to `=csharp`

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>

* Update docs/unity/part-2b-c-sharp.md

- Rm RustRover mention

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>

* Update docs/unity/part-2b-c-sharp.md

- Rust -> C#

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>

* fix: "Next tutorial" mixups

* fix: Bad troubleshooting links

- Server issues shouldn't link to Client troubleshooting that has no answer

* Update docs/unity/part-2b-c-sharp.md

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>

* Update docs/unity/part-2a-rust.md

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>

---------

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants