0

How to save a progress of a game made in c++

like to resume to a leftover game

24th Jan 2018, 9:32 AM
Sehgal Aditya
Sehgal Aditya - avatar
4 Answers
+ 3
it depends on the complexity of the game, but you should essentially save the current values of all the relevant variables to a file (you can go for the easy solution and create a dictionary like in xml :p), and write a function to insert all those values back into the program when you 'load' your previous play in the game.
24th Jan 2018, 12:54 PM
Cfir
+ 1
A simple text/ json is indeed simple solution. But user can cheat by edit this file. I think that adding a signature that authenticate that the data was written by the program is nice to have feature.
29th Jan 2018, 5:08 PM
DBZ
DBZ - avatar
0
but how
24th Jan 2018, 9:44 AM
Sehgal Aditya
Sehgal Aditya - avatar
0
json makes things easier here... take a look at some github c++ json parser (i have written one too...)
24th Jan 2018, 10:05 AM
---
--- - avatar