S
Sarron
Guest
Hi,
The issue I'm dealing with here is as follows:
I'm trying to develop a game wherein the world around you has a certain -- let's say "economic" -- state and I want to represent that on the player's HUD. The state involves many things including the number of various entities in a given area, etc.
So what I need is for my HUD elements to know about lots of different bits of info about the game world. However, looking at all the HUD elements in the SDK, it seems that the HUD usually just reads data about the player character (from a C_BasePlayer -derived entity/object).
So my question is this: Should I be making my own derivation of C_BasePlayer (or perhaps some subclass down the line from it) and having that class collect all the server-side data needed?
Then, when the HUD wants to know about the world state it simply queries the player character's object for the relevant data since I collected it all there on the server side.
The alternative seems to be some complicated (and large) set of messages that would have to be sent from the server to the client every time a resource change was recorded. This seems very inefficient...
Am I missing something about the architecture of Source here? Is there an easier way for client-side elements like HUD elements to query custom elements of the game state that I create and keep track of on the server side?
Thanks for the advice. =)
The issue I'm dealing with here is as follows:
I'm trying to develop a game wherein the world around you has a certain -- let's say "economic" -- state and I want to represent that on the player's HUD. The state involves many things including the number of various entities in a given area, etc.
So what I need is for my HUD elements to know about lots of different bits of info about the game world. However, looking at all the HUD elements in the SDK, it seems that the HUD usually just reads data about the player character (from a C_BasePlayer -derived entity/object).
So my question is this: Should I be making my own derivation of C_BasePlayer (or perhaps some subclass down the line from it) and having that class collect all the server-side data needed?
Then, when the HUD wants to know about the world state it simply queries the player character's object for the relevant data since I collected it all there on the server side.
The alternative seems to be some complicated (and large) set of messages that would have to be sent from the server to the client every time a resource change was recorded. This seems very inefficient...
Am I missing something about the architecture of Source here? Is there an easier way for client-side elements like HUD elements to query custom elements of the game state that I create and keep track of on the server side?
Thanks for the advice. =)