Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Storing Variables in files

Author
Message
Comp Guru 910
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location:
Posted: 6th Jan 2008 18:57
Ok. I have been working on an application that will store the settings behind Items, Weapons, Levels, Enemies, and Armor in .ini files, and its going smoothly so far. Once this is done, I will be able to dynamically change settings for items without having to do any coding. My question is, how is this done in other games? Do people statically just code in there items using collision functions and special coding to every one of there items, or do they store there creations in a different file? Because what im trying to do is make an online game (RPG feel) and when the game connects to the server it will read the ini file, and store it in a structure array on the clients computer. Now the problem I have with that is, 1: If I have 1000 items, 200 enemies, 500 weapons, and 200 levels, wouldnt that create a bit of overhead? And secondly, if I was going to make this game offline, have ini files would be a bit of a security issue considering the player would be able to alter any of the files to do what he wanted them to do in the game. How would anyone else do this?

typos...
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 6th Jan 2008 19:03
Quote: "And secondly, if I was going to make this game offline, have ini files would be a bit of a security issue considering the player would be able to alter any of the files to do what he wanted them to do in the game. How would anyone else do this?"


1) If the game is offline, why is it a security issue?

2) If the game is online, you should never store player data on the client machine.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 6th Jan 2008 20:21
As Benjamin said. Plus - if you really need to move text-based data from server to client and you expect a huge amount of them, just compress them (you can find open source libraries on sourceforge).

Personally, I like text-based configuration files, so I use them pretty often and even use base64 coding for small binary chunks inside of these text files. In multiplayer game it is important to use the same data as are stored on server. You can either
1) copy all data mindlessly from server to clients (only for small amount)
2) perform a checksum for every important file and copy different version from server to client

a big amount of data is needed only on the server anyway
Comp Guru 910
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location:
Posted: 6th Jan 2008 21:33
Well, in storing ini files on the clients machine, in an offline game, it would be incredibly easy to hack the game and change values of the items/weapons/enemies/and levels. Secondly, I wouldnt be storing files for the player on the clients computer, only items, weapons, and armor, that is in their inventory, and those would be stored in an array inside of the application, so there would be no way that the person could edit them, say like they could with an ini file that was stored on their computer.

So, to answer my question, is there a better way of doing this? And how do you do base64 encoding on a file? I dont know encryption in db, VB,or C++ at the moment, the only encryption I have done is on PHP

typos...
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 6th Jan 2008 22:54
Quote: "Well, in storing ini files on the clients machine, in an offline game, it would be incredibly easy to hack the game and change values of the items/weapons/enemies/and levels."


So, what? Do you mind? Why? Of course you can encrypt the data, but for what reason? If it's just a single-player game, why to bother with such things? If someone wants to change the behavior of your game, let him to do it. What do you want of your game? That people enjoy it, I guess. And is someone enjoys changing the game, let him do so. You have never "hacked" some game?

Quote: "I wouldnt be storing files for the player on the clients computer, only items, weapons, and armor, that is in their inventory, and those would be stored in an array inside of the application, so there would be no way that the person could edit them"


There's always a chance to edit the data. You can make it a lot harder, but never to prevent this happening (ok, storing in ini files would be too easy ). So, if you are considering multiplayer game, you must not do such things on client's computer. The server must store all the data and dictate the values, so that client can't change it on will.

Login to post a reply

Server time is: 2024-11-19 23:08:09
Your offset time is: 2024-11-19 23:08:09