| 08-29-2004, 05:31 AM | #1 |
I'm developing my RPG map, when I run into a problem with a save/load code. I realized that in many other RPGs that utilize it, the code can simply traded easily among players (I.E You take the code of your current character, and give it to your friend so he can play as well). I think I may have thought of a way around it. The code would utilize the players name in it, and would have to match the player who was loading the characters name exactly (I.E BEARDO:XXXX-XXXXX-XXXX-XXXX. If my friend CrimsonOmega tried to load it, it would be invalid). Is it possible to do such a thing? |
| 08-29-2004, 07:14 AM | #2 |
of course it is, in fact, im ptretty sure some of the save/load codes already do it of course you wouldnt do something that obvious, youd have to do something add it all up (if a=1, b=2 ect.) and insert it into the code |
| 08-29-2004, 07:43 AM | #3 |
First of all, that's not a new idea. Second of all, you're going about it all wrong. Nothing stops them from just changing it to be their name. You have to encrypt it and mix it up within the code. |
| 08-29-2004, 07:51 AM | #4 | |
Quote:
Thank you, that's what the 2nd poster said. |
| 08-29-2004, 12:26 PM | #5 |
Theres actually a better way yet, instead of mixing the name in with the code, mix the code up using the name (or rather, a hash derived from the name), then unmix the code using the players name who enters it. If someone uses a code for someone elses name, once "umixed" the result will be random garbage. I'll try to explain in relatively plain english. Say you use only letters for your code, so you start with the alphabet. ABCDEFGHIJKLMNOPQRSTUVWXYZ - This is the alphabet used for the code, so A = 1, B = 2, C = 3 etc Now take the players name, say GRATER Take the first letter in the name (G), swap it with the first letter in the alphabet (A) GBCDEFAHIJKLMNOPQRSTUVWXYZ Swap R and B GRCDEFAHIJKLMNOPQBSTUVWXYZ Swap A and C GRADEFCHIJKLMNOPQBSTUVWXYZ Swap T and D GRATEFCHIJKLMNOPQBSDUVWXYZ Swap E and E (in this case, swapped with itself) GRATEFCHIJKLMNOPQBSDUVWXYZ Ignore the final R, because it's a repeat. So now the alphabet used to construct the code is GRATEFCHIJKLMNOPQBSDUVWXYZ So for my code (generated using the name Grater) G = 1, R = 2, A = 3 and so on. Obviously this will generate a code incompitable with A = 1, B = 2, C = 3. For my code hero level 2 is R, for someone else R will mean hero level 18 The reasons to do it this way are: 1) No extra digits are required in the code, keeping it short. 2) All of the name is used (excluding repeated letters) 3) It befuddles people trying to crack the code. Bear in mind the method I described above is just to illustrate the principle, there are many better ways to encrypt a code using a name! |
