-
|
|
pseudo-persistent world, how to calculate time?
|
Hi, I was thinking of a possible game where the time goes by regardless of whether the player is playing or not (think about all these online strategy/economy simulators like ogame and such) Would there be a way to prevent people cheating by just changing their console's clock? Something like an external time server.
Is there currently any way to achieve this?
Thanks!
|
|
-
|
|
Re: pseudo-persistent world, how to calculate time?
|
Your options may be different depending on whether you are developing for Windows or X-Box 360, but I know that for Windows you have a number of options. It depends on what sort of architecture you want for your game. Is that state of the game to be maintained on a server on the Internet or on the local client? If the state of the game is maintained on a server, then all you have to do is make sure that no one can tamper with the server's time, and perhaps set up the server's clock to synchronize with external Network Time Protocol (NTP) servers on the Internet. If the state of the game is to be maintained on each client, with each client having their own separate, isolated simulation, then you could either develop or find your own NTP client software to include in your game to check time on a public NTP server, or you could set up your own web server(s) to serve the time to clients via a web page or XML web service. Choosing to use public NTP servers might not be a good option if your game became popular with a lot of clients putting a lot of load on these public servers. Also, you would have no control over the reliability of the NTP servers (as far as their availability and reachability to clients). If you want to prevent cheating by altering the time on the client, your only option would be to prohibit the game from being played when a time server is not available.
|
|
-
-
- (15312)
-
premium membership
MVP
-
Posts
8,514
|
Re: pseudo-persistent world, how to calculate time?
|
Since you mention "console" instead of PC, I'm guessing you want to do this on the 360. You'd have to run a 360 as a type of server. The players would connect to it when they start their game and get the time from that. There's not really any other way. Google "XNA high score component" for an idea on how to do this. It wouldn't work exactly the same way, but the idea is similar.
Jim Perry - Microsoft XNA MVP If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job. Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki. Please mark posts as Answers or Good Feedback when appropriate.
|
|
-
|
|
Re: pseudo-persistent world, how to calculate time?
|
Thanks for your replies!
I realized that when signed in to xbox live (which is a prerequisite for playing indie games, correct?), users don't have control over their system clock. I thought I could just use that. There would still be a possibility for the player to exploit time zone changes but preventing the abuse of it seems fairly easy (record the initial time zone in the saved game and allow only for a limited number of changes over short periods of time)
This is not for a multiplayer game, single player only, xbox360.
What are your thoughts?
Thank you for helping me out!
|
|
-
-
- (858)
-
premium membership
-
Posts
521
|
Re: pseudo-persistent world, how to calculate time?
|
The question is "does it really matter?"
Since the game is only single player, then who does cheating affect? Only the person that cheats. They cheat themselves out of gameplay (or maybe they enhance gameplay depending on the game and what they look to get out of games).
If it was a multiplayer competative game, then there might be some concern for cheating. A high number of cheating players can ruin online gameplay (and therefore, your game's reputation). But if someone wants to cheat in a single player game and then try to brag about getting the high score... more power to them. Ultimately, if someone really wants to cheat, no amount of protection is going to stop them.
|
|
-
-
- (393)
-
premium membership
-
Posts
109
|
Re: pseudo-persistent world, how to calculate time?
|
Don't mess with time zones, just store UTC time and convert on display (if you need to).
My thoughts are, why do you care if people cheat in a single player game?
Even if they can move forward time by screwing with their system clock or time zone, who cares? It's not worth the effort to secure your game against cheating (multiplayer cheating is a different story). Only the most interested fan would even attempt to cheat anyways. You should be happy the player enjoys your game to bother cheating in the first place.
Plus time spend protecting against cheaters would be better spent on bug fixing and improving overall game quality anyways.
|
|
-
|
|
Re: pseudo-persistent world, how to calculate time?
|
Thanks guys, your comments make a lot of sense game-design wise and I of course agree.
Let's suppose we keep this discussion technical, though. Is the system time a reliable "time reference" for systems connected to xbox live?
|
|
-
-
- (393)
-
premium membership
-
Posts
109
|
Re: pseudo-persistent world, how to calculate time?
|
The Xbox's system clock can be set by the user. So no, it's not a reliable absolute time reference.
I can "cheat" by setting it to just about any time I want.
|
|
-
|
|
Re: pseudo-persistent world, how to calculate time?
|
fr3shme4t:The Xbox's system clock can be set by the user. So no, it's not a reliable absolute time reference.
I can "cheat" by setting it to just about any time I want.
I'm not sure how you'd do that. I just tried it. While not connected to xbox live, I could set the time freely, but as soon as I signed in to xbox live, the time got reset to the real one. That plus the fact that you must be signed in to xbox live to play indie games make me think that it is reliable.
What am I missing?
|
|
|