Saving and loading game data
Moderator: PC Supremacists
Saving and loading game data
So saving and loading game data is somthing that rarely gets talked about, however its a vital part of game logic that for many big projects needs to be planned out carefully and I'm curiouse and thought it would be nice to get some peoples ideas on the approach people should take.
Looking at Ocarina Of Time for the Nintendo 64, the save data is fairly simple.
You can't exit the kokiri forest because the is a npc guarding the exit, however if you complete the deku tree's level then that npc will let you pass.
if you have completed the deku tree then npcs in the forest normally say somthing like
"I see you have a fairly at least, good for you"
And when you completed the deku tree they say stuff like
"What has happened to the deku tree?"
If you cheat your way past that npc guarding the exit to the forest you get the spritual stone of the forest and then when you go back in the npcs will say somthing diffrent
My theory is that the game only saves vital aspects such as
-What spirtual stones you have
-What sage coins you have
-What rupees you have
-What equipment you have
Every major level such as temples, dungeons, etc you recive somthing vital such as a stone, a sage coin, a piece of equipment.
Somtimes you need a special peice of equipment to enter the level after the level you recive this peice of equipment.
Like I said this area of game development dosen't often get viewed and I find these methods extremely clever since by saving such tiny amounts of game data you can predict exactly what distance into the game you are.
The reason I'm using The Legand Of Zelda as a example is because its so basic but effective.
Not all games function like zelda though so I'm very intrested in peoples ideas and opinions on how you would go about implementing this and handling this?
Looking at Ocarina Of Time for the Nintendo 64, the save data is fairly simple.
You can't exit the kokiri forest because the is a npc guarding the exit, however if you complete the deku tree's level then that npc will let you pass.
if you have completed the deku tree then npcs in the forest normally say somthing like
"I see you have a fairly at least, good for you"
And when you completed the deku tree they say stuff like
"What has happened to the deku tree?"
If you cheat your way past that npc guarding the exit to the forest you get the spritual stone of the forest and then when you go back in the npcs will say somthing diffrent
My theory is that the game only saves vital aspects such as
-What spirtual stones you have
-What sage coins you have
-What rupees you have
-What equipment you have
Every major level such as temples, dungeons, etc you recive somthing vital such as a stone, a sage coin, a piece of equipment.
Somtimes you need a special peice of equipment to enter the level after the level you recive this peice of equipment.
Like I said this area of game development dosen't often get viewed and I find these methods extremely clever since by saving such tiny amounts of game data you can predict exactly what distance into the game you are.
The reason I'm using The Legand Of Zelda as a example is because its so basic but effective.
Not all games function like zelda though so I'm very intrested in peoples ideas and opinions on how you would go about implementing this and handling this?
- Milch
- Chaos Rift Junior
- Posts: 241
- Joined: Sat Jul 11, 2009 5:55 am
- Programming Language of Choice: C++
- Location: Austria, Vienna
Re: Saving and loading game data
But as far as I know, they also save how far you progressed in a dungeon, are they?
I mean, if you exit the dungeon and enter it again, you don't have to redo it all over again.
I mean, if you exit the dungeon and enter it again, you don't have to redo it all over again.
Follow me on twitter!
-
- Chaos Rift Demigod
- Posts: 991
- Joined: Thu Nov 13, 2008 3:16 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Amiga, PSOne, NDS
- Programming Language of Choice: C++
- Location: Sweden
Re: Saving and loading game data
Final Fantasy VII is one of my favorite games and perhaps the one I've played the most, while playing it I often wondered how the save/load game data was structured. I can't speak for the way FF does this, but I /imagine/ the data includes a variable like worldState (storyProgress or what have you) that upon key plot events increases one by one. Now each area has a default state that works for the general worldState, beyond that the areas can act specifically on one or more ranges of values or simply single values, basicly, worldState controls the area's NPCs, their conversations, minor/major changes to the tilemap and things like that.
Re: Saving and loading game data
Well yes if you enter a dungeon and save the game then reload the game certin entities such as treasure chests and the web in the first level ( the deku tree ) but these are nessacary to save however basic enemies like the spiders that climb on walls respawn every time ( even if you just leave the room )Milch wrote:But as far as I know, they also save how far you progressed in a dungeon, are they?
I mean, if you exit the dungeon and enter it again, you don't have to redo it all over again.
So is defnitly more than the stat/equipment that gets saved but I didn't want to go too in depth about it as what I've said about it so far is threoretical.
I'm yet to play Final fantasy but I hear its a great game, I hope to play it sometimepritam wrote:Final Fantasy VII is one of my favorite games and perhaps the one I've played the most, while playing it I often wondered how the save/load game data was structured. I can't speak for the way FF does this, but I /imagine/ the data includes a variable like worldState (storyProgress or what have you) that upon key plot events increases one by one. Now each area has a default state that works for the general worldState, beyond that the areas can act specifically on one or more ranges of values or simply single values, basicly, worldState controls the area's NPCs, their conversations, minor/major changes to the tilemap and things like that.
- RyanPridgeon
- Chaos Rift Maniac
- Posts: 447
- Joined: Sun Sep 21, 2008 1:34 pm
- Current Project: "Triangle"
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C/C++
- Location: UK
- Contact:
Re: Saving and loading game data
I agree with Pritam. Everything that you talked about in your post about what the characters say, what equipment you have, are really all just saved as states somewhere. I would imagine the simplest way you could do it is just make a note of all the states that need to be saved, and just incorporate them into your saving/loading procedures.
I assume large, modern games have more elegant solutions, like SaveState, GetState or some other kinds of methods being included in all their game objects, as part of their program's structure. But that's just a guess. Still, it all just comes down to keeping track of the world and objects through their states.
I assume large, modern games have more elegant solutions, like SaveState, GetState or some other kinds of methods being included in all their game objects, as part of their program's structure. But that's just a guess. Still, it all just comes down to keeping track of the world and objects through their states.
Re: Saving and loading game data
Yeah but you have to admit its pretty clever how the game can calculate the exact distance into the game you are from such little informationRyanPridgeon wrote:I agree with Pritam. Everything that you talked about in your post about what the characters say, what equipment you have, are really all just saved as states somewhere. I would imagine the simplest way you could do it is just make a note of all the states that need to be saved, and just incorporate them into your saving/loading procedures.
I assume large, modern games have more elegant solutions, like SaveState, GetState or some other kinds of methods being included in all their game objects, as part of their program's structure. But that's just a guess. Still, it all just comes down to keeping track of the world and objects through their states.
-
- Chaos Rift Demigod
- Posts: 991
- Joined: Thu Nov 13, 2008 3:16 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Amiga, PSOne, NDS
- Programming Language of Choice: C++
- Location: Sweden
Re: Saving and loading game data
It's really simple actually if you know your engine/system, you could calculate the story progression from the amount of dialog text between key plot events for instance, dialog that is vital to key plot events. Or simply divide the worldState's number with the total amount of key events for an estimate.N64vSNES wrote:Yeah but you have to admit its pretty clever how the game can calculate the exact distance into the game you are from such little informationRyanPridgeon wrote:I agree with Pritam. Everything that you talked about in your post about what the characters say, what equipment you have, are really all just saved as states somewhere. I would imagine the simplest way you could do it is just make a note of all the states that need to be saved, and just incorporate them into your saving/loading procedures.
I assume large, modern games have more elegant solutions, like SaveState, GetState or some other kinds of methods being included in all their game objects, as part of their program's structure. But that's just a guess. Still, it all just comes down to keeping track of the world and objects through their states.
-
- Chaos Rift Cool Newbie
- Posts: 51
- Joined: Tue Dec 14, 2010 6:49 pm
- Favorite Gaming Platforms: PC
- Programming Language of Choice: Everything... and C#
- Location: dnXstudios
- Contact:
Re: Saving and loading game data
I'm glad you bring this up because I'm currently trying to design my own 'how far/where are/what are you in a game' solution. I was thinking about using something like a list. A progression list of the story line, key objects that you'd get or set during game play. Once you get one or complete something it's crossed off that list.
But what I need to think about is how that effects game play now and how to program characters to 'know' how far the player is. Im glad somebody is shedding a bit more light on the subject.
But what I need to think about is how that effects game play now and how to program characters to 'know' how far the player is. Im glad somebody is shedding a bit more light on the subject.
-
- Chaos Rift Demigod
- Posts: 991
- Joined: Thu Nov 13, 2008 3:16 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Amiga, PSOne, NDS
- Programming Language of Choice: C++
- Location: Sweden
Re: Saving and loading game data
I don't see how a list like that would be efficient technically and not sure what you mean withdnxviral wrote:I'm glad you bring this up because I'm currently trying to design my own 'how far/where are/what are you in a game' solution. I was thinking about using something like a list. A progression list of the story line, key objects that you'd get or set during game play. Once you get one or complete something it's crossed off that list.
But what I need to think about is how that effects game play now and how to program characters to 'know' how far the player is. Im glad somebody is shedding a bit more light on the subject.
But a list of storyline progression could easily be tied to a story progression variable.crossed off that list
I can't help you any further with this right now but I hope it works out.
-
- Chaos Rift Cool Newbie
- Posts: 51
- Joined: Tue Dec 14, 2010 6:49 pm
- Favorite Gaming Platforms: PC
- Programming Language of Choice: Everything... and C#
- Location: dnXstudios
- Contact:
Re: Saving and loading game data
Exactly. Figuratively it'd be a list, otherwise a variable that'd tell how far someone was in the game.Pritam wrote:I don't see how a list like that would be efficient technically and not sure what you mean withBut a list of storyline progression could easily be tied to a story progression variable.crossed off that list
I can't help you any further with this right now but I hope it works out.
Hope to hear some other ideas.
Re: Saving and loading game data
I forgot about this thread XD
For EQ the way I vision we will have it is the major stuff will be saved with the engine ( without giving too much storyline away ) the are severall items you will need to collect along your quest in the temples/dungeons etc
So in the game ( well in lua )
So then like in Zelda 2 the dungeon has a rock infront of the temple, or maybe the temple can collapse. For certin entities such as chests and whatnot I'm not sure how we will do that.
Think this is a solid design?
For EQ the way I vision we will have it is the major stuff will be saved with the engine ( without giving too much storyline away ) the are severall items you will need to collect along your quest in the temples/dungeons etc
So in the game ( well in lua )
Code: Select all
--New map loaded, this script will get executed
if Party:HasKeyItem(1) then -- If we have our first item
Map:SetTile(20,20,1) -- Lay a rock iin front of the temple
end
Think this is a solid design?
-
- Chaos Rift Cool Newbie
- Posts: 51
- Joined: Tue Dec 14, 2010 6:49 pm
- Favorite Gaming Platforms: PC
- Programming Language of Choice: Everything... and C#
- Location: dnXstudios
- Contact:
Re: Saving and loading game data
Hmm not sure how well that would work. Instead of checking if your player got a certain item every time you loaded a map... , should it be presets when you load your player game file it changes all the maps up to a certain point dependent on your progression variable? Which would change when you got a certain item the only problem I currently see with this approach are loop holes in which a player could advance farther if theirs an item on the 'progression list' thats farther than their next 'task'.N64vSNES wrote:I forgot about this thread XD
For EQ the way I vision we will have it is the major stuff will be saved with the engine ( without giving too much storyline away ) the are severall items you will need to collect along your quest in the temples/dungeons etc
So in the game ( well in lua )
So then like in Zelda 2 the dungeon has a rock infront of the temple, or maybe the temple can collapse. For certin entities such as chests and whatnot I'm not sure how we will do that.Code: Select all
--New map loaded, this script will get executed if Party:HasKeyItem(1) then -- If we have our first item Map:SetTile(20,20,1) -- Lay a rock iin front of the temple end
Think this is a solid design?
I'm fairly new to saving/loading so correct me if I'm wrong And I like to think out loud ea post
Last edited by dnxviral on Wed Dec 29, 2010 8:10 pm, edited 1 time in total.
Re: Saving and loading game data
Well most of EQ will be lua, and the will be at least one new script loaded per map so its not going to be the entire purpose of the script. I don't know if this is how we are going to handle it but this is what I've been thinking could work.dnxviral wrote:Hmm not sure how well that would work. Instead of checking if your player got a certain item every time you loaded a map... , should it be presets when you load your player game file it changes all the maps up to a certain point dependent on your progression variable?N64vSNES wrote:I forgot about this thread XD
For EQ the way I vision we will have it is the major stuff will be saved with the engine ( without giving too much storyline away ) the are severall items you will need to collect along your quest in the temples/dungeons etc
So in the game ( well in lua )
So then like in Zelda 2 the dungeon has a rock infront of the temple, or maybe the temple can collapse. For certin entities such as chests and whatnot I'm not sure how we will do that.Code: Select all
--New map loaded, this script will get executed if Party:HasKeyItem(1) then -- If we have our first item Map:SetTile(20,20,1) -- Lay a rock iin front of the temple end
Think this is a solid design?
I'm fairly new to saving/loading so correct me if I'm wrong And I like to think out loud ea post
-
- Chaos Rift Cool Newbie
- Posts: 51
- Joined: Tue Dec 14, 2010 6:49 pm
- Favorite Gaming Platforms: PC
- Programming Language of Choice: Everything... and C#
- Location: dnXstudios
- Contact:
Re: Saving and loading game data
Well we just talked about what were saving.. But I'm quite interested in how the actual saving would work? Not what we save but how we save it.
Re: Saving and loading game data
Obviously the only way to get data static from a program executing and terminating would be to save it to a file.dnxviral wrote:Not what we save but how we save it.