• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by spraw · Jan 16, 2014 at 04:20 PM · savingrestart gamegame saveover time

Let Game-Building finish over time / Gold increment over time

Hi!

You surely know these kind of games, where you build some building, and it takes - say - 12 hours and 30 minutes to build.

What is the best possible way of accomplishing that? Would I have to save the necessary vars into playerPrefs before the player leaves the game and reload them when he enters, then do some calculations based on that, or is there something way easier?

Bonus Question: My game is also Multiplayer with the help of Player.IO. I'd like to make this aspect of the game relatively hack proof. So I was thinking about using the Player.IO SQL Database, good/bad idea?

Coding in C#

Thanks!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lockstep · Jan 16, 2014 at 05:30 PM 0
Share

The easiest and also hackproof way to do this, is to work with the time of your server. When you start building, get the server time, add your 12 hours to it and save this as finish time. If this time is still ahead, let it print out "Buildin will finish in xx" or something. When it is past this time start your finish building routine. This is more hacksave since playerprefs and local time can be easily edited.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Flip over an object (smooth transition) 3 Answers

Why my variable increment at start ? 1 Answer

saving scenes as they are 0 Answers

Saving a Texture to the Project Folder 0 Answers

ArrayPrefs 2 (PlayerPrefs X) Question 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges