realtime multiplayer damage managment between client
I just tried an attackerAuthority sistem = if i see i hit you, you take damage even if you was lagging and you don't see it.
temp dev URL:
http://game.pydge.com:6002
Edit: sometimes a black canvas appear, I still have to do some controls in order to load all. just retype url with port, http://game.pydge.com:6002
If you want to prevent cheating, or provide a more fair system in the face of a lagging client, you'll need to stop trusting clients and use client/server with some form of latency compensation.
Moving to Multiplayer and Network Programming.
Have you read our Multiplayer and Network Programming Forum FAQ? There is a lot of good advice there, but in relation to your post question 12, "What should I put in my network packets, and how often should I send them?" is probably the most relevant.
For the best "feeling" in gameplay, make it so that, when I shoot at you, and I hit you on my screen, have my client send an "I hit" message to the server. This will make the game feel un-laggy to players. Unfortunately, it will also open up the game to cheating, if the game is successful enough that someone will want to cheat. Also unfortunately, if anti-cheat is a real goal of yours, the solutions are significantly more complex (and CPU expensive, server-side.)
My suggestion is to go with client-side messages for now, and if the game becomes popular and cheating becomes a problem, implement an update that re-does all of the simulation to be server-side and start combating cheating. 99% of the time, the game never gets that problem, so don't solve it unless you have to :-)
Thanks a lot for all your replys,
I keep saved all players coordinates so I was thinking about adding a simple control server side: when a collision happens i can send its coordinates and then compare them to the server ones. Here i can solve the problem if i'm lagging, i see you stopped, client side my code in running and i kill you.
Another control i can simple add server side could be when i save players coordinates. I can compare the new one with the old one and test if player speed can really do this movement.
I'm gonna read the post rip-off linked me, seems i looked for the wrong key words
About REAL hacking.. yes, i don't care about it too much right now. if the game gets popular i'll have to take some changes For now.. it's just a lag control.
Thanks a lot! =D