Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Currently one of my games engines written for a shooter seems to work correctly.

Currently projectiles are sparse, travel quite slowly and are synced over network they are generated as entities.

But in the future I'll have weapons generating very large amounts of much faster projectiles. So here I wonder if generating a system dedicated to projectiles would be a better idea. I currently want to generate projectile pools to manage the syncing of short lived projectiles without limiting the projectiles count.

Physics and collisions are managed by a physics engine where I can register any type of objects (server and client side).

Is there a better approach to the problem?

share|improve this question
    
What do you mean by very large amounts of faster projectiles ? Is it a lot of small projectiles that are still visible and behave independently ? Or more like a gatling gun ? –  Thelvyn Dec 27 '12 at 15:29
    
I mean like scatter guns and gatling guns indeed. I think I might reduce the life time of each projectile based on distance to avoid the clutter but I don't want to design the game around this limit. –  Coyote Dec 28 '12 at 10:18
add comment

1 Answer

up vote 2 down vote accepted

To address things like scatter guns and gatling guns, usually you do not create projectiles. Instead you handle rays. Projectiles are not visible so you just add some fx on top of this to give the illusion of firing. Then you check intersections with the ray to detect collisions and spawn a hit effects at collision locations.

It has the benefit of being less sensitive to update rate. Moreover, adding a heat time before firing, for example the gatling gun that rotates before firing, allows to hide latency between client and server in a networked game allowing them to synchronize.

share|improve this answer
    
I agree with you about the rays. As the projectiles have a travel time I still wanted to sync a minimal amount of data over network. But storing the projectiles in a large array of rays does not prevent me from optimizing the updates. –  Coyote Aug 11 '13 at 7:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.