Skip to main content
GameDev.net gamedev.net
🔒 Locked

Map Files

Started by template May 24, 2003 at 9:30 PM 1 replies 700+ views
Original Post
template
template
Hi, i''m working on a map file format for a game in C++ and i''m not sure of a good way to stop people editing the maps in notepad or something similar. I thought about writing the map source file using ios::binary to stop them editing the data in notepad but then what''s to stop them writing a C++ program to open and edit it? What about an algorithm like MD5 to check that it hasn''t been altered, are those effective? If you hadn''t guessed already, the reasons for doing this is to stop people potentially cheating. Thanks in advance...
falkone
falkone
You could do a number of things.. the first would be to include a header into the file, that way it'll make it a bit more difficult to find the data in the file... you could add a checksum-like feature that would count the number of a certain type of object, and store that.. so your program could calculate that number and check it against what it should be.... though if the geek has that little of a life, he could probably dig through the data and catch that... the third thing you could do would be to encrypt the data, or to disalign pieces of data that go together using a special algorithm, and putting it back together with the algorithm when you want to use it... though as long as there is access to the file, there'll always be the possibility of cheating




[edited by - falkone on May 24, 2003 10:39:44 PM]
Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o
Mulligan
Mulligan
Well, what I do is run a compression routine on the map file after saving it. Works well enough for me, though all you would need to do is inflate the file again to muck around with things, it stops most people from cheating.

Better yet, when you save the file, check the time of creation of the file. Save that somewhere else, and when loading the file again, make sure that the modification date on the file is the same as when it was saved.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.