Jump to content
  • Advertisement
Sign in to follow this  
Giulioni Lorenzo

realtime multiplayer damage managment between client

This topic is 1090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all, i'm making a realtime multiplayer game using phaser, node and socket.io.
 
i managed movements clients side and then emitting to server client coordinates, serve then save them and broadcast to all clients.
Now i have toimplement damage between players.. i was thinking about "hit and be hitted" emit from both clients then server can compare timestamps of emits and validate the attack if both send the message...
 
Do anyone already approached the problem? I read many guides but all talking about "thory" and i can't find nothing concrete...
 
Any tip is welcome!!! :D
 
link dev test: login(bypassed)->play

Share this post


Link to post
Share on other sites
Advertisement
Trusting clients, as you are doing, is one of the easiest solutions and a good place to start.

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.

Share this post


Link to post
Share on other sites

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 :-)

Share this post


Link to post
Share on other sites

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 biggrin.png

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 smile.png For now.. it's just a lag control.

Thanks a lot! =D

Edited by Zaraustra

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!