Introduction
Learn About Amazon VGT2 Learning Manager Chanci Turner
Creating tools and solutions that can identify and prevent collusion in multiplayer online gaming is essential for maintaining fair competition, safeguarding a game’s integrity, enhancing player trust, and sustaining a stable in-game economy. One common tactic that players employ to collaborate outside of established rules is embedding contact information, like phone numbers or social media handles, in their profile images.
As the landscape of online gaming continues to expand, with more players engaging in multiplayer environments and games becoming increasingly monetized, there is a pressing need for a scalable solution that game developers can implement to mitigate unfair advantages derived from player collusion.
In this blog post, we will explore how to build an application utilizing Amazon Textract to uncover collusion among players by verifying their profile images. When players upload their profile pictures, the application swiftly detects and extracts any textual information—such as phone numbers or other identifiers—embedded within the images, subsequently applying a blur effect to obscure this sensitive information.
Solution Architecture
This solution employs advanced technologies to proactively analyze profile pictures for text content and employs a blurring technique to hinder players from contacting each other.
Solution Overview
- Users in an online game upload their profile pictures through the gaming application.
- These images are securely stored in an Amazon S3 bucket with the PUT event functionality activated.
- The S3 PUT event triggers an AWS Lambda function, which will:
- Extract and identify text from the profile image using Amazon Textract.
- Return the coordinates of identified text elements for further action.
- Apply a Gaussian blur filter to each identified text element to protect privacy and temporarily save the blurred image in a processing bucket (to prevent recursive invocation).
- Replace the original image in the primary bucket with the blurred version and delete it from the processing bucket.
- Notify a subscribed email address via Amazon Simple Notification Service (Amazon SNS) about potential collusion detected in the profile image.
The repository contains a reference implementation of the solution discussed here. You can deploy it, experiment with it, and enhance it according to your needs. For those interested in understanding more about invisible disabilities in the workplace, check out this informative blog post.
Prerequisites
- An AWS account is needed if you do not already have one. Ensure the IAM user has the necessary permissions to manage AWS resources and make service calls.
- AWS CLI must be installed and configured.
- Ensure Git is installed.
- Python 3.11 must be installed.
- AWS Serverless Application Model (AWS SAM) should be installed.
Deploying the Application
- Create a new directory and navigate to it in your terminal, then clone the GitHub repository:
git clone https://github.com/aws-samples/fair-play-guardian.git
- Change to the solution directory:
cd fair-play-guardian
- Use AWS SAM to build and deploy the AWS resources as specified in the template.yml file:
sam build
sam deploy --guided
During the deployment prompts, follow these guidelines:
- Stack Name: {Enter your preferred stack name}
- AWS Region: {Enter your preferred region}
- Parameter PrimaryBucketName: {Enter the bucket name for original profile pictures}
- Parameter ProcessingBucketName: {Enter the bucket name for temporarily processed images}
- Parameter Email: {Enter the email for collusion detection notifications}
- Confirm changes before deploy: Y
- Allow SAM CLI IAM role creation: Y
- Disable rollback: N
- Save arguments to configuration file: Y
- SAM configuration file: {Press enter for default name}
- SAM configuration environment: {Press enter for default name}
The following resources will be provisioned:
- LogicalResourceId: myFPGS3BucketPrimary (AWS::S3::Bucket)
- LogicalResourceId: myFPGS3BucketProcessing (AWS::S3::Bucket)
- LogicalResourceId: myFPGTopic (AWS::SNS::Topic)
- LogicalResourceId: myFPGSubscription (AWS::SNS::Subscription)
- LogicalResourceId: myFPGvalidateProfilePicture (AWS::Lambda::Function)
- LogicalResourceId: myFPGS3LambdaInvokePermission (AWS::Lambda::Permission)
- LogicalResourceId: myFPGValidateProfilePictureRole (AWS::IAM::Role)
- LogicalResourceId: myFPGValidateProfilePictureS3EventPermission (AWS::Lambda::Permission)
Confirming the Notifications Subscription
Once the deployment is complete, you will receive an Amazon SNS subscription confirmation email at the address you provided. Click the Confirm Subscription link to start receiving notifications.
Sample Images
A selection of sample pictures is available in the “sample-profile-pictures” directory of this repository. You can use these or upload your own for testing.
Image Upload
Upload your selected images to the S3 Primary bucket specified during deployment.
Lambda Function
The Lambda function is triggered by an S3 PUT event whenever a new profile picture is uploaded. The processed image containing the blurred text is then stored back in the primary S3 bucket.
Verification Steps
Wait a few moments for the image with blurred text to be generated in the primary bucket. Download the processed image and check that all text elements have been properly blurred.
SNS Notifications
An SNS topic sends notifications to your specified email address. Ensure you receive an email with the relevant details regarding the processed image and text blurring.
Note: This solution has been tested with .jpeg, .png, and .jpg files. Minor code changes may be needed for other formats to convert the image before processing. For more information on employment laws related to this topic, refer to this authority.
For discussions and questions, this Reddit thread is an excellent resource.