Sign in to follow this  

Is Real-Time Energy Fill Available Only To Online Games?

This topic is 2845 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, I am designing a game and I wanted to know the following: In a lot of online game e.g. Most of Facebook games like Zynga's Mafia Wars, the energy fills in real-time. Could this feature be done in an offline game or the game needs to be online? Thank you, GamerGamer

Share this post


Link to post
Share on other sites
Filling energy bars has nothing to do with the online or offline status of the game, unless you're making an online game and your client needs to ask the server how full the bar is.

Share this post


Link to post
Share on other sites
Quote:
Original post by BLiTZWiNG
Filling energy bars has nothing to do with the online or offline status of the game, unless you're making an online game and your client needs to ask the server how full the bar is.


So, you can have a real-time counter that increases let's say your energy bar by 1 after 5 real-time minutes in an offline game even if you don't access it?

Share this post


Link to post
Share on other sites
Quote:
Original post by gamergamer
Quote:
Original post by BLiTZWiNG
Filling energy bars has nothing to do with the online or offline status of the game, unless you're making an online game and your client needs to ask the server how full the bar is.


So, you can have a real-time counter that increases let's say your energy bar by 1 after 5 real-time minutes in an offline game even if you don't access it?
Are you talking about (e.g.) shutting down the game, then starting it up again 5 minutes later and having one more health unit than you did previously?

Share this post


Link to post
Share on other sites
Not really, unless you're running some kind of server 24/7. But you can do a trick which will make the program's behaviour appear to the user as if it was running and doing something during the time when it actually wasn't:

Each time when the program is shut down, you write the current time to a file. Then, when the program is started again, you read this file and compare the recorded shutdown time with the current time. This will tell you how long the program was "offline" and allows you to compute and apply the changes that should have happened in between (like your energy increase).

Share this post


Link to post
Share on other sites
Quote:
Original post by wurstbrot
Each time when the program is shut down, you write the current time to a file. Then, when the program is started again, you read this file and compare the recorded shutdown time with the current time. This will tell you how long the program was "offline" and allows you to compute and apply the changes that should have happened in between (like your energy increase).
You probably want to take some precautions if you go this route, to prevent the user from setting their clock forward an hour to gain more resources.

Share this post


Link to post
Share on other sites
That was my next question...How to avoid the cheat with the clock.
I would also like to add that I am designing the game for the iPhone platform. Not sure if this changes things though....

Share this post


Link to post
Share on other sites
Quote:
Original post by Sudi
since the iphone probably comes with a internet flat you can get the current time from a timeserver.

here are some
http://www.helmut.hullen.de/filebox/DCF77/ntpsrvr.html


Share this post


Link to post
Share on other sites
Quote:
Original post by Sudi
since the iphone probably comes with a internet flat you can get the current time from a timeserver.

here are some
http://www.helmut.hullen.de/filebox/DCF77/ntpsrvr.html


Thank you Sudi, but if the device (iPhone,iPod,iPad) is not connected to the internet when the player launches the game then the player's Energy bar would remain unaffected right?

Share this post


Link to post
Share on other sites
well if the server can't be reached you would use the system. which could be modified by the user but then again total cheat protection is not possible in singleplayer-offline games

Share this post


Link to post
Share on other sites
Quote:
Original post by Sudi
well if the server can't be reached you would use the system. which could be modified by the user but then again total cheat protection is not possible in singleplayer-offline games


Got it. Thank you all for your widom.

GamerGamer

Share this post


Link to post
Share on other sites
For ordinary users, just the fact of it being an iPhone game makes it harder to cheat - it's not like you can just browse a file system, find the save file and open it up in a hex (or text) editor. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Zahlman
For ordinary users, just the fact of it being an iPhone game makes it harder to cheat - it's not like you can just browse a file system, find the save file and open it up in a hex (or text) editor. :)


Hi Zahlman,
The fact that the energy progress is marked by the device's time and the fact that very very easy can every user change the time cancels the idea...unfortunately...:(

Share this post


Link to post
Share on other sites
Quote:
Original post by gamergamer
The fact that the energy progress is marked by the device's time and the fact that very very easy can every user change the time cancels the idea...unfortunately...:(


Why?

The application will not be only filling the bar. Everything in the simulation will be based on this time.

On shutdown, store the last application time.
When the application starts:
- load the old time
- while (old_time < current_time) advance(1 minute)

This handles everything, including the bar.

If user increments time by cheating, they will not be able to cheat their way of inactivity over a period of one hour.


Then, do what this type of games did long ago (X-Com was one of them) - offer the "fastest simulation speed until event occurs" option. So if someone needs to wait for some bar to fill up, let them. But, if something happens in between that requires their attention, fall back to regular speed.

This way, if they do cheat, they'll also skip all the important events they would have handled if game were running legally, or they'll need to "catch up" by playing regularly, regardless of how long ahead they cheated.


And if they roll back the time, they'll probably break something else, especially if you also store some other history that is linked to this timer.

Such system can also be implemented as a transaction log - record all important events, replay them when application starts. Then cheating becomes next to impossible without completely breaking the state in unpredictable ways.

Share this post


Link to post
Share on other sites
Quote:
Original post by Rilbur
Antheus, the point is that the energy bar would fill up with real time. I. e. you can only make so many moves per hour.
That doesn't make sense in a single player game. Just keep time while the game is running. Delta between frames can't be messed with.

Don't assume a changed clock is cheating. People cane change their clocks all the time for legit reasons. Syncing with a time server, daylight savings time, changing time zones, dead battery, etc...

Share this post


Link to post
Share on other sites
Quote:
Original post by Daaark
Quote:
Original post by Rilbur
Antheus, the point is that the energy bar would fill up with real time. I. e. you can only make so many moves per hour.
That doesn't make sense in a single player game. Just keep time while the game is running. Delta between frames can't be messed with.

Don't assume a changed clock is cheating. People cane change their clocks all the time for legit reasons. Syncing with a time server, daylight savings time, changing time zones, dead battery, etc...


Well, you're right. People can change the clock for legit reasons but in this case they will be translated to an anomaly in the Real-time Energy refill.

I am trying to avoid the mmo concept to avoid costs, production complexity and more "difficult" for an indie company factors. I am trying to insert the microtransactions in the design hence this thread and Energy refill is an important "product" for sale in freemium games. I'll tweak the design to avoid the real-time Energy idea...

Thank you very much for your comments you have been very helpful.

GamerGamer

Share this post


Link to post
Share on other sites
Like others have said store the date/time at shutdown, then when the game starts check if the time saved is either past or future.

If the stored time is in the past add to the energy bar, if it is in the future put the energy into the negative. Sure you might have the small time errors when syncing the time but it wont be a great deal.

Share this post


Link to post
Share on other sites
Quote:
Original post by MathewS
Like others have said store the date/time at shutdown, then when the game starts check if the time saved is either past or future.

If the stored time is in the past add to the energy bar, if it is in the future put the energy into the negative. Sure you might have the small time errors when syncing the time but it wont be a great deal.


I believe you are right.

Thank you very much all for your posts

GamerGamer

Share this post


Link to post
Share on other sites
Quote:
Original post by gamergamer
I am trying to avoid the mmo concept to avoid costs, production complexity and more "difficult" for an indie company factors.


Hosted service costs ~$100 a month. That service is under your control and can handle thousands, even ten thousands of concurrent users for purpose of transactions and time checking. If you only charge $1 per month, you only need 1% conversion rate to cover this.

Quote:
I am trying to insert the microtransactions in the design
Then you need to be online anyway.

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
Quote:
Original post by gamergamer
I am trying to avoid the mmo concept to avoid costs, production complexity and more "difficult" for an indie company factors.


Hosted service costs ~$100 a month. That service is under your control and can handle thousands, even ten thousands of concurrent users for purpose of transactions and time checking. If you only charge $1 per month, you only need 1% conversion rate to cover this.

Quote:
I am trying to insert the microtransactions in the design
Then you need to be online anyway.


Thank you for your reply Antheus. Do you know any hosting company that you or someone you know worked with and is reliable?

Share this post


Link to post
Share on other sites

This topic is 2845 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this