Tag Info

Hot answers tagged

130

The PNG format has support for more-or-less arbitrary metadata. The PNG standard defines a PNG file, essentially a series of chunks, some of which are required (and contain the image data). Others, however, are optional. For example, there's a chunk for storing gamma information or histogram data. In particular, there is a tEXt chunk that can be used to ...


44

The developer of Monaco actually made an excellent article on how both they and Spore accomplished this. The basic summary of what they do is fairly simple: Convert your data into binary Convert your target image into a raw bitmap Walk along the pixels of the image in some predictable pattern (they simply do left-to-right from the top-left corner). Write ...


36

If all you truly needed was the PNG file, chances are they just simply added the information into the file. This is actually a practice of Steganography. A lot of the times, this is used to hide payloads or secret messages in things that are seemingly public facing. However, it is likely in this case that this method is what was used. Typical Stegongraphy ...


30

You need use serialization to save your variables in memory to your hard drive. There are many types of serialization, in .NET XML is a common format, though there are binary and JSON serializers available. I'm not much of a C++ programmer, but a quick search turned up a few examples on serialization in C++: ...


24

The way you have it described, somebody hacking a save file would just need to construct an MD5 hash of the save file values in order to bypass this measure. You need to add one thing in order for this to even really be worthwhile: a secret block of arbitrary data that's added to what you're hashing (both when creating the save and when validating it on ...


20

Windows (Xp and following) Based on: http://en.wikipedia.org/wiki/Special_folder http://en.wikipedia.org/wiki/Environment_variable These locations assume that Windows is installed on the C: disk. Append your own directory with game name or game company then game name to these directories. If you use Window 8 Metro-style application, you'll have to ...


19

It may be making saves in the Registry or somewhere under your %APPDATA% folder, or in your homedir's "My Documents" or "My Games" subfolders. Or anywhere else on your hard drive, for that matter. It is unlikely to be modifying its own exe to save, although I suppose that is possible (if a very bad idea: see AttackingHobo's comment below for a sample of ...


19

Save the seed which you used to generate the world, and the modifications either as atomic "commands" or the results of those. Then when loading the saved game, you do the following: Procedurally generate the part of the world you're currently visiting. Apply the saved commands, or overwrite the generated elements with the saved ones. Update: And of ...


16

first lets say since you have a very simple save file, you can use text file. one of the simplest ideas is to use a string key to lock/unlock data: void encrypt(string& data,string key) { for(unsigned i=0;i<data.size();i++) data[i] += key[i%key.size()]; } void decrypt(string& data,string key) { for(unsigned ...


15

MacOS Based on: http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1 common usage In unix-based OS, the ~ directory is automatically located at the user's home directory where user-specific data are located. This means ...


14

Typically this is specific to your game. I'm sure you've learned about writing to and reading from files in your classes so far. The basic idea is: When exiting the game, write the values you want to save to a file. When loading the game, check to see if a save file exists, if it does, load the read the values in to your program. If the file does not ...


14

Nothing can be considered secure client side; anyone who tells you it is, is lying. You can use any encryption and scramble method you want, but since the client must be also able to decode it, and the user has access to the client itself, if he is resourceful enough he'll have access to the decryption key / algorithm. You can only add layers of annoyances ...


12

Linux Debian (Ubuntu, Fedora, etc.) Based on: http://www.seul.org/~grumbel/tutorials/game_install/install_dirs-2.html http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html In unix-based OS, the ~ directory is automatically located at the user's home directory where user-specific data are located. This means that whatever the language, ...


11

If this is not an online tracked competitive type game: Let em hack away man. You can spend way too much energy on things like this when people who will play the game, will just play the game. Those who want to hack it will never really want to play it, they just want to hack it. If it is an online competitive type game: All you have to do is store the ...


11

I generally don't think in terms of a memory snapshot, but rather I just make a list of which values need to be saved between sessions and save those values into an external file. This depends of course on the needs of your specific game, but usually I simply save the state of the current level (ie. where all the enemies are, what their health is, etc.) and ...


10

If you're looking at this for the benefit of the player, allow the player to decide, indirectly, via the difficulty setting. Checkpoints Pros/Cons: Increases death penalty, Pro for more hardcore gamers, Con for casual players Allows player to become more immersed in the game Lets the developer choose the save location, so the player is less likely to have ...


10

Queston's fine. If you're making a horror game, i'd advise against letting the player save. This is simply due to the fact that in a horror game, if you give player tools to defend himself, that may be a gun or a re-load option, you're taking away most of the tension. You can put together the scariest monster anybody could ever imagine, but if it dies to ...


10

Encrypt it. It's really that simple. Since you're trying to discourage casual editing (rather than a dedicated hacker), the encryption algorithm could be fairly simple. There's no need for PGP or something. You could use ROT13. Or develop a substitution cypher of your own.


9

One easy-ish approach is to keep old loading functions around. You need only a single save function that writes out only the latest version. The load function detects the correct versioned load function to invoke (usually by writing out a version number somewhere in the beginning of your save file format). Something like: class GameState: ...


8

(1) Only save the really important bits, (2) only save them when they have changed since the last time they were saved, (3) save them individually, and (4) save them via an asynchronous system. Much of the world is likely to be static - that data doesn't need to be serialised at all, as it probably already exists on disk in some form. At the other end of ...


8

Saving a procedurally generated world is the same as saving any tile map data. You would likely want to save the world in binary format, assuming the world is built out of different types of tiles, you will have to: Decide on the total number of different tile types.(depending on that you will need more or less bits to represent each tile) Define the ...


8

I would avoid using reflection for something like this, and use a language-agnostic tagged blob format, or something like this (just one possible method for entity serialization): Have an ISaveable interface with a method that produces an Entity given a hunk of save data, and produces a hunk of save data given an Entity. public interface ISaveable { ...


7

You can definitely leave your save file unencrypted but add a checksum that is calculated through all the values that you want to "guard". The cracker would therefore be able to re-produce the hashing (which you off course will use with proper salt) and therefor will have a happy time trying to re-produce. This would still not be %100 secure but, probably ...


7

The key phrase you're looking for is game state serialisation. Game state is what it says. Your game has some sort of structure to keep the current state of the game. In an RPG game, you want to store the list of quests the player is on, how far they are into those quests and what their characters' stats are. Serialisation is the reversible conversion of a ...


7

I just write the body and shape values to a file. Then when reading them, I create a new body and shape and set the values to those read from the file. From what I've seen this works great. I haven't seen any strange behaviors or anything like that. Bodies that were flying through the air, continue to do so when the game is reloaded. The values I read/write ...


6

If you serialise an object then change its class's definition, you will not be able to recreate that object, meaning changes to your game will invalidate past saves. So whilst serialisation is definitely the simplest method, it has this flaw. A more robust method for a game that will be changed is a manual sort of serialisation where you determine what ...


6

With C# (and many other languages) you can serialize (aka save) the state of a objects directly to a file and de-serialize (aka re-instantiate/load) them later so that you have the same objects with the same state. This works best if you have a prober scenegraph because this way it will happen almost automatically in C#. As an example say I have the ...


6

There are probably a large number of ways to do this, but the simplest that I always found and have used both personally and professionally is to make a structure that contains all of the values I want saved. struct SaveGameData { int characterLevel; // Any straight up values from the player int inventoryCount; // Number of ...


6

Include a version number at the top of your save file. Increment the version number whenever you make a change to the format, and add code to your engine to allow it to read "old" versions and make any necessary revisions to the loaded data. Of course you will have to decide what kinds of revisions are appropriate. In a case like your example, where new ...


6

I would also go for the ID solution. You should give every object in your whole world (not just on the current map) a unique ID. A 32 Bit int should be sufficient. Further every object can store a state value, also a 32 Bit int value. You can squeeze a lot of information into 32 Bit, e.g. you can make 32 flags out of it to store 32 bool values. Or you can ...



Only top voted, non community-wiki answers of a minimum length are eligible