detecting if the player has a power cut?

Started by
15 comments, last by BCullis 13 years, 8 months ago
no because if its a shutdown and reboot and then rejoin the stats wont be saved , its only if there was any unexpected closure , which is unfare to the player...
:)
Advertisement
... Honestly it may not be 'fair' but that is just part of online gaming. or gaming in general actually.

Let's say Im the main tank in my raid in WoW and we are fighting Rag in Molten Core. Everyone knows if I DC then its a wipe and we have to start over when i reconnect or find another main tank in guild if I cant get back online ( i know outdated WOW example) . But its part of being a online player you learn to live with it and if you cant you dont play games for long online.

Lets go to single player.

Ill go with StarCraft 2 this time. Your on the last infested base at havens fall and your power goes out. you didn't save ONCE because you thought you were either that good or you didnt think about it. Well you either lose everything or are reverted to the last autosave the game did for you. there is no way to get it back and it sucks but it is part of life.

So its something you will have to find a good system for ... if your server saves every few minutes then lost time is less impacting because it was prolly only 2-3 minutes ago that the server saved your data. that may be the way you want to go if you want to help the people that lost power the most.

Eric Ranaldi a.k.a RanBlade


[size=1]"Passion is what drives you to stay up until 4am fixing that bug that hardly anyone would notice...


[size=1]Passion is where great games come from, if you dont live and breathe games you shouldn't be in the games industry."


[size=2]- Dave Pottinger, Ensemble Studios



[size=1][GameDev][C++ Page][Unity Game Engine][Panda3D Game Engine][NeHe Productions][Drunken Hyena][MSDN][Beej's Guide to Network Programming]


[size=1][FreedBSD][My Site][Gamasutra][Khan Acadamey]

Quote:Original post by CodeMunkie
Quote:because it might not of been a network problem as every programmer seems to think with games these days...

Not sure what you mean there. From the server's point of view, there is no way to reliably determine why the client disconnected or that there is any sort of network problem. The only thing you know for sure is that they are no longer connected. Period. It is dangerous to rely on the client to tell you "why" they disconnected and then use this information to affect game state or scores or other information that the server would normally have authoritative control over. No matter how complex the scheme you can devise, the end result is that you are creating a way to bypass rules normally enforced by the server. Someone will find a way to exploit it. Of course, the amount of effort to put into this depends on how much you really care about people being able to cheat.

Well you can't have multiplayer games if you can't trust the client for anything. Even the key presses could be faked! Might as well stop making games, someone will find a way to exploit them.
Quote:Original post by Anddos
no because if its a shutdown and reboot and then rejoin the stats wont be saved , its only if there was any unexpected closure , which is unfare to the player...


It is impossible to determine if the player computer was turned off, the game client crashed, their network cord was unplugged, their ISP connection dropped, or a UFO attack destroyed the internet cables between the game server and the client.

Impossible. Period. You. Can. Not. Do. It. All the game server can know is that the client connection was disconnected. So the solution to your problem is simple. In addition to saving the state when the user selects the option to log-off / disconnect from the server, you also save the state when the server detects that the connection has been dropped.

Quote:Well you can't have multiplayer games if you can't trust the client for anything. Even the key presses could be faked! Might as well stop making games, someone will find a way to exploit them.


Sure, key presses can be faked. But the user has the ability to press keys. Thus, you can trust the client for key presses. The point CodeMunkie was making is you don't trust the client for any information that should be determined by the server. You don't trust the client for where the player is located. You don't trust the client for if they hit or missed another player/monster. You don't trust the client for how much gold they have or what items they found. You trust the client for actions that the user directly chooses to take in the game. And the server then puts those actions into affect. You do trust the client for choosing to walk forward. Or choosing to fire their gun. Or choosing to cast fireball.
Quote:Original post by CaspianB
Sure, key presses can be faked. But the user has the ability to press keys. Thus, you can trust the client for key presses. The point CodeMunkie was making is you don't trust the client for any information that should be determined by the server. You don't trust the client for where the player is located. You don't trust the client for if they hit or missed another player/monster. You don't trust the client for how much gold they have or what items they found. You trust the client for actions that the user directly chooses to take in the game. And the server then puts those actions into affect. You do trust the client for choosing to walk forward. Or choosing to fire their gun. Or choosing to cast fireball.

Sorry I don't follow you point. Why can you trust the client for key presses? Because player can press those keys? Well then you can trust the client for power loss because player can pull the plug. You can still have bots running around your game if you trust key presses. It's just balancing with trust, there's no clear rules there. It's always a risk when you trust the client for something, but is the risk serious or not? You might take the risk to make the experience better for player, reduce lag or reduce server load.

If you can detect a power outage on the client side then I say it's a risk worth taking. But that's just my opinion. The game maker has to decide.
While I completely agree that you can't trust a player, I'm curious to hear the opinions of those against OP's idea. I haven't devoted a lot of thought to the idea, but I fail to immediately see how it could be beneficial to the player if the game state is saved at the moment of disconnect. I could see it exploited the other way around; if the player didn't like what just happened to their game, they could "pull-the-plug" and start over. Under OP's feature, pulling the plug would seal their fate.

EDIT:

"I fail to immediately see how it would be beneficial for the player to exploit the game, when the state is saved at disconnect."

That'll teach me to post when I'm half asleep.

Oh, and I didn't mean this post to be a challenge. I'm just genuinely curious to hear how those apposed feel it could be exploited. I'm sure it could be exploited in a way that benefits the player, I just fail to see one, this late at night. :p

[Edited by - AverageMidget on August 20, 2010 3:46:29 AM]
Quote:Original post by Drathis
Sorry I don't follow you point. Why can you trust the client for key presses? Because player can press those keys? Well then you can trust the client for power loss because player can pull the plug. You can still have bots running around your game if you trust key presses.


I think the point there was that player input still has to pass a "sanity check" on the server. Trusting influential data like player position or combat resolution opens the gates for all kinds of cheats as client-side software can and will be tinkered with. That's where speed hacks, wall hacks, inventory hacks and so on are born. "Trusting" a keypress just means you can blindly accept "Player has pressed 1 on their keyboard" as it merely asks the server to perform the action bound to 1 if allowed/possible/sane. If my character is dead, and 1 was bound to "Massive Deathblow VII", the server still has authority to reject the action.

Bots are just glorified macros, and can't do anything a player couldn't already do (aside from stay awake for a week straight). There are different measures against that though if it's a serious enough concern.

For the OP: what do you think your game stands to gain by trying to catch power loss? All kinds of online games allow for a certain timeout from the player: I know there were plenty of times where my WoW client crashed to desktop in the early days and I logged back in quick enough that I continued right along with my party in whatever dungeon we were currently exploring.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

This topic is closed to new replies.

Advertisement