Results 1 to 6 of 6

Thread: Not Sure?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2014
    Posts
    8

    Not Sure?

    Hello,

    I am am working on some code and was thinking i wanted to add a Save Load option. I know writing to a *.txt is a few lines of code, but I was hoping to find a way to make a file with my own excitation on the end of the file. IE: Name.sdj

    mind you i just hit random keys to make that name, but to make any excitation I wanted.

    Thank you in advace

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,430

    Re: Not Sure?

    You can put any extension you want on any file you want. The extension doesn't control the contents; it's just a label. If you have a jar of sugar, you can put a label on it that says "salt" or "dyhnepgy" or anything you like; the contents will still be sugar. If you want to save a file with a ".sdj" extension then go ahead. The contents of the file has no bearing on the extension and the extension has no bearing on the contents.

    It is true that the extension is supposed to give anyone or anything using the file a clue as to what the format of the contents is. That makes perfect sense and that would be exactly what you'd doing by using your ".sdj" extension. You'd be telling a user that the file contained text intended for your application. You could even register that file extension with Windows and then the OS would know too.

    In short, if you want to save a file with a ".sdj" extension then go ahead. Nothing is stopping you and you really should have tried it for yourself before posting here at all.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2014
    Posts
    8

    Re: Not Sure?

    I Know i can put what ever on the end, but if you just and a .txt to the end of the file then and text editor can open the file and alter the data. I want to put a stop to that.

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,430

    Re: Not Sure?

    Quote Originally Posted by Timwill View Post
    I Know i can put what ever on the end, but if you just and a .txt to the end of the file then and text editor can open the file and alter the data. I want to put a stop to that.
    So are you actually talking about creating your own file format?

    Even if you do that, you still can't stop someone opening it in a text editor and modifying it. For instance, XML is still just plain text. It must conform to certain rules to be considered valid XML but it's still just text. You can open an XML file in Notepad and edit it and it can still be valid XML.

    If you use a binary format rather than text then it can make it harder for someone to modify the contents, mainly because it's harder to work out what bytes in the file represent what data and to replace that with new bytes that will be meaningful when converted back to data. It's far from impossible though. Have you heard of hex editors?

    You could even encrypt a file but that would still not prevent someone modifying it. It would be very unlikely that the result would be able to be decrypted to meaningful data though, but the original would still be gone. You could create a password-protected archive file, but then you must have the password in your app to be able to open it yourself.

    It really comes down to how important it is to prevent external modification and how much effort your prepared to put into preventing it.

  5. #5
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    311

    Re: Not Sure?

    Along the lines of what jmcilhinney was saying, game manufacturers will often store their files with custom extensions. Sometimes these are just text based (the manufacturer essentially is allowing the users to modify their own copy of the game, and so the manufacturer doesn't care if you corrupt your copy by your own foolishness). Other times the files will be stored as a binary file which will slow down how quickly people can modify their game and even prevent novices from being able to modify the game. However even binary files can be cracked, and sometimes (esp. if the game is popular or if their is a strong gaming community that likes to modify the game) a person may create a custom modifying program that cracks open the files, displays the data in a readable format, allow others to modify the file, and re-save the modified file in the correct format that the game engine will recognize and use. The Diablo series (esp. Diablo 2) was known for the number of game mods, enough that Blizzard had to make various changes to Battlenet (their site for playing the game on-line) to ensure that people playing on the site were using only the official, unmodified version of the game. Still there were other fan sites that not only had modding programs, but also had tutorials on how to create mods for the game. I actually believe that modding communities like this spurred manufacturers to include their own modding programs; for example, some of the more recent games in the Elder Scrolls series had a game editor that allowed players to create their own equipment, stats, and even quests. Sometime these mods actually benefit the manufacturer in that it extends the longevity of the game even after initial release.

    So it would really depend on how much you need to protect the data that you're storing.

  6. #6

    Thread Starter
    New Member
    Join Date
    Dec 2014
    Posts
    8

    Re: Not Sure?

    Well I have no real need to Make my data Safe, but I just want to know how. And that is all i was looking for. There are just some people that i have gotten to know that are wanting to make a game. and i know that is what every new programmer wants to make. I was thinking, if i knew how to make safe-ish files that i could take that over in the game making process.

    Also Thank you every one for your input.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width