jayther / hackathon-overlay-minigame

HomePage
ISC License
1 stars 2 forks source link

Duelers - Overlay Minigame - Twitch Channel Points Hackathon

Duelers: An overlay minigame with Twitch Channel Points Integration where viewers can duel others as fighters on stream.

Note: If you're looking for the unchanged hackathon submission, go here (https://github.com/jayther/hackathon-overlay-minigame/releases/tag/v0.1.0)

Features

Tech stack

Setup

For dev or locally running. Currently only setup for local.

ngrok

  1. Go to ngrok's download page (https://ngrok.com/download) and download
  2. Install ngrok
  3. Create an account at ngrok (https://dashboard.ngrok.com/signup) (It's free!)
  4. Follow the instructions in their authtoken page (https://dashboard.ngrok.com/get-started/your-authtoken)

Twitch API Keys

  1. Create an application at dev.twitch.tv console
  2. Put in a name
  3. Put in these as OAuth Redirect URLs:
    • http://localhost:8080/callback
    • http://localhost:8080/chatbot
  4. For Category, choose Game Integration
  5. Click Create
  6. Copy Client ID and Client Secret

Your computer

  1. Clone repo
  2. npm install
  3. npm run build
  4. npm run server
  5. Go to http://localhost:8080 in a browser (Control Panel)
  6. Follow instructions in control panel:
    1. Put in Client ID and Client Secret when requested
    2. Click "Start Authorization" to log into your Twitch account
    3. After logging in and allowing the app, go back to Control Panel
    4. For the chatbot, click "Start Authorization" to log into your chatbot's Twitch account (maybe open in incognito or a different browser)
      • Optionally, you can use your Twitch account and the game will chat in your behalf
  7. After chatbot connects to chatand the events are subscribed, it is ready!

Widget (browser source overlay, the actual game)

  1. In OBS or Streamlabs OBS, add a new Browser source.
  2. Disable Local File
  3. Put http://localhost:8080/widget.html in the URL box.
  4. Set desired Width and Height. Optimized for 1280x720 dimensions, but can be any size and the fighters and arena will adjust accordingly.
  5. Advisable to enable Control audio via OBS
  6. Keep default custom CSS:
    body { background-color: rgba(0, 0, 0, 0); margin: 0px auto; overflow: hidden; }
  7. Disable Shutdown source when not visible
  8. Disable Refresh browser when scene becomes active

Also, advisable to only have the one browser source (referenced between scenes), as battles are decided by the widget, not the server.

Control Panel

Accessible at http://localhost:8080 . Start duels, change settings, manage fighters, and manage rewards in the control panel.

Home tab

Home tab contains both Duels and Players panels (minus Duel settings).

Players tab

View player's/fighter's settings, and manually change player settings, request duels, and remove.

Duels tab

Rewards tab

Manage reward settings and redemption log.

Reward actions (shown in Missing Rewards and Reward Map):

Missing Rewards panel (only shown when there are missing reward mappings)

Reward Map panel (shows currently mapped rewards):

Character Settings panel:

Redemptions panel: redemption log.

Sounds tab

Change global volume and individual sound type volumes. You can change via slider or the text box (0-100).

Debug tab

Some debug functions.

Miscellaneous

settings.json

Spritesheet adjuster

Used to adjust positions of sprites of characters. Not needed for normal functionality, but just needed to explain what npm run server-debug does.

Start with npm run server-debug then visit http://localhost:8080.

Troubleshooting

My local server is not receiving redeems!

Here are some things to try:

The reward mappings in the Reward Tab are showing "Unknown"

This is a known bug with setting up the project for the first time, during the authorizing stages in the Control Panel. To fix, just refresh the Control Panel web page.

Any other issues?

Create an issue here!

Credits

Note: The license for this project does not apply for the libraries and assets used. Some assets are purchased for use. Please refer to their licenses.