x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[Feature Request] Censoring User Text In Editable Text Box

Hey TFlexSoom Here, I am finishing up my game and I realized through my punk friends that the editable text box has no censoring whatsoever. This means that any committed text could contain foul language and sadly the editable text decides their "in game name" so everyone will see it. I want my game to get a general audience maturity rating but I can't do that if users enters the game as "A* B". You get the point. Anyways while I would write in the censorship code in on blueprint it would be quite expansive (and probably inefficient knowing me), plus I probably would not catch everything. I was wondering if there would soon to come any function (C++ or Blueprint) that would allow for the input of text and the return value Boolean on whether the text is appropriate. I could probably work with anything tbh. Anyways could I get some replies on whether or not this is a respectable request and/or some links to marketplace programs that do this for me. Cheers! -TFlexSoom

Product Version: UE 4.16
Tags:
more ▼

asked Aug 13 '17 at 05:48 AM in Blueprint Scripting

avatar image

TFlexSoom
11 1

avatar image RimmyD Aug 14 '17 at 02:40 AM

I don't know if anyone official will answer this but i doubt seriously they will spend the time to add this feature. It's not really a difficult thing to implement but you would have to come up with your own list of words/etc.

There are a number of services for lists of bad words but the only ones i know of are for web development so may not be of much use to you if you are only blueprint and/or not online.

avatar image TFlexSoom Aug 14 '17 at 07:37 AM

How would you go about implementing something like this then? If it is not that difficult to implement surely you can give me a quick run down?

avatar image RimmyD Aug 16 '17 at 12:39 PM

First you need a database of swear words, a simple version could be a spreadsheet or badwords you import into Unreal as a dataTable whenever you update it. You could populate the spreadsheet from online sources to cut down on use.

Whenever a user submits name/chat you first call a validation function that returns a string that is either the original string or a series of asterisks that replace profanity. Based on the return you can choose to allow/send the data and in what format.

Now, checking the strings is a job best suited to C++ as it's a lot of iteration and would be faster but can be accomplished in a couple of ways in Blueprint fine. I'm honestly not sure what is best but that may be better handled as a separate question to attract more specific attention.

Easiest thing I can think of is to iterate through all bad words and use the subString function to find if it exists. This could be sped up in various ways, like sorting the profanity by size so you don't test against words longer than the given text or creating key:value sets so you can easily test if a word exists (like if profanityArray.poop > -1, etc), as well as removing found words from the input string as you find them to make less work for the next check.

Now efficiency may not be needed for a single name choice, it can be slow and no-one cares because it happens once. The efficiency side is more for text chat, etc. May not know for sure till you try it out.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question