🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Client/Server: Weapons, who's the referee?

Started by
3 comments, last by anjee 23 years, 9 months ago
Hi, I''m working on a MPOG game like Subspace. At the moment I''m working on the (dead reckoned) weapons. I''ve got to decide who''s going to determine if a ship was hit, or not. There are three options: Client1, Who fired the torpedo Client2, The one that should be/is hit by the weapon Server, Knows all positions of the objects, but with many players might take to long to check all for collisions. The server can send ''hit'' messages but it would delay the game (I think) Client1 is the only one that knows the exact position of the torpedo, but not the exact position oc Client2 Client2 knows the exact position of himself, but not of the torpedo... Can someone please tell me what the best option is? Thanks in advance, Almar Joling http://www3.ewebcity.com/stqw
www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>
Advertisement
I think it depends on who your target gamers are. If you were just making a demo that most likely won''t be hacked, then your best choice is to let the client handle the hit check. If you want to be safe, then send out something like this

hit ship at 465 235 678

then the server checks if the point is within the ship. Something like that. Maybe ask a pro. I haven''t done much winsock yet

---------------------------
"Don't die for your country, make some other dumb bastard die for his" -General George S. Patton
Hmm, there are always people that try to hack into games, even if it only has a few players.

Your method could work, if the ''hit'' message reaches the server before that ship has moved.
So that still gives the same problem :o(

Btw, I''m using DirectPlay, although I''m probably going to switch to Winsock.
www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>
The best option, and the one used by subspace and its descendent i believe infantry is to let client 1 and 2 think they know where each other and the shots are, and let the shots interact as they normally would do, without any interference from the server. The server on the other hand does know where the players and the shots are and is the ultimate arbitarator of damage. So its possible that to client 1 the shots hit clinet 2 10x times but to the server client 2 dodged half of them. Player 1 expects player 2 to die, but he doesn''t. Truthfully this doesnt affect gameplay much anyways, in shooter games you just keep plugging away until one of you dies or runs out of ammo.

Good Luck

-ddn
Hmm, you could be right, but if the weapons aren''t ''fast firing''(assume one projectile per player, per 2 seconds.) the accurancy should be better.

If I''m right you mean like this:
Client1 shoots a torpedo. The message is send to the server which broadcasts it to all other players, including the ''from'' player.
Weapons are just handled by the *clients*, but the weapons are ''dead reckoned''by the ''owner''of the torpedo. If the torpedo gets to far out of ''sync''with the other players, the weapon is updated to all players again.

Maximum effiecency, with almost no bandwidth :o)

www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>

This topic is closed to new replies.

Advertisement