• Advertisement

Archived

This topic is now archived and is closed to further replies.

Handling rapid-fire weapons

This topic is 6434 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m currently playing around with a simple 2d network multiplayer game. Some form of client-side prediction is used on all of the entities on the screen (velocity is transmitted with position). Everything is going fine apart from handling rapid-fire weapons (like a nail gun) which produce a lot of shots in a limited time. My original plan was to spawn an entity for each individual shot and treat them like any other entity in the game. However, this seems like overkill and could cause some very large packets when the shots are fired and when they are destroyed. How do other people deal with things like nail guns? Peter

Share this post


Link to post
Share on other sites
Advertisement
Well this will actully be my first post in awhile(Im posting from work) But what you might want to do for something like a nailgun is group all the nails into one large shot.(Just find the width and hieght of the total barage and treat it as one large shot,that makes it only take one packet and also only one collison check.)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think the convential method is synchonize the start and end fire times for the nail gun. If the clients are synchonoized well enough then knowing the start fire and end fire of the nail gun will give you how many nails have been fired and where they are traveling and their relative distribution to each other. I think Infantry does this, as all their weapons are cyclic and dependent upon the entity position and facing. You dont need to synchonize the individual nail projectiles, just the user actions. You can reduce the need to synchonize projectile weapons if you use this method, it''s a great savings. However if the weapon was a tracking missile you''ll have to update it''s position and direction like you would the players.

Good Luck

-ddn

Share this post


Link to post
Share on other sites

  • Advertisement