Multiplayer game with 3D flights of airplanes over the city map.
Try a realtime multiplayer demo
The game consists of three different projects:
- Main Server is an authorization server that connects players with game servers. It must be only one.
- Game Server is a server for one game room. Player game interactions happen through this server. Many game servers can connect to the main server.
- Client is a client game application. In development, it's another server, on production – static files on the main server.
To set up the whole project, you need to configure their URLs with .env
config.
For example:
# To change main server
MAIN_SERVER_URL=http://localhost:3002
# To change game server
GAME_SERVER_URL=localhost:3001
You can also change other optional settings:
# To change city for the game server.
# It can be: nsk, tomsk, omsk, kemerovo, barnaul, krasnoyarsk.
CITY=nsk
# To start the game server as a tournament.
GAME_TYPE=tournament
# To change only ports
MAIN_SERVER_PORT=3002
GAME_SERVER_PORT=3001
# To change server for map tiles
TILE_SERVER_URL=trufi.art:8003
# To change game server secret word for admin commands
GAME_SERVER_CMD_SECRET=secret_word
npm install
npm run server
– to start main authorization server on 3002 portnpm run game
– to start game server on 3001 portnpm run dev
– to start client dev-server on 3000 port- Open http://localhost:3000
npm run build
– to build all projectsnpm run prod:main
– to start main authorization servernpm run prod:game
– to start game server
The game client has two modes:
- Player to play the game as a player.
- Observer to observe the game as a spectator. To enter the mode, you need to add
?observer
parameter to the URL, e.g., http://localhost:3000?observer.
To add bots flying around, you need:
- Change the game
serverUrl
insrc/bot/index.ts
file - Start a bot script
npm run bots
It was used in 2GIS stand at the CodeFest 2019 conference and developed by a small team of: