Ok guys I'm staring at code for an RPG I'm working on; and when you win a battle, a temporary INI file is to receive the item you win in combat. Normally this INI is encrypted, so in the course of like eight events, the file is decoded; the INI is written to, and then the file is encoded again; and finally the game skips to the next frame when all of that should be done.
Problem: About 90% of the time I run the game; one of these events doesn't run. The game simply decides not to encode the file; and I'm left with a naked temp.ini.
Questions:
- Are events like this prone to not run for some reason:
If Alterable Value C of Hero = 5 -> Set Alterable Value C = 6 Decode INI
Run this event once
If Alterable Value C of Hero = 6 -> Set Alterable Value C=7 Write to INI
Run this event once
If Alterable Value C of Hero = 7 -> Set Alterable Value C=8 Encode INI
Run this event once
If Alt Value C of Hero = 8 -> Next Frame
Run this event once
- What could possibly be causing this to happen so many times, I have the events set now where C isn't even incremented like that, it's incremented in a separate event every 1 second; that's a HUGE time frame it shouldn't have any problems... right?
Phizzy: You're right; the events take precedence in the right order.
But it's doing the same thing it's done all day, it decodes the INI, puts in the value... but it just refuses to encode. I'm beginning to wonder if it isn't just this damned machine...
whoops
Assault Andy Administrator
I make other people create vaporware
I'm using "File Encryption Object" by Sean Poling.
And come to think of it most of my problems in MMF are his fault.
But nevertheless... *tries identical code on a different machine*
EDIT: Guess what dudes; doesn't work. On two different computers with vastly different stats and Windows OSes the encryption just doesn't want to work for some reason... I don't know what could be wrong with my events, I'll look at them some more today; and maybe if it doesn't work someone would volunteer to check them?
Other than that... is the Binary Object a good alternative to the File Encryption Object?
Phizzy: I just meant that you were right -because- I put them all in the same event.
But I'm still having a problem where it just decides not to encode for some reason; it never messing up decoding or writing it... And it does this across multiple machines... I'm going to try the binary object but I feel like there must be something I'm overlooking... but it's been days =/
Ok I tried it. It doesn't work either; the blowfish object does the exact same thing. I have no idea why it is doing this and I am about to break something. Could someone please volunteer to look at the entirety of my code? It would be a giant leap of faith for me but I am obviously incapable of doing anything and it makes me sick to my stomach that something so simple has driven me insane for three days straight
Teapot that is a major assumption on your part. A lot of PC games have used a similar kind of encryption; that whether or not it was easy to crack, players would spend the time breaking it. Some players are so devoted to published PC games that they develop mods for them even when no tools were available to them; it takes very little effort to download a hex editor, break the encryption and mess up your code. Of course players are going to try this; and especially in an online game, where they feel they can prove something by hacking up their character and prancing around the servers as if they truly accomplished anything.
Not only will people give it a shot to cheat; but they'll go to great lengths to develop methods to make it easier for more people to cheat so the whole game economy is driven into the ground and everyone is just like them (which is odd considering at first they were cheating to be the best). In the original Diablo cheating was so rampant from the getgo because the codes were cracked, and instantly trainers were developed for the game that allowed the modification of character stats, item slots... money; everything. That legacy has followed Blizzard into the Diablo sequel, where cheating was on a much lower scale but it was exceedingly common at the game's start that items were duplicated, and many of these items still exist on the server today because of Blizzard's inability to fix the problem beforehand.
Encrypting an INI is not going to stop someone from cheating. They can simply edit the game values directly in memory. Tools exist which are designed for cheating in PC games which do this. In fact commercial game companies don't even bother to put in cheat protection unless the game is an online game. If it's single player then if they want to cheat just let them.
99 percent chance that the above post is 100 percent correct.
Why not use an array, they rule over INI's and are especially useful for RPG's, plus they can't be hacked into easily, well not as easily as being opened in notepad
What are you using to get the filename? Win2k didn't accept .\filename.sav for me, yet win95/98/me do. I don't know for XP.
I think for TGF the file object has something to get the app dir, and in MMF it's appdrive$+appdir$, and in Jamagic it's Program.getapplicationdirectory().
And thanks for the suggestions about other methods... it is indeed pretty hard to protect your game from cheaters... and I really have to; because of the nature of this game as an online RPG ...