Thank you Paul.

----- Original Message ----- 
From: "Paul Peloski"
To: <jed>; "Discussion of Half-Life Programming" 
<hlcoders@list.valvesoftware.com>
Sent: Monday, March 31, 2008 5:17 PM
Subject: Re: [hlcoders] Best advice/tips for MP weapons?


> Some tips for MP weapons:
>
> Should be mostly shared code. Most work that is done on the server should 
> be
> done on the client as well, anything that is called out of ItemPostFrame
> especially (PrimaryAttack, SecondaryAttack, Reload, WeaponIdle, etc) needs
> to be very similar if not identical on the client and server.
>
> When writing shared code that needs a random number use RandomSeed(
> CBaseEntity::GetPredictionRandomSeed() & 255 ) before generating the 
> random
> numbers. This will try to ensure the same random numbers are generated on
> both sides.
>
> Use CREATE_PREDICTED_ENTITY to spawn projectiles on both the client and
> server side, this will predict the spawn of the projectile and hook it 
> back
> up to the server version when that gets networked down. TF2 weapons are
> using this, most likely. There is not a good example in the SDK or HL2MP.
>
> If I think of any more tips I'll reply again
>
> Regards,
>
> Paul
>
> On Sun, Mar 30, 2008 at 2:48 PM, Jed <[EMAIL PROTECTED]> wrote:
>
>> I've just spend a week stepping through and trying to nail bugs with
>> weapons in my MP mod. There were some inherent problems and I found
>> quite a lot of recommendations and possible  fixes going back through
>> the mailing list archive.
>>
>> The main issues my weapons seemed to come from the fact I was using
>> the HL2MP code and deriving my new weapons from that. While in most
>> cases they function, in a "real life" server scenario there were lag,
>> etc. plays a part odd behaviour creeps in.
>>
>> I took a look at the "raw" SDK code vs. the HL2MP code and noticed
>> quite a few differences. Both ultimately, derive from
>> CBaseCombatWeapon but the SDK weapon uses more specific client/server
>> seperation of code than the HL2MP weapons.
>>
>> So I was wondering if anyone would be willing to share what they
>> consider is "best practices" for weapon coding for a MP Source mod?
>> Things like what sort of things should be handled server side, what
>> should be handled client, tips on getting around problems with lag,
>> prediction, etc?
>>
>> Would be interesting to see what solutions people have come up with.
>>
>> - Jed
>>


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

Reply via email to