[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

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.

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?

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.