Advertisement

hmm.. bullets, in shooters

Started by July 29, 2003 06:52 PM
0 comments, last by -Fruz- 21 years, 6 months ago
how would i actually handle "bullets", or, what are the best ways. do i treat every bullet as an object, and send coordinates, or would i skip the bullet totally, and just do bullet-hits. hmm.. or maybe just send the angle, and draw a line? hmm... this is really for a top down shooter, but, i figured it would be done similarly in any shooter. ? JFK
Depending upon the bullet types, this would determine how u would handle them.

For fps, they let the client spawn the bullets locally, but if the packet never reaches the server it wont count.

So spawn the bullet locally on the client, send off the request fire packet ( direction, pos, velocity, time ). the server should check the values for validity with the clients actually position etc.. to prevent cheating.

For slow moving bullets, a single packet describing its pos,dir,velocity, and spawn time ( synchonized time beteween client and server ) will adequately describe the bullet in full.

For beams, fast bullets, multi bullets, a more descriptive packet might be needed.

On the recving client side, you will proablly need to extrapalate where the bullet will be at the recived time, based upon its intrensic data ( pos,dir,velocity etc..)

Bullet hit calculations are done on both client and server side, but only the server side counts. The client side is for show.

Good Luck

-ddn

This topic is closed to new replies.

Advertisement