ppetr / tremulous-gpp-mods

My Tremulous GPP mods.
Other
3 stars 2 forks source link

Optimize network traffic for rooms full of buildings #39

Open ppetr opened 11 years ago

ppetr commented 11 years ago

As described here in Redman's post, the engine sends only information about entities that could possibly interact with the client. This causes network lags when crossing room boundaries.

What could help? Sending simply all buildings? Maybe it'd work, because buildings rarely change, so the traffic could be very low. Maybe OM/RC down could cause a single massive lag then.

ghost commented 11 years ago

I think there isn't that much lag. But sending all buildings could work. Although worried about hackers seeing too much this way.

ppetr commented 11 years ago

If someone (wall)hacks then it's no point playing with him anyway, needs to be kicked.

I realized that when sending all buildings there could be a problem with rets. A single alien jumping over a human base makes many rets turn, and this could again create a lot of network traffic when sending all turning rets to all players. But IMHO it's still going to be less than sending 100 new entities when entering a room.

(This problem depends on how fast is your connection. If your connection can accommodate the sudden data burst then you might not notice it. But on a limited connection you usually die before you receive all the data.)

ghost commented 11 years ago

Perhaps a priority model? Using a drain event or likewise in C++? Things that aren't near you are slowly sent to you, after the high priority (stuff near you) data is sent.

Another possibility is this: Send the location of all entities in a room, but only update state information (What direction etc) if you are in the room or near it.