mas-bandwidth / yojimbo

A network library for client/server games written in C++
BSD 3-Clause "New" or "Revised" License
2.45k stars 238 forks source link

Intended use of client messages #178

Closed kingoftheconnors closed 2 years ago

kingoftheconnors commented 2 years ago

I'm somewhat confused by the USAGE example. It perfectly describes how messages are sent, but I'm lost on what best-practices are for using the library.

My naive implementation is to make each client authoritative over itself, but as mentioned in GafferOnGames Article, that's bad form.

So what IS encouraged form for a client-server game? What paradigm is Yojimbo made for?

gafferongames commented 2 years ago

Yojimbo is the answer to the question, what would the correct network stack for Apex Legends be?

gafferongames commented 2 years ago

Client -> server messages should be control messages. Not stuff like 'I fired my gun' ;)

kingoftheconnors commented 2 years ago

@gafferongames Thank you for responding! I've been reading your articles, and that confirms what I saw in your tutorial on Deterministic Lockstep. Does Yojimbo have a Playout Delay Buffer internally, or do I have to put that together myself?

gafferongames commented 2 years ago

Yojimbo is just a library for you to define channels for communication, serialization for messages etc. It doesn't force you to any particular network model, although it has been designed with the needs of AAA games. You need to implement a playout delay buffer yourself.

kingoftheconnors commented 2 years ago

Awesome. Thank you so much!