I was thinking of a text based game where the users type in various "things." But I know it will quickly degenerate into filth. Is there any way to stop something like this?
|
|
Users determined to use inappropriate words can be very creative in getting around even quite sophisticated automatic systems. Imagine you want to block the word, "pear". Can your filter deal with deliberate misspellings like "pair"? And what about false positives, like "appear"? What if the user's real name is actually "Pearson"? But offenders start using the player's name in place of "bad words"? There are, however, several techniques that can help. The idea is not to prevent offensive behaviour, but rather to take the fun out of it.
None of these suggestions will outright prevent bad words, but they can go a long way to helping you keep your game clean. |
|||
|
|
|
One simple option is to have a text file that contains a list of all words and phrases that you want to block. Scrub the input prior accepting it by checking it against the list of words in that file. File contains:
Then scrub the input like so (pseudocode):
If |
|||||||
|
|
It's effective in these kinds of systems to show the original words to the user who made the input, but the scrubbed version to everyone else. |
|||||
|
