Skip to content

donebd/SIGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Web selfhosted SIGame Engine for offline parties

Full-featured multi-format game engine for hosting local quiz games in the "SIGame" format.

๐Ÿš€ Major v2.0 Update: .siq Support!

Now supporting both manual folder structures and standard .siq packages. Just drag and drop your existing packs and play!

Full vibe-coded project for hosting local quiz games in the "SIGame" format (similar to "What? Where? When?").

Project is a complete game engine for hosting your own game in offline mode, where participants interact with the host directly, without using mobile devices or apps. Participants only need to be present in the room, and the host needs two screens: one with the admin panel for managing the game, and the second for displaying questions and information to players.

How to Play

Quick Start

  1. Download the game:

    • Go to Releases and download the latest SIGame.html file
    • Or build it yourself (see Building section)
  2. Open the game:

    • Double-click SIGame.html to open it in your browser - this will be the admin panel for the host
  3. Open the TV screen for players:

    • Click the "Open TV Screen" button in the admin panel
    • Or open SIGame.html?screen=game in a new browser window/tab
    • This window should be displayed on a second screen/projector so players can see the questions
  4. Set up the game:

    • Load a question pack (you can use a ready .siq package or a folder with questions)
    • Add players/teams through the admin panel
    • Start the game by selecting questions from the grid

Recommended Setup

  • Screen 1 (Admin Panel): Host's laptop/computer - here the host manages the game
  • Screen 2 (TV Screen): Projector/large monitor for players - here players see questions and scores

Important: Both screens should be open in the same browser (can be on different devices on the same network, but BroadcastChannel API only works within the same browser/profile). For cross-device operation, additional synchronization setup will be required.

Screenshots

Game Grid View

Left: Players View | Right: Admin View

Game Board - Players View Game Board - Admin View

Question View & Controls

Left: Players View | Right: Admin View

Question Handling - Players View Question Handling - Admin View

How It Works

The Host manages the game through the admin panel:

  • Loads question packs
  • Adds players/teams
  • Selects questions from the grid
  • Controls content display (shows questions, answers, media)
  • Awards/deducts points
  • Controls audio and video playback

Players see on the large screen (TV screen):

  • Question grid
  • Current question with media content
  • Player/team scores
  • Animations and visual effects

All synchronization between the admin panel and player screen happens automatically via BroadcastChannel API in real-time.

Features

  • ๐ŸŽฎ Admin panel for game management
  • ๐Ÿ“บ Player screen with real-time synchronization
  • ๐ŸŽต### Supported formats
  • Text: Classic text questions.
  • Image: Visual questions.
  • Audio: Music and sound questions (mp3, wav).
  • Video: Video clips (mp4, webm).
  • Mashup: Questions with hidden music/text revealed on click.
  • Select: Multiple-choice questions with answer options.
  • ๐Ÿ”„ Synchronization between admin panel and player screen
  • โ„๏ธ Holiday effects (snow, garlands)
  • ๐ŸŽ‰ Animated Results Screen
  • ๐ŸŽ‰ Confetti animations
  • ๐ŸŽฏ Special cards (cat in a bag, bet, auction)

Project Structure

src/
โ”œโ”€โ”€ types/           # TypeScript types and interfaces
โ”œโ”€โ”€ state/           # State management
โ”œโ”€โ”€ services/        # Business logic services
โ”‚   โ”œโ”€โ”€ StorageService.ts
โ”‚   โ”œโ”€โ”€ SyncService.ts
โ”‚   โ””โ”€โ”€ FileService.ts
โ”œโ”€โ”€ ui/              # UI components
โ”‚   โ”œโ”€โ”€ BaseUI.ts
โ”‚   โ”œโ”€โ”€ AdminUI.ts
โ”‚   โ””โ”€โ”€ TVScreen.ts
โ”œโ”€โ”€ media/           # Media controllers
โ”‚   โ”œโ”€โ”€ AudioController.ts
โ”‚   โ””โ”€โ”€ VideoController.ts
โ”œโ”€โ”€ utils/           # Utility functions
โ”‚   โ”œโ”€โ”€ helpers.ts
โ”‚   โ”œโ”€โ”€ fileDetector.ts
โ”‚   โ””โ”€โ”€ i18n.ts
โ”œโ”€โ”€ app.ts           # Main application entry point
โ””โ”€โ”€ styles.css       # Application styles

Installation

npm install

Development

# Development mode with hot reload
npm run dev

# Build for production
npm run build

# Type checking
npm run type-check

# Serve built files
npm run serve

Building

The project uses Webpack to bundle everything into a single HTML file:

npm run build

The output will be in SIGame.html - a single, self-contained HTML file that can be opened in any browser.

Creating Question Packs

Folder Structure

root/
โ”œโ”€โ”€ round1/
โ”‚   โ”œโ”€โ”€ Topic1 - 100/
โ”‚   โ”‚   โ”œโ”€โ”€ audio.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ image1.jpg
โ”‚   โ”‚   โ””โ”€โ”€ image2.jpg
โ”‚   โ”œโ”€โ”€ Cat in a Bag - 200/
โ”‚   โ”‚   โ”œโ”€โ”€ special.txt
โ”‚   โ”‚   โ”œโ”€โ”€ audio.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ question.txt
โ”‚   โ”‚   โ””โ”€โ”€ answer.txt
โ”‚   โ””โ”€โ”€ ...
โ””โ”€โ”€ round2/
    โ””โ”€โ”€ ...

Important:

  • Question folder name must contain the score in points (e.g., Topic1 - 100, Cat in a Bag - 200)
  • Round name is the first-level folder name
  • Category name is extracted from the question folder name (part before -)

Question Types

1. Mashup

Definition: Audio file + 2+ images, without question.txt

File structure:

Topic - 100/
โ”œโ”€โ”€ audio.mp3 (or .wav, .ogg, .m4a)
โ”œโ”€โ”€ image1.jpg (first image - music part of mashup)
โ””โ”€โ”€ image2.jpg (second image - text part of mashup)

Features:

  • Players must guess two parts of the track
  • Images gradually open (parts of the track)
  • Answer (mashup name) is shown at the end

Answer: Specified in answer.txt or taken from audio file name


2. Audio Question

Definition: Audio file + question.txt + answer.txt

File structure:

Topic - 100/
โ”œโ”€โ”€ audio.mp3 (or .wav, .ogg, .m4a)
โ”œโ”€โ”€ question.txt (question text)
โ””โ”€โ”€ answer.txt (answer text)

Additional media (exact file names):

For questions:

  • questionImage.jpg (or .png, .jpeg, .webp) - image for question
  • questionVideo.mp4 (or .webm, .avi, .mov) - video for question
  • questionAudio.mp3 (or .wav, .ogg, .m4a) - additional audio for question

For answers (hidden until "Show Answer" is pressed):

  • answerImage.jpg (or .png, .jpeg, .webp) - image for answer
  • answerVideo.mp4 (or .webm, .avi, .mov) - video for answer
  • answerAudio.mp3 (or .wav, .ogg, .m4a) - audio for answer

โš ๏ธ Important: File names must be exactly as specified above (case matters). Extensions can differ within the specified formats.

Example with media:

Topic - 100/
โ”œโ”€โ”€ audio.mp3
โ”œโ”€โ”€ question.txt
โ”œโ”€โ”€ questionImage.jpg (image for question)
โ”œโ”€โ”€ answer.txt
โ””โ”€โ”€ answerVideo.mp4 (video with answer)

3. Video Question

Definition: Video file + question.txt + answer.txt

File structure:

Topic - 100/
โ”œโ”€โ”€ video.mp4 (or .webm, .avi, .mov)
โ”œโ”€โ”€ question.txt (question text)
โ””โ”€โ”€ answer.txt (answer text)

Additional media (exact file names):

For questions:

  • questionImage.jpg (or .png, .jpeg, .webp) - image for question
  • questionVideo.mp4 (or .webm, .avi, .mov) - additional video for question
  • questionAudio.mp3 (or .wav, .ogg, .m4a) - audio for question

For answers:

  • answerImage.jpg (or .png, .jpeg, .webp) - image for answer
  • answerVideo.mp4 (or .webm, .avi, .mov) - video for answer
  • answerAudio.mp3 (or .wav, .ogg, .m4a) - audio for answer

โš ๏ธ Important: File names must be exactly as specified above (case matters). Extensions can differ within the specified formats.

Example with media:

Topic - 100/
โ”œโ”€โ”€ video.mp4
โ”œโ”€โ”€ question.txt
โ”œโ”€โ”€ answer.txt
โ””โ”€โ”€ answerImage.jpg (image with answer)

4. Text Question

Definition: question.txt + answer.txt, without audio/video files

File structure:

Topic - 100/
โ”œโ”€โ”€ question.txt (question text)
โ””โ”€โ”€ answer.txt (answer text)

Additional media (exact file names):

For questions:

  • questionImage.jpg (or .png, .jpeg, .webp) - image for question (recommended!)
  • questionVideo.mp4 (or .webm, .avi, .mov) - video for question
  • questionAudio.mp3 (or .wav, .ogg, .m4a) - audio for question

For answers:

  • answerImage.jpg (or .png, .jpeg, .webp) - image for answer
  • answerVideo.mp4 (or .webm, .avi, .mov) - video for answer
  • answerAudio.mp3 (or .wav, .ogg, .m4a) - audio for answer

โš ๏ธ Important: File names must be exactly as specified above (case matters). Extensions can differ within the specified formats.

Example with media:

Topic - 100/
โ”œโ”€โ”€ question.txt
โ”œโ”€โ”€ questionImage.jpg (image for question)
โ”œโ”€โ”€ answer.txt
โ””โ”€โ”€ answerImage.jpg (image with answer)

Special Cards

Create a special.txt file in the question folder to create a special card.

special.txt format:

cat
Special card description
Can be multiple lines

Special card types:

  • cat - Cat in a Bag
  • bet - Bet
  • auction - Auction
  • special - Special

Example:

Cat in a Bag - 300/
โ”œโ”€โ”€ special.txt
โ”œโ”€โ”€ audio.mp3
โ”œโ”€โ”€ question.txt
โ””โ”€โ”€ answer.txt

special.txt content:

cat
This question can be passed to another team (description of what you want to show players on the cat in a bag screen)

Media in Answers

Important: For all question types (audio, video, text), you can add media to answers. Answer media is hidden on the player screen until the "Show Answer" button is pressed in the admin panel.

Display priority: Image > Video > Audio


Complete Example Pack Structure

๐Ÿ“ฆ Example pack: Example Question Pack - a ready-made example pack structure with various question types and special cards.

MyGamePack/
โ”œโ”€โ”€ Round 1 - Music/
โ”‚   โ”œโ”€โ”€ Pop - 100/                    # Audio question
โ”‚   โ”‚   โ”œโ”€โ”€ audio.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ question.txt
โ”‚   โ”‚   โ”œโ”€โ”€ questionImage.jpg
โ”‚   โ”‚   โ”œโ”€โ”€ answer.txt
โ”‚   โ”‚   โ””โ”€โ”€ answerImage.jpg          
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Pop - 200/                    # Mashup question
โ”‚   โ”‚   โ”œโ”€โ”€ audio.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ image1.jpg                # First image (music)
โ”‚   โ”‚   โ”œโ”€โ”€ image2.jpg                # Second image (text)
โ”‚   โ”‚   โ””โ”€โ”€ answer.txt
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Pop - 300/                    # Audio question with video in answer
โ”‚   โ”‚   โ”œโ”€โ”€ audio.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ question.txt
โ”‚   โ”‚   โ”œโ”€โ”€ answer.txt
โ”‚   โ”‚   โ””โ”€โ”€ answerVideo.mp4          
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Pop - 400/                    # Audio question with audio in answer
โ”‚   โ”‚   โ”œโ”€โ”€ audio.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ question.txt
โ”‚   โ”‚   โ”œโ”€โ”€ answer.txt
โ”‚   โ”‚   โ””โ”€โ”€ answerAudio.mp3          
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Pop - 500/                   
โ”‚   โ”œโ”€โ”€ Rock - 100/
โ”‚   โ”œโ”€โ”€ Rock - 200/
โ”‚   โ”œโ”€โ”€ Rock - 300/                    # Cat in a Bag (special: cat)
โ”‚   โ”‚   โ”œโ”€โ”€ special.txt               # Contains: "cat\nDescription of cat in a bag round"
โ”‚   โ”‚   โ”œโ”€โ”€ audio.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ question.txt
โ”‚   โ”‚   โ””โ”€โ”€ answer.txt
โ”‚   โ”œโ”€โ”€ Rock - 400/
โ”‚   โ””โ”€โ”€ Rock - 500/
โ”œโ”€โ”€ Round 2 - Video/
โ”‚   โ”œโ”€โ”€ Movies - 100/                 # Simple Video question
โ”‚   โ”‚   โ”œโ”€โ”€ video.mp4
โ”‚   โ”‚   โ”œโ”€โ”€ question.txt
โ”‚   โ”‚   โ””โ”€โ”€ answer.txt
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Movies - 200/                 # Video question with media
โ”‚   โ”‚   โ”œโ”€โ”€ video.mp4
โ”‚   โ”‚   โ”œโ”€โ”€ question.txt
โ”‚   โ”‚   โ”œโ”€โ”€ questionImage.jpg
โ”‚   โ”‚   โ”œโ”€โ”€ answer.txt
โ”‚   โ”‚   โ””โ”€โ”€ answerVideo.mp4
โ”‚   โ”œโ”€โ”€ Movies - 300/                 
โ”‚   โ”œโ”€โ”€ Movies - 400/
โ”‚   โ”œโ”€โ”€ Movies - 500/
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ TV Shows - 100/
โ”‚   โ”‚
โ”‚   ...
โ”‚   โ””โ”€โ”€ TV Shows - 500/
โ”‚
โ””โ”€โ”€ Round 3 - Text/
    โ”œโ”€โ”€ History - 100/                # Simple Text question
    โ”‚   โ”œโ”€โ”€ question.txt
    โ”‚   โ””โ”€โ”€ answer.txt
    โ”‚
    โ”œโ”€โ”€ History - 200/                # Text question with image
    โ”‚   โ”œโ”€โ”€ question.txt
    โ”‚   โ”œโ”€โ”€ questionImage.jpg         # Image in question
    โ”‚   โ”œโ”€โ”€ answer.txt
    โ”‚   โ””โ”€โ”€ answerImage.jpg           # Image in answer
    ....

Folder structure:

  • Round name = first-level folder (Round 1 - Music)
  • Category name = part of question folder name before - (Pop, Rock, History)
  • Score = number after - (100, 200, 300, 400, 500)

Recommendations

File sizes:

  • Try to optimize media files for fast loading
  • Recommended image size: up to 2MB
  • Recommended video size: up to 50MB

Text files:

  • Use UTF-8 encoding
  • Line breaks are supported
  • HTML tags can be used (carefully!)

License

MIT

Full license text is available in the LICENSE file.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Web selfhosted SIGame for offline parties

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors