Skip to content
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/refactor/unity tutorial revamp #37

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

dylanh724
Copy link
Contributor

@dylanh724 dylanh724 commented Mar 29, 2024

About

  • Updated the Unity tutorial, surrounding a newly-created PR for a new Unity graybox tutorial based off @bfops 's prototype
  • Less focus on Unity setup, more focus on SpacetimeDB
  • Overview is a short summary
  • Part 1 is a quickstart: You technically don't even need part 2 + 3 unless you want to analyze the demo
  • Part 2 covers server
  • Part 3 covers client, with some client-server flow coverage

Made in Unity 2022.3.20 LTS

Why?

The current tutorial:

  • Focuses too much on Unity, along with its setup nuances
  • Focuses on Rust, although it should be C# (since targeting Unity devs)
    • Although there is my floating PR to add a C# parity, this version is significantly improved, using the new tutorial and is forked from this PR
  • Is overly bloaty and jumps around too often

⚠️ Prerequisites

  1. This is branched from Dylan/onboarding-upgrades open PR awaiting merge
  2. ⌛This replaces the old demo with the new one - an open PR awaiting merge
    • zeke-demo-project needs to be renamed to something more official-sounding
    • ⌛[Post-Merge] Repo links currently point to a WIP fork: Need to replace refs
  3. ⌛Merge the clockwork-web PR to replace the Unity tutorial static images just before you merge this

New Tutorial Feats

See root README

Meta Changes

The C# reference Unity section was updated (on a side note, the old Unity section here was factually incorrect -- the .unitypackage was for the demo that included the SDK; not the SDK).

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)
- Deploy section split:
  - BEFORE: [ Testnet ]
  - AFTER: [ Overview, Hosted, Self-Hosted ]
- In root doc overview, added a name to the publish command (to prevent confusion later)
- Added instructions how to add back `local` and `testnet` servers via CLI after repeatedly experiencing a bug that wipes the servers.
- Some good stuff moved to 'homeless', for now, to possibly be used later in an advanced section
- This should be more or less ready
@dylanh724 dylanh724 requested review from bfops and jdetter March 29, 2024 08:43
@dylanh724 dylanh724 marked this pull request as draft March 29, 2024 08:43
@dylanh724 dylanh724 added the documentation Improvements or additions to documentation label Mar 29, 2024
# Conflicts:
#	docs/sdks/c-sharp/index.md
#	docs/unity/part-1.md
- (!) Be sure to approve the other spacetime-web PR (edited to OP) for images to show up: https://github.com/clockworklabs/spacetime-web/pull/392
- Since the static images are hosted on another repo, it's hard to preview
@dylanh724
Copy link
Contributor Author

Setting this to ready status, but be sure to follow prereqs

@dylanh724 dylanh724 marked this pull request as ready for review April 29, 2024 01:54
@dylanh724 dylanh724 requested a review from cloutiertyler April 29, 2024 01:54
@jdetter jdetter removed their request for review November 8, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants