Skip to content

Repository files navigation

Bataille

A risk like game, in TypeScript, revamped for quick bataille and fun.

https://bataille.ovh

Featuring

  • real time unit movements
  • turn by turn income (7s)
  • up to 6 players (will probably be increased when popularity will grow)
  • public in-game discussion
  • game time: 10-20min
  • optional passkey account (no password, no email) with a leaderboard; guests still play

Video gameplay

Game screenshots

Developers

Everything is build around Node & TypeScript, using Phaser4 for the game engine on the web (webgl) and socket.io for server-client communication.

Setup

Requires Node 26 (see .nvmrc).

  1. Copy .env.example to .env and fill:
    • VITE_SOCKET_URL=localhost:3001
    • SUMOLOGIC_COLLECTOR can stay blank (used to track number of games played)
    • TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID can stay blank; set both to get a Telegram ping when a player starts waiting in the lobby
    • WEBAUTHN_RP_ID and WEBAUTHN_ORIGIN default to localhost / http://localhost:3000; in production set them to the domain and origin the game page is served from (bataille.ovh / https://bataille.ovh). The Docker image carries no .env: set them in the hosting panel next to ADMIN_KEY
  2. npm i
  3. npm run start
  4. npm run start-server
  5. Open localhost:3000, local dev should work with one player, online require 2 players.

To run the server as the production image instead of npm run start-server, with the same .env:

docker compose -f dev.docker-compose.yml up --build

Issues :

  1. Unit moving crossing another allied troop merge, not idea if they are just on there way
  2. Display the path finding preview and selected cell
  3. Add unit test on the server loop and code
  4. Optimize server performance
  5. Very fun game! However, one thing that bothered me is that in the early game, where there is a massive amount of cities changing hands, the center of the screen tends to be filled. I suggest moving takeover notices that don't include you to a bottom corner, while keeping the ones that do involve you in the center.
  6. Don't display AI killing themself messages

About

A risk like game, in js, revamp for quick bataille and fun

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages