The Daily Click ::. Forums ::. Klik Coding Help ::. ini file question
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
5th December, 2005 at 21:05:04 -

Okay so I have a save game file in my game that uses an .ini and everything works out great. It's very easy to edit while troubleshooting, but it's just as easy for someone (the eventual player) to go into the file and cheat the bejeesus out of the game. You know, the ol' 9999 HP trick or whatnot. Is there any way to make it so it can't be edited by the user? I've heard about the encryption object, but just how does it work please? I don't want to screw up what I have by accident, because it was a big pain in the ass to do because of all the information the .ini has to store.

Thank you!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Mr Icekirby



Registered
  18/12/2003
Points
  846
5th December, 2005 at 21:31:11 -

As a basic storage, INI is great. It wasn't meant to be secure. If you want a secure way to store things, you could use the binary object and write values like that where people don't really understand it. Plus you get a smaller filesize. I'm not sure how to use the encryption object so I can't really help you there.

 
Mr Icekirby says so!
OBEY ME!

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
5th December, 2005 at 23:34:08 -

for the encryption object i think its just a character key so you can make an alternate alphabet. then when you read the ini you use the same character key to convert it back into what its supposed to be. i think

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
6th December, 2005 at 00:30:11 -

There are a buncha ways you can make inis more secure, http://create-games.com/cs_search.asp would probably shed some light.

 
n/a

Crazy Chris



Registered
  17/09/2005
Points
  35
15th December, 2005 at 02:07:32 -

the easiest way to stop people from going in the inis is to call it somthing like virus scan or windows start-up or you can all ways put it were no1 will find it

 
๑wH b |}FfIcULT, wHN WTh bIt 0F fF0Rt, 0U @N MposL?

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
15th December, 2005 at 03:31:22 -

No, that just gets people irritated.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Kai Proton



Registered
  31/01/2005
Points
  148

Wii Owner
15th December, 2005 at 06:12:32 -

Maybe Having the File somewhere else in the PC is a good idea, unless the players get a look at the source code they would think all the save data is being saved in the EXE of your game..

it just needs a name that wont be suspect,

I was just working out on my game to use ini and called it system.ini but I didnt call the location, so it automatically went into the windows system dir. sooo.. When I re-read the values in the program it looked in an actual windows system file, and couldnt find the values I wanted...

the moral of the story is look for the file, stick something in the root with some kinda name like FWLog. or AVlog.


Its how I would stop access to the file, but at the end of the day if they want to play a home brew game the chances are they wont want to cheat it rather play it as its meant to be played.

 
----------------------
Time for a Sexy Party!
----------------------

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
15th December, 2005 at 08:50:27 -

No, that's a fucking stupid way of doing it. Any noobs reading this disregard the entire concept, if you try and hide files by pretending they're system I'm going to come to your home and eat your dog.

If you want to protect save games you can:
1. Encrypt the data using an encryption extension. Doesn't matter which. Pick one and learn how to use it.
2. Don't encrypt the data, but use a hashing extension to store the hashed concatenation of the data and a key at the end of the ini (the concept is a little more complex than plain encryption, but in practice it's simpler)
3. Use non-numeric data. One of my games stores the current level as one of a bunch of randomish words rather than a simple number. For example level 5 might be "elephant" or something.
4. Do nothing. People aren't going to bother with cheating until they're fed up with playing your game normally. I very rarely protect my save games for this very reason: if they've had enough of playing properly and can get a little more fun out of it by cheating, let them.

 
n/a

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  50116

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
15th December, 2005 at 11:15:33 -

You could use array. It's still crackable, but not quite as easily as INI.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14458

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
15th December, 2005 at 19:46:11 -

I remember Crystal Towers used a normal ini without encryption but if it was edited in notepad the game would give you a DON'T CHEAT screen of sorts. I tried it out after someone else was caught cheating and posted it here somewhere.

for my game, upon completion a number gets saved to the ini. And the game checks if the number is present before the minigame or level select can be played. That way there is no way of knowing how to cheat at the game. Well unless you can guess the group name and number.

 
.

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
16th December, 2005 at 00:57:28 -

Kai: If you just try to hide an unencrypted INI in the windows folder, it's ridiculously easy to find if you sort by date modified.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
16th December, 2005 at 06:55:52 -

What I did in CT was add a whole lot of unnecessary values to the INI (actually renamed a .sav) so that it wasn't clear which ones to change to do anything. This isn't secure as such, but it does mean that it takes a bit of trial and error to get it right. Trouble is it also takes a lot more effort to remember what you're doing when you're writing it.

The record of completed levels was done in the same way that Radix mentioned - by storing "passwords" of a sort instead of obvious values.

 
http://www.davidn.co.nr - Games, music, living in America

Tina Petersen



Registered
  19/09/2003
Points
  350
16th December, 2005 at 11:03:53 -

i use binary object! Set every variable up with its own offset, when writing a variable like numbers or so cloak them with different numbers example Lifes=9 then save it like Lives +7 or so, and when loading it to lives -7. Also i once uses cloaking by changing variables offsets in the save according to the progress in the game.. Binary rocks and pretty much everything is possible!

 
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)

Tina Petersen



Registered
  19/09/2003
Points
  350
16th December, 2005 at 11:06:30 -

Oh one more thing using CRC is also great! So that if the crc has changed which it always will do if edited! The game simply marks the savegame bad. And u cant use it anymore... Many new retail games also use this.. For hiding the crc just append it to some image file or sumthing making it hard to find. And when found neded to be edited to the exactly new crc which the edited savegame use.. This will annoy people cheating and will probraly make them stop..

Also u can save ur values using binary in another file! like an image file. without destroying the image!

Image Edited by the Author.

 
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
16th December, 2005 at 11:51:51 -

Theres an extention called BlowFish, it does a great job at encrypting files, so that only the game can decrypt it (unless someone knows the decrypt key). The only trick to the object, is telling the game when to decrypt & encrypt the file, because it cant tell the difference between & encrypted & decrypted file, meaning it has the ability to encrypt files more then once, which can be a pain.

 
http://www.facebook.com/truediamondgame
   

Post Reply



 



Advertisement

Worth A Click