Take a look at dlls\player_resource.cpp and cl_dll\c_playerresource.cpp.
It has arrays of per-player data that get periodically updated. You
could add player X and Y coordinates here so you'd have minimap
coordinates.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Spk Spk
Sent: Friday, May 20, 2005 11:56 AM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Networking Minimap entities

Hello,

I'm currently implementing a minimap that is similar to Starcraft (it
shows the whole map). The "graphical" part of it is done already, and Im
now working on displaying some of my game entities (such as players and
structures) on it from the client side, of course.

The problem Im facing is that a client only knows about entities in its
PVS, and therefore doesn't know if his team has built structures at the
other side of the map. Making my structures and player entities to
broadcast their current state to all clients all the time is out of
question.

So after thinking a bit about it, I figured I just needed to know 2 or 3
properties of these game elements to display them correctly on the
minimap (ie the structures team index, world position and type, and the
players team
+ position).

Now the question is: what's the best/most optimal way of communicating
these information from the server to the clients, keeping in mind that I
don't want blue team players to receive information about red team's
structures, and vice-versa?

So far I see two possible ways of doing this: using a "TeamData" entity
set to always transmit to clients on a specific team, or UserMessages. I
think the "networked entity" way is the best one, but I'm still not sure
if it's possible to send composite data structures over the network.
Ideally, I'd like my TeamData object to hold a vector of "playerData_t"
and a vector of "structureData_t", which would be defined that way:

struct playerData_t
{
    Vector pos;
    int team;
};

struct structureData_t
{
   Vector pos;
   int team;
   int type;
};

But from the look of it, it seems I can only send base data types such
as int/floats usnig the SDK's networking system. Can anyone give me some
pointers on how to achieve what I want to do in a not-too-painful way
(ie not implementing a different array for each entity property like it
is done in PlayerResources for the connected clients' pings/kills/etc).

Thanks in advance!
Spk
- Nuclear Dawn



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


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

Reply via email to