Handling rapid-fire weapons

Started by
1 comment, last by Peta 23 years, 10 months ago
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
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.)
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

This topic is closed to new replies.

Advertisement