Alfred Reynolds wrote:
Cstrike uses a separate message to send this information. Not all
players made be in your PVS so you don't know were everyone is.
AddToFullPack() is currently called num_players*num_map_entities per
frame, so adding anything extra in here is expensive (I am doing some
optimisation work right now to remove this bottleneck).

You could probably use a LOD (level of detail) type approach to optimizing the amount of data sent. On the server, keep an array of the previous position of each player. If a player has moved more than X units (where X comes from a forumla described further down) relative to this client, then send that player's position to that client. Most players won't be moving around very much and thus you don't need to keep sending the same redundant data over and over again.

The calculation for X will depend on how your radar works.  Most radar
systems will "clip" the player to the outer bounds of the radar (or just
not display their position at all) when that other player is too far
away from the client's position.  At this range, you don't need to
update the player's position as often because of the clipped location
(even if the player moves dramatically towards or away from the client,
the displayed radar position will not change, hence no need to send that
data again to the client).  If the other player is withing the radius of
the radar and not clipped, you would want to update the position more
rapidly for a more accurate representation of where that player actually
is in the world.  As other players get VERY close to the client, you may
want to update their position every frame so that people who are very
close together, get very accurate representations of each other's position.

--
Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to