space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.62k stars 3.28k forks source link

Onboarding/Tutorial System #28616

Open Jezithyr opened 4 months ago

Jezithyr commented 4 months ago

We need to implement a tutorial/onboarding experience for new players that explains the basic game controls and interface. Ideally this should be expandable/customizable by downstream/forks through yaml or config. To implement this as fast as possible (hopefully before the influx of players from PCTide), we should focus on getting this implemented as fast as possible and worry about supporting expansion/customization at a later date.

Part 1:

This is a system for allowing players to select tutorial/onboarding depth, from none to "everything" and can be used for both onboarding and other possible tutorial systems.

The first thing we need for onboarding/tutorialization is having some way of toggling/querying a user's onboarding preferences:

Part 2:

The specifics for the onboarding system:

For the actual onboarding system:

Onboarding would have multiple helper methods that allow for UI prompts/highlights to be displayed and dismissed. Specifically:

Onboarding hints would be triggered via hooking/subscribing to events that are raised in code

An "Onboarding flow" is a defined onboarding "flow"/sequence that defines the number of and specific onboarding steps present in an instance of onboarding. Each option selected in part 1 (except for no onboarding) will correspond to an "Onboarding flow".

clorl commented 3 months ago

I've been wanting to tackle this in a PR for some time and I might give it a shot if that's alright. My idea would be contextual popups on the side of the screen like some RPGs I used to play had. You get prompts to do something, when the action succeeds it goes onto the next step, or the player can skip through the pages.

So for example, when you connect, the onboarding flow says "move using WASD", when that is done, the next step is triggered (for example : left click an object to take it etc). Any step can be skipped by the player, and the whole onboarding flow can be dismissed.

However, I think there should be more than two "Onboarding flows". There should be two general ones (the super newbie one and the "kinda used to the game" one), but also onboarding for different machines, items, systems that would popup throughout the game and can be : altogether disabled or dismissed. For example, if a player has completed the basic onboarding, the first time they'll play a specific job, an onboarding can be shown for that job etc.

clorl commented 3 months ago

This is a sample OnboardingFlow prototype I came up with. Please let me know if that's a good way to implement this

- type: onboardingFlow
  id: LearnMovementsFlow
  trigger: !type:PlayerSpawnEvent   # Here valid EntityEventArgs
  priority: 0                       # The higher priority flows will be played over low priority ones when multiple valid flows can be played
  interrupt: false        # Onboarding flows can interrupt ongoing ones (eg. When emergency shuttle is called for the first time, the newcomer should be explained what it is and informed to go there asap)
  steps:
    - content:
      - type: !type:SimpleText
        text: "Press WASD to move"
      resolve: !type:PlayerMoveEvent  # Valid EntityEventArgs
    - content:
      - type: !type:PointToObject
        entityType: Sunglasses
        text: "Click on an object to pick it up"
      resolve:
        type: !type:PlayerPickupEvent
        entityType: Sunglasses
    - content:
      - type: !type:MultiPageContent
        pages:
          - type: !type:SimpleText
            text: "Did you know you can throw items?"
          - type: !type:SimpleText
            text: "It's very cool"
      resolve: !type:PlayerPickupEvent

Each step is a OnboardingStep which contains:

Semi exhaustive list of what content types could exist Onboarding step content types

Jezithyr commented 3 months ago

@clement-or

I've been wanting to tackle this in a PR for some time and I might give it a shot if that's alright.

I've already started working on this unfortunately 😅, but once I finish setting up the onboarding systems and such I could definitely use some help setting up the events and hooking everything up in the prototypes.

My idea would be contextual popups on the side of the screen like some RPGs I used to play had. You get prompts to do something, when the action succeeds it goes onto the next step, or the player can skip through the pages.

Yep this is along the lines of what I had in mind, but more in-depth with actual stateful flows (ie: you complete actions to finish a "step") and more specific things and if you disconnect mid onboarding it would continue next time at the last "stage" you completed.

Each step is a OnboardingStep

Onboarding steps should be their own prototypes so that they can be reused and reordered across different flows.

There should be two general ones

Ideally onboarding should be scalable and allow for servers to define however many onboarding flows they want (and their display orders). In addition, I'd also like to implement the ability to switch between different levels of job/role onboarding as well.