Code Monkey home page Code Monkey logo

digitalicebreakers's Introduction

Digital Icebreakers

Digital Icebreakers

Digital Icebreakers is a platform for presenters and audiences to collaborate, play, and experiment together.

How it works

A presenter creates a Lobby and audience members join by pointing their phone cameras at the presenter's screen and scanning the QR code. The presenter can then guide the audience through games and experiences by clicking New Activity. Try it out on digitalicebreakers.com.

Build

  1. Clone this repo
  2. Install .NET Core 3.1 SDK
  3. Run ASPNETCORE_URLS=http://0.0.0.0:5000 ASPNETCORE_ENVIRONMENT=Development dotnet run --project DigitalIcebreakers

Infrastructure overview

Infrastructure diagram

Game Architecture

A Lobby is created and owned by the Presenter. Participants may join as Clients. A Presenter controls which Game is currently running, and can close the Lobby at any time, ejecting all off the Clients. A Client's experience is guided by the Presenter.

Creating your own Game

A Game consists of two parts:

  1. C# code that controls the Game's messaging between the Presenter, Clients and System.
  2. TypeScript-based React components that control the view and actions of the Presenter and Clients.

I will create a game called Splat to illustrate what is required for a (rather trivial) end-to-end game. The Game should be entirely implemented within the DigitalIcebreakers folder and project. Splat will have one button on Client views. On press, the Presenter view will choose a random point and color, and begin expanding a filled circle centered on the point. On release, the circle will disappear.

Implement the Backend

  1. Add Splat.cs to DigitalIcebreakers/Games. I've just copied Buzzer.cs because the messaging is the same - I've just changed the class name and set the Name property.
  2. Add the Splat constructor to GameHub.GetGame .

Implement the Frontend

  1. Add a folder called DigitalIcebreakers/ClientApp/src/games/Splat, and inside it implement:
    1. SplatClient.tsx. I've just copied BuzzerClient and updated the name, because the UI for the Client is identical. This component uses pixi.js to render a button and forwards the press and release events to the SignalR hub.
    2. SplatPresenter.tsx. Again I copied BuzzerPresenter, switched it to extend PixiView, removed render() as we don't need it for PixiView and implemented the response to up/down button presses.
  2. Add a record to DigitalIcebreakers/ClientApp/src/games/Games.tsx for Splat, setting it's name and importing the Presenter and Client components.

Running & Testing

In Visual Studio Code, you can hit F5 and this will compile both the Backend and Frontend and launch a browser. Once the site loads, click Host > Create, and move the window to half of your screen. Right-click the URL at the top of the page and select Open Link in Incognito Window - this new window will connect as a Client. On the first window click New Activity > Splat. You should see the Client window update with button - clicking the button will update the Presenter.

Contributing

  • Jump in and build your own games & experiences immediately!
  • Suggest new features and/or games
  • Post feedback on your experience while using Digital Icebreakers with your group/talk/presentation
  • If you want to make architectural improvements (of which many are needed), start a conversation first to improve the likelihood your PR is merged.

Help

Ask here, or on twitter, or anywhere here.

digitalicebreakers's People

Contributors

kcoote avatar kcootedinh avatar nellysattari avatar staff0rd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

digitalicebreakers's Issues

Game: Start Stop Continue

Player

  • Form with single text entry, three buttons: Start, Stop, Continue

Presenter

  • Displays results, under headings of Start, Stop, Continue
  • Can export
  • Can clear

Game: Presenter-led trivia

Inspirations from pub-style trivia. Can be based on the existing Poll game.

Unlike actual pub-style where questions are asked as a round, and then answers are revealed at the end of the round, this implementation would instead follow the pattern of Question/Answer > Reveal > Question/Answer > Reveal etc.

Must-haves

  • Presenter - Score/leaderboard
  • Presenter - Editing questions - Indicate correct answer
  • Presenter - Displaying questions - Correct answer reveal
  • Client - Cache locked in answers
  • On presenter refresh, query server cache for existing responses
  • On gotoNextQuestion, force QuestionAndResponse so answer is not revealed
  • Block users from responding to a question while the answer is displayed
  • x/y label on question view

Nice-to-haves

  • Presenter - Questions with images
  • Client - Free-text entry
  • Open Trivia DB integration
  • Hide the scoreboard button if no questions have correct answers configured
  • Time based questions
  • Randomised answer position

Implementation details

  • No validation exists on whether the presenter has set a correct answer on each question. If no correct answer is set for a question, then that question does not affect the scoreboard upon answering.

Failed to invoke hub method 'connect'.

{OriginalFormat}: Failed to invoke hub method '{HubMethod}'.
Account Id:
Application version: 1.0.0.0
AspNetCoreEnvironment: Production
Auth user Id:
Browser version:
CategoryName: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher
City: Winston Hills
Client IP address: 0.0.0.0
Cloud role instance: RD2818786B64E7
Cloud role name: digitalicebrakers20181115063039
Country or region: Australia
Device model:
Device type: PC
Event time: 30/11/2018, 17:36:29
Exception: System.InvalidOperationException: Sequence contains more than one matching element

at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)

at DigitalIcebreakers.Hubs.GameHub.GetPlayer(User user) in C:\git\DigitalIcebreakers\DigitalIcebreakers\Hubs\GameHu...
Exception type: System.InvalidOperationException
Failed method: DigitalIcebreakers.Hubs.GameHub.GetPlayer
HubMethod: connect
Operating system:
Operation Id: fa4d7c17-461694e38f406984
Operation name: GET /gameHub
Parent Id: |fa4d7c17-461694e38f406984.
Problem Id: System.InvalidOperationException at DigitalIcebreakers.Hubs.GameHub.GetPlayer
Sample Rate: 100
SDK version: aspnet5c:2.3.0
Session Id:
Severity level: Error
Source of synthetic traffic:
State or province: New South Wales
Telemetry type: exception
User Id:

View this instance in the Azure portal<\a>
View similar exceptions in this time range<\a>

Error when dispatching 'OnDisconnectedAsync' on hub.

{OriginalFormat}: Error when dispatching '{HubMethod}' on hub.
Account Id:
Application version: 1.0.0.0
AspNetCoreEnvironment: Production
Auth user Id:
Browser version:
CategoryName: Microsoft.AspNetCore.SignalR.HubConnectionHandler
City: Sydney
Client IP address: 0.0.0.0
Cloud role instance: RD2818786B64E7
Cloud role name: digitalicebrakers20181115063039
Country or region: Australia
Device model:
Device type: PC
Event time: 30/11/2018, 17:32:25
Exception: System.InvalidOperationException: Sequence contains more than one matching element

at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)

at DigitalIcebreakers.Hubs.GameHub.OnDisconnectedAsync(Exception exception) in C:\git\DigitalIcebreakers\DigitalIce...
Exception type: System.InvalidOperationException
Failed method: DigitalIcebreakers.Hubs.GameHub+d__18.MoveNext
HubMethod: OnDisconnectedAsync
Operating system:
Operation Id: fa4d7b5b-461694e38f406984
Operation name: GET /gameHub
Parent Id: |fa4d7b5b-461694e38f406984.
Problem Id: System.InvalidOperationException at DigitalIcebreakers.Hubs.GameHub+d__18.MoveNext
Sample Rate: 100
SDK version: aspnet5c:2.3.0
Session Id:
Severity level: Error
Source of synthetic traffic:
State or province: New South Wales
Telemetry type: exception
User Id:

View this instance in the Azure portal<\a>
View similar exceptions in this time range<\a>

Clients cannot exit lobbys

  • Will stay connected if Presenter does not close lobby
  • Lobbys currently do not timeout
  • When attempting to join a new lobby, old lobby forces connect

Split Trivia & Poll

Such that they are two separate games sharing a common base.
This would allow future extension into a third game: Trivia with questions auto-populated

Log lobby id

Lobby id needs to be logged so player count queries can be joined to lobby name

Write docs

  • Readme
  • Architecture diagram
  • Example game

Lobby count wrong on Presenter

Repro

  1. Join on Mobile
  2. Turn off mobile
  3. Wait until disconnect
  4. Turn on mobile

EXPECTED: Lobby count shows 1
ACTUAL: Lobby count shows 2

StartStopContinue > Retrospective

  • Rename Start Stop Continue to Retrospective
  • Allow presenter to configure what the section titles are labeled
  • Replicate these labels on participant buttons
  • Use localstorage

Failed to invoke hub method 'connectToLobby'.

{OriginalFormat}: Failed to invoke hub method '{HubMethod}'.
Account Id:
Application version: 1.0.0.0
AspNetCoreEnvironment: Production
Auth user Id:
Browser version:
CategoryName: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher
City: Winston Hills
Client IP address: 0.0.0.0
Cloud role instance: RD2818786B64E7
Cloud role name: digitalicebrakers20181115063039
Country or region: Australia
Device model:
Device type: PC
Event time: 30/11/2018, 17:36:30
Exception: System.InvalidOperationException: Sequence contains more than one matching element

at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)

at DigitalIcebreakers.Hubs.GameHub.GetPlayer(User user) in C:\git\DigitalIcebreakers\DigitalIcebreakers\Hubs\GameHu...
Exception type: System.InvalidOperationException
Failed method: DigitalIcebreakers.Hubs.GameHub.GetPlayer
HubMethod: connectToLobby
Operating system:
Operation Id: fa4d7c17-461694e38f406984
Operation name: GET /gameHub
Parent Id: |fa4d7c17-461694e38f406984.
Problem Id: System.InvalidOperationException at DigitalIcebreakers.Hubs.GameHub.GetPlayer
Sample Rate: 100
SDK version: aspnet5c:2.3.0
Session Id:
Severity level: Error
Source of synthetic traffic:
State or province: New South Wales
Telemetry type: exception
User Id:

View this instance in the Azure portal<\a>
View similar exceptions in this time range<\a>

Embedded Powerpoint Ideas

  • Allow presenters to join/re-join from other devices similar to how players are able to join via code
    • Could be an option to allow multiple presenters, for example one device running the presentation, with the presenter controlling the lobby via their mobile device
  • Idea walls
    • Being able to click through multiple instances of an idea wall, similar to how Poll clicks through questions
    • Setting a title on an idea wall which is displayed both on the presenter's screen, and on the client's screen
    • Export idea wall data
  • Embedding in Powerpoint - test this via Powerpoint > Insert Object
    • Looked like the side menu did not appear

svg height errors in dev console

Error: <svg> attribute height: Unexpected end of attribute. Expected length, "".
Error: <svg> attribute width: Unexpected end of attribute. Expected length, "".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.