Boosting your Roblox Game with Amazon Q and Amazon Bedrock
How to create a serverless Java Quarkus backend in minutes using Amazon Q Developer to access LLM's and empower your Roblox game with genAI.
Vinicius Senger
Amazon Employee
Published Nov 8, 2024
Last Modified Nov 9, 2024
This article explains how I developed a simple Java backend application using the Quarkus framework to connect with Amazon Bedrock and integrated it with Roblox by creating a custom chat command, "bedrock." This command enables players to interact with large language models (LLMs) directly within the game, opening up endless possibilities by combining generative AI with gaming experiences.
Before we get ours hands dirty with code, let me share an opportunity...
We are promoting a hackathon called "AWS Game Builder Challenge" where you have the opportunity to build a game from scratch or using a platform like Roblox / Minecrat with AWS Services and using Amazon Q Developer to accelerate the development process. We have U$150,000 in prizes available, don't miss the chance to build something cool, have fun and may win prizes, join now on DevPost: https://awsdevchallenge.devpost.com.
You can also check other posts related to game building:
Let's start coding!
Make sure you hava Java / JDK and Quarkus installed, and then create and build a new Quarkus application by typing the following commands in a terminal:
You should build your project successfully:
Amazon Q Developer is a VS Code / Jetbrains plugin that brings genAI to your daily coding and can improve your productivity and learning process in different ways:
- Chat & in-line chat: you can ask it to explain some code, generate unit testing or general questions about your programming language
- /dev: AI agent that you can ask to complete development tasks as you will see bellow
- /transform: AI agent that can upgrade your Java 8 project to Java 17
For this Roblox development I used /dev agent asking to create an Amazon Bedrock API Access into my existing Quarkus sample project; basically I opened the created Quarkus project in my Visual Code with Amazon Q plugin and did the following prompt:
"add to my @workspace inside my quarkus project, a new Sample REST class called BedrockResource with a simple access to Amazon Bedrock using "Human: Hello, Bedrock!\n\nAssistant:" as prompt. Use jakarta.ws packages for REST and also update my pom.xml dependencies to use Amazon Bedrock runtime Java API version 2.24.13."
It will add the Amazon Bedrock runtime dependency from AWS SDK in your pom.xml:
And will create the BedrockResource class:
AWS Lambda is a serverless computing model that allow you to run applications without managing servers but before proceeding, make sure you have your AWS account configured with AWS CLI and SAM tool installed.
The Quarkus app is ready to be deployed as fat jar Lambda application; let's rebuild our application:
Create a template.yml file in your project root directory:
Time to deploy it: type sam deploy -g. You can accept all default except "RobloxBedrock may not have authorization defined, Is this okay?" where you need to explicit type Y:
After deploying the stack, you will get the URL in the Value output:
Now you can open your browser and access your URL or type the command:
Now we are ready to start our Roblox integration, your can download the sample Roblox Game here and then open in your Roblox Studio.
Now you can run your Roblox game and try to access the chat typing / and then bedrock:
You can move forward with your own idea by receiving arguments in the chat or using Amazon Bedrock to bring genAI capabilities to your Roblox game.
Feeling inspired? join the AWS Game Builder Challenge and have a chance to build a brand-new, innovative game and to explore the limitless possibilities of game development. Whether you’re a seasoned developer or a beginner, everyone is welcome. You can participate solo or as part of a team—the choice is yours!
Click here for more information, let’s get coding and have some fun!
The possibilities with AWS services, Amazon Bedrock, and platforms like Roblox are endless. From object recognition and sound-based interactions to home automation and dynamic game quizzes, you can use this tutorial to learn, explore, and have a blast building something cool.
Looking forward to keep in touch on linked.in and also in case you need some help... Cheers!
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.