2
\$\begingroup\$

So, I have reached another problem while trying to implement my client-server communication. From everything I've read there are three main ways to minimize packet size:

  1. Only send what has changed to the client (Delta Compression)
  2. Only send what gameobjects are relevant to the client (Relevancy)
  3. With large packets, zip/compress them (L4Z?) [Not key for this question]

I have already implemented a delta compression scheme throughout my codebase using dirty bits and some interfaces. It's not as easy to use as I'd like, but it is decent and it works. Now I need to figure out how to add relevancy. I can certainly determine relevancy for each GameObject, but keeping track of all these deltas and which client has received them I think could get inefficient and complicated.

I considered having Players keep a NetworkComponent that tried to keep track of sending and maintaining what hasn't been sent, but I feel that could get complicated.

Advice on how to implement or improve either of these?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

My solution has been to combine both 1 and 2 into a "watching me list" on each object. When adding a client to an object's list, it sends a full state packet. Then on each update, it can send a delta compressed packet. When the object is no longer relevant to a client, simply remove it from the list and possibly send a "forget me packet" so the client knows it will not be receiving packets on this object anymore.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .