The following plugins were developed as part of the ENHAGA project. They are useful tools for game developers looking to add anti-harassment functionality to their online games.
ENHAGA Chat is a text chat system that utilizes Matrix (matrix.org). Matrix is an open standard for interoperable, decentralized, real-time communication. It is an open-source alternative to centralized communication platforms such as Messenger, Viber, Telegram and Discord. In Matrix, users do not connect to a centralized server for their communication. Instead, they create and run their own server called a homeserver. Different homeservers can communicate using the Matrix protocol allowing for decentralized communication. This is similar to how email users of different email providers can communicate over the common email protocol.
Matrix is an attractive solution for providing text communication in games. Since it is open-source, the chat system built for one game can be shared and incorporated in subsequent games from other developers. This eliminates the need to re-implement text communication in every game, which is the common practice today. Another attractive feature is extensibility. Creating extensions for proprietary communication platforms such as Viber ranges from difficult to impossible. Matrix, due to its open access nature, is ideal for implementing features as addons. Such tools can include monitoring, censoring and removing offensive content in order to combat online harassment. Also, as it does not rely on third-party providers, Matrix is economic to setup for small, independent game studios. The Matrix protocol is an open specification. This creates possibilities that are not present in current games. For example, with Matrix it is possible to use the same chat program to interact with the different Matrix servers. In this way, players can communicate with their friends across different games and can chat with their game friends outside the game if they wish.
A possible roadblock for game developers looking to use Matrix as their com- munication platform for their games is the complexity of running their own Matrix server. To make the process easier we created a setup script that installs a Matrix server (Synapse) with common parameters preconfigured. We also provide a script for running the server in Docker.
Matrix has a number of clients available (matrix.org/clients/). However, most online games will want to embed the chat communication inside the game. To make this process easier, we created a reference client implementation for Unity which enables communication between the game and the Matrix server. The plugin is delivered as a bare-bones set of functions that should be easy to integrate to existing UI systems in various games.
Both the server setup scripts and the Unity plugin can be found in this repository:
ENHAGA Text Filter
Text filtering is an effective first line of defense against online harassment. Although various implementations exist for filtering text, it is often difficult and time consuming to integrate them into online games. The ENHAGA text filter plugin is an easy-to-use tool that can be easily incorporated into any game that requires text filtering capabilities.
The ENHAGA text filter is a standalone app, written in Python, that runs alongside a game and filters inappropriate text. It provides two functions: profanity censorship and toxic text prediction. Game developers can run the ENHAGA text filter together with their game and use it to filter text coming from their users.
To do that, the game can access the ENHAGA text filter using REST calls. To access the filtering capabilities the game can make GET requests to:
http://127.0.0.1:8000/censor/[text to filter]
This will return the text with profanities overwritten with asterisks. In this way, games can trivially implement filtering by passing their text to the ENHAGA filter before showing it on the screen.
The ENHAGA Text Filter also provides the ability to gauge the toxicity of a sentence. This can be useful when a game does not want to directly filter text but would still like to identify offensive users for intervention. It is also useful for identifying offensive behavior that does not use profanities.
Toxic text prediction works similarly to filtering. The game sends the text to be examined using a GET request:
The program will reply with a list of scores that indicate the intent behind the sentence:
Similar sentence but different context:
http://127.0.0.1:8000/toxicity/I have cancer
Based on the scores returned by the ENHAGA tool, the game can take further actions such as issuing a warning, muting or banning a player. The system is more nuanced than simple profanity filtering which can be desirable in many situations.
In the above examples the tool is running alongside the game on the same machine. In cases where this is not possible, such as in mobile games, the tool can be easily configured to run on a server and be accessed via the internet.
The ENHAGA Text Filter source code and usage instructions can be found here: