Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Saving Game-in-Progress

Author
Message
Project CHAOS
20
Years of Service
User Offline
Joined: 16th Apr 2004
Location:
Posted: 17th Apr 2004 18:49
I just asking if its posible to save game data then open it again. For example: Playing FFVII then saving turn off the system then load the data.TIA

Blah,Blah,Blah is all I hear. Let's get to the part where I kill you. ~CHAOS the genetic hybrid.
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 17th Apr 2004 19:19
You can dump all the variables that tell the game where the player is in the game to a text file which can then be read in.

For example, you could have these things :

PlayerHealth
PlayerLevel

Which could be the current health of the player, and the level the player is on.

You could put as part of the game exit a "Save Game?" question and then :



And when the game reloads, ask it player wants to load save game, and do this :



Project CHAOS
20
Years of Service
User Offline
Joined: 16th Apr 2004
Location:
Posted: 17th Apr 2004 19:46
Will this also save the positon hes at otr do I have to somehow write a varible for that too.

Blah,Blah,Blah is all I hear. Let's get to the part where I kill you. ~CHAOS the genetic hybrid.
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 17th Apr 2004 20:03
Basically, whatever information you want to record needs to be written out to the file - and subsequently read back in again.

I only supplied a very basic save and load routine which only has player's health and level in it.

If you had an RPG game, you will probably have many times the amount of information to save and load back in again.

An example of this would be the player's inventory - you'd need to save and load that too - and if the game has monsters roaming about you'd want to record their positions as well as the players - everything in fact that is needed to make the game set itself back to the way it was when it was saved.

But at the end of the day - it's all about saving and restoring values to variables - and the method above is one way of doing this.

zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 18th Apr 2004 00:20
Project CHAOS, let me summarize. The computer/program will do nothing unless you tell it to do it. EVERYTHING you want done you have to write some source code for it to do that. Simple really.
--
TAZ

Project CHAOS
20
Years of Service
User Offline
Joined: 16th Apr 2004
Location:
Posted: 18th Apr 2004 00:26
Ok I get it. It will take a while if my games has lots of varibles and crude like that. Ok I get Thanks i will credit you.

Blah,Blah,Blah is all I hear. Let's get to the part where I kill you. ~CHAOS the genetic hybrid.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 18th Apr 2004 00:38
@Project CHAOS
it won`t take long at all, I have some software saves about a million values and it takes less than a second, not long at all, thats the way the big boys like ID and all the game makers do it.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
Project CHAOS
20
Years of Service
User Offline
Joined: 16th Apr 2004
Location:
Posted: 18th Apr 2004 00:53
I meant to type each varible out. It would really sux to miss one most would think wouldn't you think it would mess up if you forgot one of the littlest varibles.

Blah,Blah,Blah is all I hear. Let's get to the part where I kill you. ~CHAOS the genetic hybrid.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 18th Apr 2004 12:27 Edited at: 18th Apr 2004 12:29
thats what for/next loops and arrays are good for, you can do it like this...........

dim game_variables#(10000)

open to write 1,"saved_game"

for i=1 to 10000

write float game_variables#(i),1

next i

close file 1

or you could do it like this (if you where mad enough)

open to write "saved_game"

write float 1,#player_xpos
write float 1,#player_ypos
write float 1,#dah..de.dah
write float 1,#etc
write float..........

for ten thousand times over, which is the easiest?
yes it would suck if you missed even the littlest bit out, thats what debugging is for, you could read a mp3 in as raw data with the db commands, but unless you know how the compression and the file format work you still can`t get any music out of it, the programs that write these files have to do so in a fixed sequence, if you deviate just a little then they can`t read em, ever had an app that cant read png from another program for example?, I have two programs (one a discounted older program) and Adobe won`t read bitmaps from the budget label program, yet the cheapo program can read the Adobe .bmp`s just fine, the point being that the coder of the cheap app was obviously making some assumption when he writes his files that Adobe will take for granted, a lazy way to read a bitmap for example ignores extra data in the file header that tells you the colour depth, that works fine as long as you are loading files with the same colour depth that the program assumes it is getting, but if you try to load a 32 bit image into the space allocated for a 16 bit image, you are gonna get some spare data left over.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.

Login to post a reply

Server time is: 2024-09-22 06:42:16
Your offset time is: 2024-09-22 06:42:16