Question about the Save System

0 favourites
  • 12 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • Hello everyone, I'm making a game and I'm going to make a save system. The game has many global variables, the values of these variables change frequently. I would like to make a system that would save all changes in these variables. I would also like to save the player's position on the map. I would like the game to save automatically.

    Could you please help me, which is better for my game, Save & Load or Local Storage? What is the difference between these saving methods? Is it possible to use Save & Load to save changes to global variables or is it better to use Local Storage for this?

    Tagged:

  • Also in my game there are 40 different objects that can be destroyed. I would like to make sure that when one of these objects is destroyed, the game is saved, and the next time the game is started, this destroyed object will not exist.

  • Save and load yes.

  • Save and load yes.

    Thanks for the answer. This makes me happy because Save & Load seems easier to me than Local Storage. So, when the value of one of the variables changes, I can save it using Save & Load?

  • I think you'll have to use both methods.

    For example you load a level and use save to load all objects if they are not destroyed. Right after that it is better to load the main variables like gold, armor and damage of the hero and his level. Only then release the hero into the world.

    Why would you want to store important hero characteristics in local storage and load it after the world? Because your hero can change these parameters on other layouts, for example, entered a mech or dungeon and found something there or pumped.

    From my experience I will say that the save system is not visible to the player, but it is a very important and time-consuming step for the developer. I always use local storage and storage in arrays. When I add a new event or boss in the game I always understand how it will be stored, for example, regular respawn, then do not need to store or space in an array with the number of his kills.

  • > Save and load yes.

    Thanks for the answer. This makes me happy because Save & Load seems easier to me than Local Storage. So, when the value of one of the variables changes, I can save it using Save & Load?

    The save game will save the state of the game including all variables, like an old school save where I am and then load the game where I am, and this has always been fine for me. I may use local storage keys only for tracking for example you could determine if the user has saved before by saying 'does a local storage key exist'. Maybe local storage is used for saving and uploading data to servers though I've never tried it.

  • > > Save and load yes.

    >

    > Thanks for the answer. This makes me happy because Save & Load seems easier to me than Local Storage. So, when the value of one of the variables changes, I can save it using Save & Load?

    The save game will save the state of the game including all variables, like an old school save where I am and then load the game where I am, and this has always been fine for me. I may use local storage keys only for tracking for example you could determine if the user has saved before by saying 'does a local storage key exist'. Maybe local storage is used for saving and uploading data to servers though I've never tried it.

    Some variables in my game change very often, sometimes once a second. And I would like this data to be saved. Will using Save & Load affect performance? How often can I use this save without sacrificing performance?

  • I think you'll have to use both methods.

    For example you load a level and use save to load all objects if they are not destroyed. Right after that it is better to load the main variables like gold, armor and damage of the hero and his level. Only then release the hero into the world.

    Why would you want to store important hero characteristics in local storage and load it after the world? Because your hero can change these parameters on other layouts, for example, entered a mech or dungeon and found something there or pumped.

    From my experience I will say that the save system is not visible to the player, but it is a very important and time-consuming step for the developer. I always use local storage and storage in arrays. When I add a new event or boss in the game I always understand how it will be stored, for example, regular respawn, then do not need to store or space in an array with the number of his kills.

    Thank you for your answer. In my opinion, the Save & Load system seems simpler than Local Storage. But I'm afraid it might affect performance if I use this saving method too often. I would like the game to work well on weak mobile devices and browsers.

  • But I'm afraid it might affect performance if I use this saving method too often. I would like the game to work well on weak mobile devices and browsers.

    You should not apply saves to events such as every tick or just an event without a trigger (without a green arrow)

    The best time to save is when something changes in the world, like a player killed an enemy or got gold and you call the save function.

    If you are lazy to optimize so much, there is an option for the lazy you can save every 10 seconds or less often.

  • Some variables in my game change very often, sometimes once a second. And I would like this data to be saved. Will using Save & Load affect performance? How often can I use this save without sacrificing performance?

    I have tried this in my game and it does affect performance, I wouldn't save too often. You should design the game in a way where you can save in a more general way like at the start of a room rather than every time a variable changes.

  • > But I'm afraid it might affect performance if I use this saving method too often. I would like the game to work well on weak mobile devices and browsers.

    >

    You should not apply saves to events such as every tick or just an event without a trigger (without a green arrow)

    The best time to save is when something changes in the world, like a player killed an enemy or got gold and you call the save function.

    If you are lazy to optimize so much, there is an option for the lazy you can save every 10 seconds or less often.

    There are places in my game where the player receives coins every 0.3 seconds for 5 seconds. I would like the game to save every time a player receives a coin. But I think that I should somehow optimize this moment. Maybe I should save the game when the player gets all the coins, rather than just one at a time.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • >

    > Some variables in my game change very often, sometimes once a second. And I would like this data to be saved. Will using Save & Load affect performance? How often can I use this save without sacrificing performance?

    I have tried this in my game and it does affect performance, I wouldn't save too often. You should design the game in a way where you can save in a more general way like at the start of a room rather than every time a variable changes.

    Yes, it looks like I should find a way to save the game in a more general way.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)