Posted By: ShoreVietam
Different attempts on multiplayer weapon firing - 06/20/11 07:24
Good morning fellas,
at the moment I'm creating some stuff for reworking my old little game "Modern Armor" (watch on YouTube) but again I come over the all-time-question:
How do I do weapon firing wihtin the multiplayer system.
Well actually there are different attempts to do this. At least I got 2 in mind that make sense for me:
1. Clients send fire-triggers to the server (until now I prefered this one)
2. Clients do calculations for them selves
Both have pros and cons, which I'd like to explain in a short description.
1. Letting the server do the work
Pros:
- bullets/rockets/whatever fly and hit where all the objects actually are, thus you cant hit someone hiding behind a wall, while you still see him running to the wall
- hits can be distributed immediately
Cons:
- Due to latency the objects actually are not there, where the clints still see them, so they may aim propperly, but still miss the target
- until the server gets the shot data and creates the bullet, the firing client will notice a delay of a few frames, until his click takes action... very ugly since you see it every shot
2. letting the clients do the work
Pros:
- the client can aim and hit how he sees the world, not how the server sees the world
- no delay until a shot has been "confirmed"
Cons:
- when only animating the shots/rockets after a trigger like "player 1 is frigin, create a dummy rocket to show it!" they most propably won't fly exactly where player 1 fired them to on his computer. Thus the other player may be hit, while he sees the rocket fly by and wonder why.
- hits can't be shared to the hit player as fast as directly from the server
I'd like to try the second one fpr this time, but I'm not quite sure how it will turn out. So I'd like to ask you if you got some experience with this kind of problem or if there is a different way that I don't see.
Thanks in advance!
ShoreVietam
at the moment I'm creating some stuff for reworking my old little game "Modern Armor" (watch on YouTube) but again I come over the all-time-question:
How do I do weapon firing wihtin the multiplayer system.
Well actually there are different attempts to do this. At least I got 2 in mind that make sense for me:
1. Clients send fire-triggers to the server (until now I prefered this one)
2. Clients do calculations for them selves
Both have pros and cons, which I'd like to explain in a short description.
1. Letting the server do the work
Pros:
- bullets/rockets/whatever fly and hit where all the objects actually are, thus you cant hit someone hiding behind a wall, while you still see him running to the wall
- hits can be distributed immediately
Cons:
- Due to latency the objects actually are not there, where the clints still see them, so they may aim propperly, but still miss the target
- until the server gets the shot data and creates the bullet, the firing client will notice a delay of a few frames, until his click takes action... very ugly since you see it every shot
2. letting the clients do the work
Pros:
- the client can aim and hit how he sees the world, not how the server sees the world
- no delay until a shot has been "confirmed"
Cons:
- when only animating the shots/rockets after a trigger like "player 1 is frigin, create a dummy rocket to show it!" they most propably won't fly exactly where player 1 fired them to on his computer. Thus the other player may be hit, while he sees the rocket fly by and wonder why.
- hits can't be shared to the hit player as fast as directly from the server
I'd like to try the second one fpr this time, but I'm not quite sure how it will turn out. So I'd like to ask you if you got some experience with this kind of problem or if there is a different way that I don't see.
Thanks in advance!
ShoreVietam