PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Level Locking/unlocking question

In my game I want to be able to prevent players from accessing certain levels of the game until they have reached a certain point. For example the player reaches the end of level 3 and moves on to level 4. After the player has done this once I would like the player to be able to start from level 4 without having to play levels 1, 2 and 3 again.

Obviously this is done in many games but I'm just looking for suggestions for the best way to do this.

My game is for the MS Smartphone platform and I have considered either using registry values to determine how far a player has got or using a file with the same information. Any information on making this process as secure from cheating as possible would also be greatly appreciated.

Thanks in advance.
A text file on the device zipped or encrypted should do more than well, and stop 95% of the people who try.
Any suggestions on a good, simple to use library to use for encryption?
A simple function that takes a number ( the level that can be started at ), converts it to an octal, hex, or any other odd base, and then replaces the digits with predefined characters should be more than enough. That way you don't have to deal with an entire library.

ex: Level 10
Octal: 12
replace 1's with +'s, 2's with %, 3's with c's, 4's with p's, etc.
Final string: +%

Then, reverse the process to get the last level the player can start at. atoi and itoa can convert to and from different bases, so that will make your programming job a lot simpler. That "encription" would be enough to stop most users.


...or, you could just go with a regular encryption algorithm...
Why dont you just save and read a binary file? Its not as easy to change as a text file, and theres nothing messy to go through.

Really, I dont see much of a problem with even a clear text file since if they REALLY want to play the other levels, let them. They payed for your product, let them get the most enjoyment possible out of it. Everyone loves cheats in a game for those levels they just cant pass.
Cheers for the replies guys - I'll probably just go for the binary file option. Most users won't bother trying to hack it but for those that do, as DillRye says, it's probably best to let them.