--------------------------------------------
Attempting to better explain my situation
--------------------------------------------
How would i go about coding projectile weapons in a top-down shooter?
I am simulating the client 100ms behind the server time.
Therefore to perform a standard instant (raycast) shot, i send a 'bullet-fired' message to the server. The server receives this, works out when the delay on the message (100+Round-Packet-Trip Time). The server then looks back into saved history data to the correct time, locates the player positions at that time, and raycasts from the position the player was when the client fired the bullet to the position of the player (also when the client fired the bullet) being checked for collision (the player being shot at).
However, difficulties arise when i try to code projectiles.
I will list the options i have thought of here
Option A (Which i have implented at the moment):
The server recieves the fired bullet message and stores the delay in a variable.
This bullet is fired immeadiatly server side.
Everytime i check for collision, the players are moved back to their position at the "Current Time - Bullet Delay" and collision is checked for as normal.
This works fine, but there is currently no bullet simulation client side.
and i am not sure how to implement it effectivly.
To do this i think i would have to send a "bullet fired" message to each client, containing the bullet position and angle that will be present when the message is recieved by that particular client. I would also have to delay the message to arrive after 0.1s so as to get an accurate simulation.
However this would cause a delay on the client that fired the bullet of approx 0.1s as bullet simulation would not begin immeadiatly.
Option B:
Begin simulating the bullet after 0.1s (the view delay) client-side and fast-forwarding the bullet to its position when it is recieved by the server. This is then fast forwarded again to the time it will be at when recieved by other clients and sent to these clients. The problem with this, is that there will be a seemingly big jump when the other clients recived the bullet message. It will appear n units infront of where it started. Although this will have a 0.1s time period in which to work due to the view delay.
Option C:
Your idea here?
At the moment Option B is looking the best idea...
Let me know if you have an ideas!
Thanks
------------
Old Post
------------
Okay, i am creating a multiplayer shooter type game.
I have based my game so far on this article which is very helpful and informative.
http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
I have everything inside the article working, interpolation, prediction (needs improving), lag compensation and everything. The problem is i intend to use slowish projectile based weapons. These are not described in the article and i am stumped as to how i would implement them.
My client(s) are rendering the data 0.1s behind the server time so if i clicked to fire a shot, it would either have to be delayed, or be shown incorrectly on the client side.
I assume i would also have to log the positions of the projectiles as well as the players as i need to check if the projectiles collide with each other too.
Any ideas would be very welcome. This multiplayer stuff confuses me.
Thanks a lot, let me know if anything is unclear, i'm not good at explaining things