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 / creating "saves"

Author
Message
Towelie
20
Years of Service
User Offline
Joined: 21st Apr 2004
Location:
Posted: 14th Sep 2004 19:35
im back ^^

well i decided to start programing in db agian...after learning vb and seeing how....well lets just say i like db better....

im using dbpro and heres what i gotta do


I want to make a save file...so when user clicks a button it writes data to file, well my problem is...if i write it to a text file they can change it..which isn't so good for a save file ><

well my first thought was some weird "internal encryption" thing...where for example i would add in a few extra numbers...and i have some random numbers pointing to difrent places in teh code and stuff and then make check ups on stuff like have the program check that certian numbers are in the right spot and stuff....

ok well thats tedious....and crude...and...stuff so....is there a better way to do this? my dad mentioned writing to a difrent kind of file other then a text file....that is written difrent then a text file....but i couldent figure out how to do this...

i know very long post but....so dose anyone know how to do this?
The admiral
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 14th Sep 2004 19:37
well you could just put a different extension on the end of a file but you would proberly be better of using memblock or file blocks etc to do this.

[href]www.vapourhost.com/~flyer[/href]
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 15th Sep 2004 10:25 Edited at: 15th Sep 2004 10:51
Heh, nothing wrong with making an internal encryption process.

I've actually made one that might help you a bit, this tutorial is not my final version(it's written in visual basic, which means it's pretty easy to adapt into Darkbasic) but here's what i have so far.. http://members.shaw.ca/creeo/vbtutorials/vbtutorial1.htm. The vb project files are also included at the top of the page.

I guess i should explain a bit of what's happening in the tuturial, or if your just too lazy to read or visit the page.

Basically you have a string, let's say "BAD" for example.
Now, BAD in ascii code is 666568.

What the program does IS convert it to ascii code. Once it's done converting, it saves it to a text file.

Here's the catch, i know your going to say... oh well, some guys going to figure out that all i did is convert it to ascii code and convert it back to string(thus revealing storyline plots etc) which we dont want.

So as your converting to ascii, you not only convert it, but after it's done converting you add a number.. a number that only you know.

ie. 6
ie. BAD = (66+6), (65+6), and (68+6)

This makes it much harder for someone to convert straight off the hop and expect to see results.

Now your thinking.. oh crap but this means when i convert it back to string it's not going to work for me either. Wrong, all you have to do is in your game code reverse it. Remove 6 from each letter and then convert it back to string.

ie "BAD" converted with the +6 is 727174
Converting it back - (72-6), (71-6), and (74-6)

The cool thing about it is, you can pick whatever number you'd like to make the secret number. Though i suggest leaving it under 10 as it's easier to code in.

Truthfully, i dont expect any newcomer to create this kind of code, it's more in the intermediate section.. although i'm sure that some newcomers can do this. Hope this helps

if you have any questions post back here and i'll try to get back to you.

PS - I think this is my longest post ever

- Merix
PowerFang
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 15th Sep 2004 17:37
If someone really wants to edit the save game that badly, they will.

The people who enjoy playing your game wont "cheat" by editing simple files, they will play it through its entirety.

I recommend you just skip trying to encrypt it.....just my thoughts.
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 16th Sep 2004 05:10
it's not like you are going to give $100 to the first person to complete your game and send in a screenie...

so not really a need to encrypt it that i can see...

"We make the worst games in the universe."

Towelie
20
Years of Service
User Offline
Joined: 21st Apr 2004
Location:
Posted: 16th Sep 2004 18:59
i think the question was already answered with the memblock thing....i havent had time to check it but from what i understand....it just wont let anyone on that computer edit that file....ok thnx

Login to post a reply

Server time is: 2024-11-27 09:54:15
Your offset time is: 2024-11-27 09:54:15