Skip to content

This is the client side of the game Wolvesville that I'm trying to reproduce

Notifications You must be signed in to change notification settings

DylanP97/next-wolvesville

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

251 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿบ Next Wolvesville

A real-time multiplayer social deduction game inspired by Wolvesville, built with Next.js and Socket.IO. This is the client-side application.

Next.js React Socket.IO Tailwind CSS

๐ŸŽฎ About The Game

Next Wolvesville is a modern web implementation of the classic Werewolves game. Players are assigned secret roles and must work together (or against each other) to achieve their team's victory conditions. The game features real-time communication, multiple roles with unique abilities, and an immersive day/night cycle.

Note: This repository contains the frontend/client-side of the application. The backend server handles game logic, WebSocket connections, and player management.

Key Features

  • ๐ŸŒ Real-time Multiplayer - Powered by WebSockets for instant gameplay
  • ๐ŸŽญ Multiple Roles - Classic Werewolf, Seer, Doctor, Jailer, and more
  • ๐Ÿ’ฌ In-game Chat - General, Wolves, and Jail chat rooms
  • ๐Ÿค– AI Players - CPU-controlled players to fill empty slots
  • ๐ŸŒ Internationalization - English and French language support
  • ๐ŸŽจ Custom Avatars - Personalize your character with DiceBear avatars
  • ๐ŸŽต Audio Effects - Immersive sound design with volume controls
  • ๐Ÿ“ฑ Responsive Design - Play on desktop, tablet, or mobile
  • ๐ŸŒ“ Day/Night Cycle - Dynamic gameplay phases with voting and actions

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18.x or higher
  • npm or yarn package manager

Installation

  1. Clone the repository
git clone https://github.com/DylanP97/next-wolvesville.git
cd next-wolvesville
  1. Install dependencies
npm install
# or
yarn install
  1. Set up environment variables
# Create a .env file in the root directory
# Add your backend server URL
NEXT_PUBLIC_SERVER_URL=your_backend_server_url
  1. Important: Make sure your backend server is running before starting the client

  2. Run the development server

npm run dev
# or
yarn dev
  1. Open http://localhost:3000 in your browser

Important: This is only the client application. You need to have the backend server running for the game to function properly. First-time server connection may take up to 50 seconds.

๐ŸŽฏ How to Play

Game Modes

  1. Quick Game - Solo play with random role assignment
  2. Create Room - Set up a custom game with specific roles and player count
  3. Join Room - Browse and join existing lobbies

Game Phases

  • ๐ŸŒ‘ Commencement Night - Players receive their roles
  • โ˜€๏ธ Daytime - Players discuss and share information
  • โœ‰๏ธ Vote Time - Village votes to eliminate a player
  • ๐ŸŒ’ Nighttime - Special roles perform their abilities
  • ๐ŸŒ’ Night Results - Night actions are revealed

Roles

The game features various roles including:

  • ๐Ÿบ Werewolves - Eliminate villagers at night
  • ๐Ÿ‘๏ธ Seer - Discovers player identities
  • ๐Ÿ‘ฉโ€โš•๏ธ Doctor/Witch - Protects or heals players
  • ๐Ÿ‘ฎโ€โ™‚๏ธ Jailer - Arrests and interrogates players
  • ๐Ÿ”ซ Gunner - Can shoot during the day
  • ๐Ÿคก Fool - Wins if voted out by the village
  • And many more...

๐Ÿ› ๏ธ Built With

Frontend

  • Next.js 14 - React framework with App Router
  • React 18 - UI library
  • Tailwind CSS - Utility-first CSS framework
  • NextUI - Beautiful React component library
  • Lucide React - Icon library
  • React Lottie - Animation library
  • React Confetti - Celebration effects

Backend & Real-time

  • Socket.IO Client - Real-time bidirectional communication with the server
  • WebSocket - Real-time connection to backend server

Backend Repository: The server-side application is hosted separately and handles game logic, room management, and WebSocket connections.

Internationalization

  • i18next - Translation framework
  • react-i18next - React bindings for i18next

Avatar System

  • DiceBear - Avatar generation library

Development Tools

  • TypeScript - Type safety
  • ESLint - Code linting
  • PostCSS - CSS processing

๐Ÿ“ Project Structure

next-wolvesville/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ components/          # Reusable UI components
โ”‚   โ”œโ”€โ”€ connexion/          # Authentication pages
โ”‚   โ”œโ”€โ”€ create-room/        # Room creation flow
โ”‚   โ”œโ”€โ”€ game/               # Game interface and logic
โ”‚   โ”œโ”€โ”€ general-btns/       # Common button components
โ”‚   โ”œโ”€โ”€ homepage/           # Home page components
โ”‚   โ”œโ”€โ”€ join-room/          # Room joining interface
โ”‚   โ”œโ”€โ”€ lib/                # Utility functions
โ”‚   โ”œโ”€โ”€ profile/            # User profile pages
โ”‚   โ”œโ”€โ”€ providers/          # React context providers
โ”‚   โ”œโ”€โ”€ layout.js           # Root layout
โ”‚   โ”œโ”€โ”€ page.js             # Home page
โ”‚   โ””โ”€โ”€ globals.css         # Global styles
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ animations/         # Lottie animation files
โ”‚   โ”œโ”€โ”€ audio/              # Sound effects
โ”‚   โ”œโ”€โ”€ game/               # Game assets
โ”‚   โ””โ”€โ”€ locals.json         # Translation files
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ next.config.js
โ”œโ”€โ”€ tailwind.config.js
โ””โ”€โ”€ README.md

๐ŸŽจ Features in Detail

Room Creation

  • Customize game settings
  • Select specific roles for the game
  • Choose between real players and AI
  • Set preferred roles for players

Chat System

  • General Chat - All players communicate
  • Wolves Chat - Night discussion for werewolves
  • Jail Chat - Private conversation between jailer and prisoner

Avatar Customization

  • Body, head, clothes, and accessories
  • Multiple color options
  • Facial features customization
  • Persistent across sessions

Internationalization

  • Full English and French translations
  • Automatic language detection
  • Easy language switching
  • Localized game messages and UI

๐Ÿ”ง Configuration

Environment Variables

Create a .env file in the root directory:

# Backend server URL
NEXT_PUBLIC_SERVER_URL=http://localhost:3001
# or your deployed backend URL

Note: The client connects to a separate backend server via Socket.IO. Make sure the backend is accessible at the URL you configure.

Socket.IO Configuration

This application uses Socket.IO Client to connect to the backend server. The connection is established automatically when the app loads, connecting to the server URL specified in your environment variables.

๐Ÿ“ Scripts

# Development
npm run dev        # Start development server

# Production
npm run build      # Build for production
npm run start      # Start production server

# Code Quality
npm run lint       # Run ESLint

๐Ÿ› Known Issues & Future Improvements

Current Status (as of May 28, 2024)

  • Some role actions need fixes
  • Enhanced role selection for all players (currently only room creator)

Planned Features

  • Improved matchmaking system
  • Additional game roles
  • Enhanced AI player behavior
  • Tournament mode
  • Player statistics and rankings
  • Spectator mode

๐Ÿค Contributing

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

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is a personal implementation inspired by the game Wolvesville. Please check Wolvesville's official website for the original game.

๐Ÿ‘จโ€๐Ÿ’ป Author

DylanP97

๐Ÿ™ Acknowledgments

  • Inspired by Wolvesville
  • Thanks to all contributors and players
  • Built with modern web technologies

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue if your problem isn't already listed
  3. For general questions, feel free to reach out

Note: For the best experience, play in full-screen mode! ๐ŸŽฎ

Made with โค๏ธ by DylanP97

About

This is the client side of the game Wolvesville that I'm trying to reproduce

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •