#A better cloud save data approach for idle game time progression

1 messages · Page 1 of 1 (latest)

steel mountain
#

im now building planting system in my game, a very popular idle game element

lets say i plant a seed on one of the slot in 1:00pm , seed mature time will be measured in seconds, 120s (2min) , then it would be harvestable on 1:02pm

a field contain 5X12 slots (60) , i think i will do this

field -> hold networkobject + network transform
crop -> for visualization only, contains no networkobj nor networktransform

to prevent player tinkering the time i gonna use cloud save, maybe with cloud code

#

data ----> default gamedata (custom data):

  1. field slot ID : int32 , number ID , or in field[x].crop[y]
  2. crop ID : int32, number ID
  3. crop mature time : in DateTime , YYYY/MM/DD HH:MM:SS

i use full date time only because i planned to have plants that have more than 24hrs harvest time, so if someone plant something on 2025/12/31 12:00:00 , u will need years to prevent date errors , when harvest time will be 2026/1/1 12:00:00

no way i would ask server to sync time second by second, the request payload gonna stress the traffic

implementation:

  1. when player starts plantCrop() , store the data in local singleton manager and save a copy onto cloud save, matured time would be calculated locally using UTC local time

  2. by setup, player will load all existing crop data when theyre starting their own session

  3. wait until harvest time is up

#

im planning on 4 right now, but i guess it will be

  1. using cloud code to hook onto the harvest time on cloud save and send msg to player when time is up
#
  1. by the moment the harvest time is up, and cloud code is fired, the crop that expired should be removed from cloud save
#

how is it?

toxic crypt
steel mountain
#

ty, i think i do know what to do next , the example is slightly different but it is similar to what i planned above so i will make a little twist only on the calling part, then everything will be good to go

the example updates in game object only when player interacts with it, so its not passive, however i do want it to update itself automatically, because i planned to change the mesh of the plant once its harvestable (times up) . If environment only reacts when player interact with it, its kind of a visual error actually. so i will make a trade-off here

when i plant crops, or load data from cloud save on creating my session, i will get the time of when crops will be harvestable

i will store all those time into a list (distinct, only unique elements) , and call cloud code to validate -> read data from cloud save and update my plant data