Title: Message
Techncially, a float is longer (natively, 4 bytes) or equal to (2 byte conversion in WRITE_FLOAT) than a word (2 bytes). If you want to use a percentage you could use a single byte or less (7 bits, actually, which represents 0-127. You can use less bits by sacrificing fidelity).
 
Is your HUD a numerical representation? For instance, in "The Opera" the action meter is not, so even though the server keeps it as a value from 0-100+, it's sent to the client as a value from 0-63 and scaled proportionally on the draw.
 
if it's a number you're displaying, is it really that much of an issue if it's a few digits off? I mean, if the max is 6000 I won't be all that tramatized at the difference between a difference of 50 points, for instance.
 

Tnx & Rgds...
David "Nighthawk" Flor ( [EMAIL PROTECTED] )
Lead Programmer, "The Opera" - http://opera.redeemedsoft.com/

"When Alexander saw the breadth of his domain he wept for there were no more worlds to conquer…"

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of omega
Sent: Wednesday, November 28, 2001 5:47 PM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Overflow problem

if its for displaying on the hud, you could also just send in a range of 0-1.0 for percentages.
 
ie: fValueToClient = armor / 6000;
 
and then on the client fArmor = fValueFromServer * 6000;
 
then you only need to send one float. and you wouldnt even _have_ to do it as a message. pack it into something that already gets sent to the client that isnt used (theres a LOT of things that are available in entvars_t/cl_entity_t to use, that are sent over but never filled)
 
 
-omega
Blackened Interactive
http://www.nofadz.com/blackened
----- Original Message -----
From: _Phantom_
Sent: Wednesday, November 28, 2001 1:32 PM
Subject: Re: [hlcoders] Overflow problem

I was thinking about doing the same idea from a different angle, instead of having values 0 -> 6000 on the client I was going to change it so the server uses 0 -> 6000 but the client only ever see a percentage of the total, so 3000 on the server would show 50% on the client. As long as the values compared are only whole percents this should slow the updates to the client enuff so that the over flow is gotten around.
 
As I was planing to use percentages on the client for display reasons anyways this should sort both things out at once.
 
----- Original Message -----
From: David Flor
Sent: Wednesday, November 28, 2001 4:31 PM
Subject: RE: [hlcoders] Overflow problem

You might want to consider making that variable part of the client data so that it's (1) bit packed, and (2) processed through normal channels.
 
For instance, in "The Opera" I made the action meter the same thing, but using bit packing and settings in "delta.lst" it's handled as only 6 bytes. I'm guessing the armor value doesn't need to be exact when it comes to the client, so you can lower the amount of bits it uses when sent. For instance, you can represent the value as 10 bits instead of the 14 bits it would normally require; inherently, that means the data would only be sent 1/16th of the time (my math might be wrong; it's early, OK?).
 
Am I making sense here?

Tnx & Rgds...
David Flor ( [EMAIL PROTECTED] )
Planning Group International
305-253-0100

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Cortex
Sent: Wednesday, November 28, 2001 10:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Overflow problem

try to use WRITE_SHORT instead of WRITE_WORDS.
 
--------------------------------------------------------
Cortex
HL Albator coder & mapper
www.hlalbator.fr.st
--------------------------------------------------------
----- Original Message -----
From: _Phantom_
Sent: Tuesday, November 27, 2001 11:38 PM
Subject: [hlcoders] Overflow problem

lo

For some reason we can't track down the current version of the code is
dropping clients out with the error :

SZ_GetSpace: overflow on netchan->message
WARNING: reliable overflow for <playername>

Now, I've done a global search for SZ__GetSpace, netchan, and 'WARNING ... '
for both client and server and can't find any referance to it.

The only thing I can possible think it's related to is the new armor value
we have been testing with, as it's currently set at 6000 (I change the
message sending health and armor about to send WORDS and not BYTES).

Anyone able to shead any light on this?
cheers
Rob

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

Reply via email to