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 / encode/decode game save dat (help needed)

Author
Message
Ashley Decorator
19
Years of Service
User Offline
Joined: 27th Jan 2005
Location:
Posted: 3rd Feb 2005 00:29
managed to work out how to actually save a file (game score) and load it back into the game, and save again. but its far too easy to search for files recently used using the windows search thingy.

and even easier to load the dat file into notepad and type what ever score you feel like and saving it back, start the game again and hey presto, major big hi score.

so i need help trying to encode the file when saved, and decode it back upon loading.

have tried just adding 99999 to score and then taking away 99999 again but for some reason the scoring goes wrong.

also thinking about turning the score into hex using the hex() command, but if this would work, how do i turn the hex back into the score.

please help, thanks

Ashley
Cryptoman
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 3rd Feb 2005 02:07
Are you new or really new? Asking so I know how answer your question. I have a rc4 snippet I made and modified to help someone with his password code. If you are not new maybe you could pick the encryption out of it.


Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Feb 2005 02:13 Edited at: 3rd Feb 2005 02:14
Here's one method which should be quite straight forward - save the score embedded in another two numbers - which are code numbers.

Example - your score is 250. The code numbers are 1111 and 2222. (Obviously, you would choose longer, less obvious number patterns) You then embed the score into the code numbers eg. 11112502222. Slightly harder to do but less easier to decrypt would be to mix the digits of the score and a code number together.

When you load the score back, extract the score and the code number. Check the code is right - if the user has tried to tamper with the score, the code number will be wrong and you can set the score to zero.


Neil19533
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: England
Posted: 3rd Feb 2005 12:59
you could also do it as an array.

some thing along the lines of
dim score(10) :rem top ten scores
score(1)=100
score(2)=100
ect...
save array "score.dat",score(10)

then when you want to load it

load array "score.dat",score(10)
topscore=score(1)
2ndtopscr=score(2)
ect..

Any spelling mistakes are totally In tensional.

Login to post a reply

Server time is: 2024-09-23 10:22:25
Your offset time is: 2024-09-23 10:22:25