- Client sends inputs, keys pressed (commands) to server (prefer: UDP but care about reliability)
- Each UDP packet contains new commands and replicates previous commands (so, even if some packets are lost, the server should be able to process all the client commands)
- Client sends inputs with a timestamp (to calculate latency)
- Server acknowledges client about received commands so client can remove them from the buffer
- Client-Side Prediction: Client predicts the game state based on the commands it sends to the server. So client can move or take an action instantly!
- Received game state confirms that the client predicted it correctly. But if client made miss-prediction, it's state will be corrected and user may see that!
- Server calculates game state(whole world state (snapshot) should be sent in 1 UDP packet: use delta compression) and sends it to all clients (prefer: UDP)
- Because everything inside 1 UDP packet there is no problem with packet loss
- Client interpolate between snapshots to smooth movement (minimum 2 snapshots are needed to interpolate)
- Server has current (present) state! But clients see previous (past) state!
- Server has a Snapshot Buffer to store latest snapshots (0ms, 50ms, 100ms, 150ms, 200ms, 250ms) in order to improve Hit detection accuracy! For example: User hits an object in frame 42. Server takes 2 latest snapshots (0ms, 50ms) and make same as client interpolation to frame 42 and process a hit detection at that frame! So user can hit the target which they actually see.
- Game Server
- Middleware Communication Server
- Game Client
- On server game should have collision object without sprites
- https://forum.defold.com/t/dmengine-headless-all-flags-list/73914/3
- Also, it’s also probably likely that you want to use a bundled game, in which case there are no loose file, but a few archives (.arcd, .arci)
- And for content, I would probably scale down all textures to e.g. 2x2 size.
- All in all, I would use a separate .settings file (same format as game.project) to setup the server settings (you can specify the server.collection as the bootstrap there):
java -jar bob.jar clean build --archive bundle --settings headless.settings --bo bundle_headless
- Python Websockets SSL with Lets Encrypt
- How to use Nginx as a Reverse proxy for HTTPS and WSS - Self Signed Certificates and Trusted Certificates
- NGINX as a WebSocket Proxy
./install.sh # python dependencies
./run.sh # webtransport_server.py
- https://github.com/GoogleChrome/samples/blob/gh-pages/webtransport/webtransport_server.py
- aiortc/aioquic#237
- Using WebTransport
- ERR_METHOD_NOT_SUPPORTED, Opening handshake failed.
python3.10 -m venv venv # set virtual environment
python3.10 -m pip freeze > requirements.txt # manage dependencies versions
python3.10 -m pip install aioquic
python3.10 -m pip install websockets
python3.10 webtransport_server.py # run
- Install Python3 in Ubuntu Docker
- Docker fails to install cffi with python:3.9-alpine in Dockerfile
- Docker can't find Python venv executable
- Install pip in docker
- aioquic examples
- How to Set Up a Virtual Environment in Python – And Why It's Useful
- asyncio.get_event_loop(): DeprecationWarning: There is no current event loop
- socket.error:[errno 99] cannot assign requested address and namespace in python
docker-compose --env-file .env.local up --build -d # build and start Dockers
docker-compose --env-file .env.local up -d # start Dockers without rebuild
docker-compose --env-file .env.local down # stop Dockers
- Best practices for writing Dockerfiles
- Exposing Container Ports in Docker
- Networking in Compose
- ubuntu docker image
- Multiplayer server: Nakama
- Find (and kill) process locking port 3000 on Mac
- How to kill a process running on particular port in Linux?
- How to kill a process on a port on ubuntu
- How to find the path of a file on Mac
- mkcert is a simple tool for making locally-trusted development certificates
- localhost-ssl-certificate.md
- https://github.com/GoogleChrome/samples
- Photon Cloud Documentation: Realtime Intro
- YouTube: Bringing you tutorials covering C#, Unity3D, and Photon SDK(Чел пишет фреймворк на PhotonServer)
- YouTube: В подкасте "Как делают игры" про сервера
- Простым языком об HTTP
- Как работает реляционная БД
- Архитектура сервера онлайн-игры на примере Skyforge
- Базы данных в онлайн-играх. От Аллодов Онлайн до Skyforge
- Статьи Михаила на Хабре про сетевой код
- YouTube: Как устроен сетевой код в играх | Неткод, мультиплеер, геймдев | Podlodka Podcast #377
- Source Multiplayer Networking
- Server In-game Protocol Design and Optimization: Footnotes
- GitHub: A Curated List of Multiplayer Game Network Programming Resources
- YouTube Playlist: Rollback Netcode in Godot
- Fast-Paced Multiplayer (Part I): Client-Server Game Architecture
- Fast-Paced Multiplayer (Part II): Client-Side Prediction and Server Reconciliation
- Gaffer On Games
- Доклад про мультиплеер от Destiny
- Доклад про latency в Call of Duty
- YouTube: GDC Networking Scripted Weapons and Abilities in Overwatch
- YouTube: Overwatch Netcode 60Hz Test Results & More!
- YouTube: Replay Technology in Overwatch: Kill Cam, Gameplay, and Highlights
- YouTube: Networking Scripted Weapons and Abilities in Overwatch
- interpolation and extrapolation on the client to smooth movement
- Client-side prediction
- https://en.wikipedia.org/wiki/Quake_(video_game)#QuakeWorld
- 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond
- YouTube: Миллион пользователей онлайн в World of Tanks с инженерной точки зрения
- YouTube Playlist: Dedicated Multiplayer
- YouTube: Add Multiplayer to your Godot Game!
- YouTube: Export and Run a Godot Dedicated Server
- YouTube: Godot Multiplayer Lag Compensation with Netfox
- GitHub: Netfox Addons for building multiplayer games with Godot
- GitHub: A Simple Godot 4 Online Multiplayer FPS Prototype
- Multiplayer in Godot 4.0: Scene Replication