Add 'ideas/realtimenetworking.md'

This commit is contained in:
bvisness 2022-05-09 22:27:50 +00:00
parent 8716ba5555
commit 88a4a5d385
1 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,77 @@
## Structure
All references to "ass" in the following are courtesy of StrangeZak.
### Prereqs
- TCP/UDP
- Packets and ordering
- Sockets
- Port forwarding, firewalls - context for why you might do NAT punching
- hey ive heard of this thing called "web sockets"
- tcp over tcp, baby
- Blocking vs. non-blocking sockets
- Peer-to-peer / network topology
- why peer to peer is ass
- NAT punching: STUN/ICE/TURN
- Types of NATs (carrier-grade vs. normal)
- WebRTC
- UPNP (auto port forwarding) (possibly an aside?)
- security problems
- please do not
- Handshakes / authentication
### Games
- Code structuring for games
- the way every game handles you know replicating eneitites to other clients is very different so you have ot pick the one that you think is least ass
- they are all ass
- Prediction / rollback
- Older model: every input is sent to the server, server sends state to clients
- Newer model: local game is simulated independently, corrected by the server as it goes (prediction and rollback)
- How some games might do this
- Unreal: go over all connections, iterate all actors, see if actor is relevant, delta, bunch, send
- typical of big shooter games - you want to be able to control relevancy of data per connection (e.g. what is in view)
- Simple 2D game: send the whole state
- Server / client authority
- RPCs
### Audio / video streaming
- Packet framing (deltas / key frames / error correction)
- I, P, and B-frames (for video)
### Collaborative editing
- CRDTs...? Operational transforms?
## Possible applications of real-time networking
- Multiplayer games
- Collaborative editing
- Real-time communication (audio/video)
## Useful practice projects
These would all need to be written and vetted by the community. We're not going to find good examples of this lying around.
- Basic multiplayer game with rollback
- Online voice chat
- Figma-like?
## Links
- I, P, and B-frames: https://ottverse.com/i-p-b-frames-idr-keyframes-differences-usecases/
- https://discord.com/channels/239737791225790464/727209479602438265/973342326644703262
- Overwatch Gameplay Architecture and Netcode: https://www.youtube.com/watch?v=zrIY0eIyqmI
- Zak says: Best explanation of modern techniques by far. Ignore the game architecture part.
- https://www.deconstructconf.com/2019/ayla-myers-multiplayer-game-networking-the-brute-force-approach
- https://www.ggpo.net/
- Opus spec: https://datatracker.ietf.org/doc/html/rfc6716
-