Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 8th, 2006, 9:36 PM   #1
Dr.Backtick`
Newbie
 
Join Date: Dec 2004
Posts: 16
Rep Power: 0 Dr.Backtick` is on a distinguished road
Trying to setup an anti-cheat system for a game friend and I are creating

Hi,

My friend and I are creating a game in the language of C++. We have not come up with a official title of the game as of yet but have an idea of what we wanna make and what systems to create for it. We already layed somewhat of a design. One of the things that were needed for the game is a way to have the game reject modified game content files. A system such as CRC (Cyclical Redundancy Checking) popped in my head. I have seen such systems in action and thought why not try implement this sort of system into my code. So, I started to google and found plenty of things on it. I think from reading the tutorials I know the procedure of how it works. CRC32 is confusing to an extent for me since I am weak with Polynomial math theories and such. Some of the tutorials say I do not need to know things like that. Also, I noticed that the code provided on them just give me a way to retrieve the current CRC value for the file. I wasnt even able to compile the code since there were things like DWORD and HANDLE which were confusing. All I wanted was a good way to ensure that the game will not run on a modified game content file. Anyone have any suggestions as to how I can implement it?

--George
Dr.Backtick` is offline   Reply With Quote
Old Jan 9th, 2006, 2:37 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
You could sign the content with an RSA public key, and that would ensure the file isn't trivially modified.

Realistically, however, if you store your game data locally, then all you can do is make it difficult for people to cheat. You cannot make it impossible.
Arevos is offline   Reply With Quote
Old Jan 9th, 2006, 4:11 AM   #3
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
It depends on what kind of game it is. In first-person shooters (FPS) things are dealt with differently than with role-playing games (RPG).
You could take a look at how other games do it, for FPS look at Counter-strike, ask how VAC and Cheating Death works.
For RPG take a look at World of Warcraft that hass Warden.
VAC, Cheating Death and Warden are all pretty thoroughly tested.
There are a lot of other games, which may have similar or even better methods. Ask a gaming forum.

One last bit of advice, on FPS don't take the response time that it takes to kill a person, this was tried in Counter-strike, and random swings and clicks on the button resulted in innocent bannings.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Jan 9th, 2006, 9:40 AM   #4
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
Personally, I don't see the point of making an anti-cheat system. If users of the game want to cheat, it is their problem, isn't it?
Polyphemus_ is offline   Reply With Quote
Old Jan 9th, 2006, 9:47 AM   #5
badbasser98
Hobbyist Programmer
 
Join Date: Mar 2005
Location: United States
Posts: 124
Rep Power: 4 badbasser98 is on a distinguished road
Quote:
Originally Posted by Polyphemus_
Personally, I don't see the point of making an anti-cheat system. If users of the game want to cheat, it is their problem, isn't it?
But it ruins the game for everyone that is honestly trying to play it. So then to be competitive, more and more people begin to cheat. Then what do you have? A wothless game that no one enjoys playing. I see the point perfectly to create anti-cheat software.
__________________
Learning to use C++ and loving every minute of it.
badbasser98 is offline   Reply With Quote
Old Jan 9th, 2006, 10:46 AM   #6
Dr.Backtick`
Newbie
 
Join Date: Dec 2004
Posts: 16
Rep Power: 0 Dr.Backtick` is on a distinguished road
Well, I can tell you now that it is going to be a 2d game and not 3d. We think we may or make it a platform based game I suppose like Mario but we havent decided. So, you think CRC is a bad idea? I might consider the RSA one.

Thanks for your replies

--George
Dr.Backtick` is offline   Reply With Quote
Old Jan 9th, 2006, 10:59 AM   #7
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
you might not want to make an anti-cheat system for your first game you make... im not saying that it wont happen, but since it will only be your first i highly doubt someone will even bother to take the time to create a hack or cheat for it.. especially since it's going to be 2d. It's good practice though for later on i guess.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old Jan 9th, 2006, 12:14 PM   #8
Dr.Backtick`
Newbie
 
Join Date: Dec 2004
Posts: 16
Rep Power: 0 Dr.Backtick` is on a distinguished road
its not really my first program or game attempt i've made. Its just that i'd like to implement a system of that sort into the program. CRC seemed like the way to go. Since it seems that each program pretty much has a different polynomial value. It changes whenever the file is modified. I think modern games use CRC32 also. Mainly from what I understand is that the first thing with CRC you must do is generate the lookup table. Then you must read the file in and retrieve the unique value. But maybe I could just generate the CRC value for the game content file and have it stored hard coded and just to check the value in the code that I have stored against the current value.


Another part we think the game should have is a high score system. I had originally considered mysql as a method of storing the scores. I didnt want to have the scores stored in a flat text file on the local system. Then when I looked more into it I thought nah, I shouldnt use mysql because I would have to lower the security settings on it and make it more open. That would not be good.
Dr.Backtick` is offline   Reply With Quote
Old Jan 9th, 2006, 12:14 PM   #9
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
I should have said that anti-cheat software only works (and makes sense) when playing online games. If you are making an interactive platform game like Mario then you would have to look on what to prevent. You will want to prevent teleporting, getting more guns/ammo/lives or any other 'equipment' and flying for example. CRC is checking whether data came to the other side without missing (too much) data. You might want to do some encryption indeed.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Jan 9th, 2006, 7:37 PM   #10
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
1. If the user downloads/purchases the game, then don't be a content nazi. They cannot use the content without your permission, but modifying game content is not only common but a good way to increase user involvement and playability. You don't have to release any file formats or specs...they will figure it out if they want to. Or you could be like Valve/Epic Games/Bioware/etc and release the developer tools for free with the game and have insane amounts of user content...

2. Redundancy checking on files is useless. What? My file doesn't match the CRC? Oh noes!one1 That means I have to change the locally stored expected CRC. Gasp. The server is requesting the military grade SHA-1 hash of the map? OMG, I have to replay the known good hash to the server.

3. Clientside anti-cheat detectors are borderline useful, but only a stopgap solution. Where to begin. First off, how do you plan to detect them? Enumerate the processes attached as debuggers you say? That's right, they have no right to touch my precious memory! Check for known "bad guy" processes? Right. Slows ya down, sure, but our friends at Sony have kindly provided a rootkit that hides processes with image files beginning with $sys$ World of Warcraft had a slight inconvenience with that little tidbit. Or you could use a real rootkit. That brings me to #4

4. Kernel mode. There's that sad fact that there is some code with higher priveleges than you that can stomp on your memory, bounce your api calls off satellites, and steal candy from defenseless orphans. Rootkits fall into this category. But this broadens your view of the fact that you do not control the computer.

Move server side. I advise that you download the source code for an open source game known as BZFlag. Nice 3D tank shooter. However, the server is mostly a relay while the client can do whatever it feels like. An example. A classic BZFlag cheat is to notify the server that a shot has exploded...except that it isn't one that you fired. Being a good relay, it kindly notifies the other clients that the shot has exploded. I took some liberties with the idea. Whenever notification of a shot arrives, my client ends the shot. Mapped that to a key to toggle that. Suddenly, everyone was wondering why their bullets disappeared at the end of their barrels. Commenting out the line that notified the server that you died was entertaining as well. So was turning off gravity.

Moral of the story? Everything that the client sends is a risk. Online login form? SQL injection. Multiplayer game? Send something that shouldn't work that does (or conversely don't send something when you should). The server is authoritave. The only way to change the experience of the other players is if the server notifies them. The only way to change your own data, be it health mana ammo or otherwise, is if the server thinks so. You accomplish this by maintaining state on the server (why BZFlag is an example of bad practice) and by doing insanely large amounts of sanity checking. More sanity checking than makes sense. If somewhere down the line you realize that you disallowed something that needs through (such as a future modification), that's when you change it. Whitelist versus blacklist. Methods on objects along the lines of canFire or canCastSpell can help make this more maintainable. What you do with sanity checking depends on several things. Can the problem be attributed to lag (ex trying to fire shortly after being killed)? Ignore it, but make sure the client stays in sync. Is it something that should never, ever happen (attempting to learn a skill that is blatantly disallowed by the rules, such as a level 1 wizard taking Epic Spell Focus in D&D)? Disconnect or ban.

You'd be surprised how much you can learn just by observing the behavior of games and game servers, be it learning about defense from cheating or good practice in general. THe Neverwinter Nights server was smart enough to reject my attempt to break D&D 3rd edition rules while levelling up, even though that is the client's job. World of Warcraft scales player updates based on distance, apparent by the jitter of party members on the world map that are on the other side of the zone (update every few seconds) versus those near you (smooth, at least once a second). The Source engine used in CS:S and HL2:DM at one point allowed a command to be executed by the client that allowed them to spawn effects. Picture strobe lights and skulls appearing from nowhere.

I could prattle on about the ins and outs of multiplayer game design. All in all, be careful on the server, but the client is uncontrollable. Who cares if they piss in their own sandbox when nobody else is around?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:28 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC