Why not just have a server-client normal entity, and then a client only
entity. When the server-client entity sends in PostDataUpdate() that it is
being created tell it to create a new client only entity. For knowing when
the input function was called just have a variable that holds a value based
on what input function was called. And have it networked and in the
PostDataUpdate() to check what that number is and then to tell the client
only entity that so and so input function was called.

Chris

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Smith
Sent: Friday, September 19, 2008 3:37 PM
To: Discussion of Half-Life Programming
Subject: [hlcoders] Advice on Client/Server Entity Design?

Hey everyone - I've been spying on you all for a while now, but this is my
first time jumping in =)

I wanted to see if anyone had any advice on how to design/implement a sort
of unusual client/server entity. Here are the requirements:

All updates and logic for the entity must be handled per-frame on the
client. No problem. The entity may originate from the client (pure
client-side entity), or from an instance on the server (i.e. placed with
Hammer). So these hybrid entities still live primarily on the client, but
maintain a relationship with their server-side counterparts ONLY to receive
input.

For example, an entity might have some input function. The input could
change the state of the server entity, but this state change should not be
transmitted to existing clients, which may be off doing their own thing. All
that should be transmitted is that the input function was called (along with
its parameters), so the client can deal with them according to its own
state. These entities might be very different for each client, which is
fine, no sync needed.

NEW clients will then receive a copy of the entity that reflects its current
state on the server.

So: how might I transmit the full state only to clients where the entity
doesn't exist yet? Also, what's the recommended way to pass input (an event,
not a persistent state) from the server entity to the client entity?

I've found that FL_EDICT_DONTSEND causes (surprise!) the entity not to be
sent at all. So I assume I need to use FL_EDICT_FULLCHECK, and then decide
whether it's been sent to that client already. I guess I'm limited here to
the Edict state - is there enough info in there to do this reliably?

Thanks!

-Martin
_______________________________________________
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