Skip to main content

Robotic Shooter Game • From DIY to Unreal Engine 5 Masterpiece!


Previously, when we showcased our initial project at the national science fair, we presented "Armball Mania," a novel and intuitive sensor-controlled game. This project utilized an accelerometer connected to a compact Arduino Nano, with serial communication enabling the transfer of orientation data to an Unreal Engine game. The game's objective was to balance a ball on a football field and score goals by manipulating the field's orientation with the accelerometer mounted on a DIY glove worn by the user.
The project was a hit at the fair in Kolkata, drawing long lines of enthusiastic students and children eager to experience the game. Despite the success, we encountered significant challenges with the accelerometer. The sensor's sensitivity to minute hand movements caused jittery and unstable outputs, making the gameplay less smooth and precise than desired.
To overcome this, we decided to upgrade to a gyroscope. The gyroscope provided a remarkable improvement in accuracy, responsiveness, and overall smoothness. After some calibration and optimization, we were impressed by its performance, marking the beginning of the next chapter: "Armball Mania NEXT."

 


During the initial testing phase of "Armball Mania NEXT," we rigorously evaluated the new gyroscope's performance within the original game's framework. Our goal was to assess the gyroscope's responsiveness and output accuracy in a familiar environment. Using the trusty old Arduino Nano, we meticulously calibrated the sensor, ensuring it was fine-tuned for optimal performance.
To achieve this, we implemented auto-calibration directly into the codebase, allowing the device to adapt dynamically to various scenarios. We delved deep into the existing code, making necessary modifications to enhance responsiveness and smooth out any inconsistencies. Our testing process was comprehensive, involving numerous iterations to identify and resolve edge cases that could potentially disrupt gameplay.
As we meticulously tested the gyroscope, we discovered that its precision and stability far surpassed our expectations. Each tweak and adjustment brought us closer to a flawless experience. The gyroscope's capability to provide accurate, real-time feedback without lag or jitter was nothing short of revolutionary.
This phase of testing was not just about ironing out bugs; it was about refining every aspect of the system to deliver an unparalleled user experience. We were driven by the excitement of seeing our vision come to life and the mystery of discovering how far we could push the boundaries of what this technology could achieve. Every test brought us a step closer to creating a game that was more immersive, engaging, and intuitive than ever before.

However, using the Arduino Nano was not our ultimate goal. While it provided a smoother experience than before, we sought something even faster, smoother, and far more convenient. We needed to eliminate the cumbersome wires and the reliance on serial communication to transmit data. Enter the ESP32—a microcontroller with built-in Wi-Fi capabilities, enabling us to wirelessly transmit data.
Transitioning to the ESP32 required a complete overhaul of our code. The previous method of data transmission was neither optimized nor efficient. We decided to bundle the orientation data into a JSON string and transmit it over Wi-Fi. This change not only modernized our approach but also significantly improved performance. The ESP32 allowed us to achieve unprecedented accuracy and speed, making the entire system much more convenient. The data now streamed seamlessly over Wi-Fi, reducing latency and enhancing the overall user experience.
Getting everything up and running wasn't without its challenges. We spent considerable time ironing out bugs and optimizing the system to ensure the data was transmitted with blistering speed and minimal latency. This involved setting up socket communication using UDP in Unreal Engine 5—a task that was initially problematic but ultimately successful. We chose UDP because it is ideal for scenarios where speed is paramount, such as real-time gaming.

Previously, our system operated on a feedback loop where Unreal Engine would request data via serial communication, and our microcontroller would respond with the XYZ orientation data. With the new approach, our microcontroller continuously broadcasts the data using UDP, allowing Unreal Engine to pick it up as needed. This method proved to be far more efficient and faster, as it eliminated the need for repeated requests and responses. The data streamed effortlessly, ensuring a smooth and immersive experience for the player.
This transition to the ESP32 and UDP broadcasting marked a significant milestone in the development of "Armball Mania NEXT." The new system not only enhanced the game's performance but also provided a glimpse into the future of seamless, wireless interaction between hardware and software. Each breakthrough brought us closer to realizing our vision of an intuitive and engaging gaming experience.

Old Armball Communication

Old Armball Data Transmission

New Armball Communication

New Armball Data Transmission

After thorough testing, it was time to elevate the game. The previous version featured a single-level football field that players could balance, but we aspired to create something far superior. The old, dull grey graphics were uninspiring. We envisioned a vibrant, visually stunning experience, complete with cutting-edge graphics and engaging gameplay. So, we decided to rebuild everything from scratch using Unreal Engine 5, leveraging its advanced capabilities to create an entirely new environment.
Our first concept was to design a beautiful, soft, and cozy room—a pinkish, charming space that felt inviting and delightful. The centerpiece of this room would be a matching pink football field, unlike any field seen before. This field would feature dynamic elements like physics-based animations, hanging decorations, and sophisticated lighting. The entire room would be meticulously decorated to ensure it was not only fun to play in but also visually appealing.
We started by developing all the cute, soft models in 3D Studio Max. Every detail, from the furniture to the decorations, was crafted to fit our vision. Once the models were ready, we imported them into Unreal Engine 5, where we meticulously textured them, set up the lighting, and placed everything perfectly within the environment.
In this updated version of the football game, the room's theme was inspired by a locker room—a fitting choice given the football context. This locker room, however, was not the gritty, industrial type one might expect. Instead, it featured a cute window with potted plants, minimalistic and smooth lighting, and RTX (ray tracing) technology enabled to achieve stunning visual effects. The LED light strips hung from the window and ceiling, casting soft, colorful illuminations that interacted beautifully with the walls. A shelf in the distance, slightly blurred to keep the focus on the central football field, added depth to the room.
The floating football field in the middle of the room was a masterpiece. It was adorned with charming tiles and goalposts that floated with a slight, intentional latency, adding a layer of challenge and intrigue to the gameplay. The field was free of traditional markings, emphasizing its whimsical, fantastical nature. The football itself was redesigned to be cute and minimalistic, enhancing the overall aesthetic. When the ball dropped to the ground, it behaved with remarkable realism, its movements governed by advanced physics simulations.
This new environment was not only visually stunning but also deeply engaging. The combination of vibrant colors, smooth animations, and realistic physics created an immersive experience that was both fun and mesmerizing. Every element, from the floating goalposts to the soft lighting, worked together to transport players into a delightful, captivating world.

With the vibrant environment taking shape, our attention turned to refining the sensor and integration aspects of the project. Previously, our setup relied on two breadboards and a tangle of jumper cables to connect the sensors and the microcontroller. This prototypical approach was prone to loose connections and instability—issues that were unacceptable for a polished, production-ready system. We needed a more robust, reliable solution that minimized errors and could be presented confidently to both the public and potential partners.
To achieve this, we decided to move away from the breadboard prototype and create a custom, soldered circuit board. This would involve using single-thread, solid-core wires and header pins to connect the microcontroller and sensors securely. Header pins are particularly advantageous because they allow us to remove and replace the components as needed, ensuring flexibility and longevity of the setup. This way, the components wouldn't go to waste and could be easily reconfigured for future iterations or projects.

The plan was to solder header pins onto a breadboard, creating a DIY prototyping board tailored specifically for our project. This board would house the ESP32 microcontroller and the various sensors, securely connecting them with single-thread wires running underneath. This setup would not only be more stable but also allow us to detach and reattach the components effortlessly for further experimentation or updates.
I began by ordering all the necessary components: header pins, single-thread wires, a soldering iron, and solder. Once the materials arrived, the meticulous process of assembling the circuit board started. First, I soldered the header pins into place, ensuring they were securely attached to the breadboard. Next, I carefully connected the headers using single-thread wires, meticulously routing each connection to avoid any potential short circuits.
Soldering requires precision and attention to detail. Each connection had to be solid and stable, with no loose wires or cold solder joints that could lead to disconnections. Additionally, I had to ensure that no wires crossed paths or touched each other, which could cause short circuits and potentially damage the components. This painstaking process involved applying the right amount of solder to each joint and using the soldering iron to create strong, reliable connections.
As the circuit board took shape, it became clear that this approach would significantly enhance the project's reliability and functionality. The securely soldered connections provided a stable platform that was far less prone to the issues that plagued our initial breadboard prototype. Moreover, the use of header pins meant that the ESP32 and sensors could be easily swapped out or reconfigured, providing the flexibility needed for ongoing development and experimentation.
In the end, this custom circuit board was not only a significant technical improvement but also a crucial step towards making the project production-ready. It provided a solid foundation for integrating the sensors and microcontroller, ensuring that the system would perform reliably during presentations and in real-world applications. This meticulous attention to detail and commitment to quality underscored our dedication to creating a truly exceptional product.

After completing the custom circuit board and ensuring its reliability through rigorous testing, we were ready to move on to our next game concept. This new game promised to be both unique and engaging. The idea was to create a scenario where players would defend a kitchen from an invasion of bees. The kitchen would be meticulously designed with a realistic and inviting environment, complete with windows through which the bees would enter, buzzing around the room.
The objective of the game was to control a cannon-like gun, using our sensor technology to aim and shoot at the bees. However, aiming alone wasn't enough; we needed a mechanism for firing the cannon, which led us to integrate a joystick into our setup. This addition would allow players to not only control the cannon's aim with the gyroscope and ESP32 but also use the joystick to shoot at the bees, adding an extra layer of interactivity and fun.

Integrating the joystick involved some additional planning and modification to our existing setup. The joystick needed to communicate seamlessly with the ESP32, sending input data that would be interpreted by the game to control the firing mechanism. This meant updating our code to handle the new input and ensuring that the joystick's signals were accurately read and transmitted without any lag or errors.
We began by selecting a suitable joystick that was responsive and durable, capable of providing precise control for the game. Once we had the hardware, the next step was to incorporate it into our custom circuit board. This required soldering additional header pins for the joystick and carefully connecting it to the ESP32 with single-thread wires. Each connection was checked and double-checked to ensure there were no loose wires or faulty solder joints that could cause issues during gameplay.
With the joystick integrated, we turned our attention to the software side of things. The game's code needed to be updated to interpret the joystick's input, translating it into firing commands for the cannon. We wrote new functions to handle the joystick data, ensuring that pressing the joystick button would result in a smooth, immediate firing action in the game. This involved fine-tuning the sensitivity and responsiveness to ensure that the cannon would fire accurately and promptly when the player pressed the joystick.

As we tested the new setup, it quickly became apparent that the addition of the joystick significantly enhanced the gameplay experience. The combination of the gyroscope for aiming and the joystick for firing provided a more intuitive and engaging control scheme. Players could easily aim the cannon at the bees using natural hand movements and then press the joystick to shoot, making the game feel dynamic and immersive.
The kitchen environment, brought to life with detailed textures and realistic lighting in Unreal  Engine 5, added to the overall experience. Bees buzzed around the room, requiring players to stay alert and react quickly to defend the kitchen. The game not only challenged players' reflexes and coordination but also provided a visually appealing and entertaining setting.
This new game concept demonstrated the versatility and potential of our sensor-based control system. By integrating the joystick and refining our setup, we created a game that was both fun and technically impressive. It showcased our ability to innovate and push the boundaries of what was possible with our technology, setting the stage for even more exciting projects in the future.

 


To control the cannon in our new game, we needed a joystick for firing while retaining the gyroscope for orientation and movement control. This dual-control approach seemed ideal, allowing for a nuanced and responsive gameplay experience. The gyroscope would handle the aiming, and the joystick would handle firing, including controlling the rate of fire.
To integrate the joystick, I returned to the prototyping board. I inserted another header and carefully soldered and connected the necessary wires to the ESP32. This joystick was a simple module, but it was crucial for the control scheme we envisioned. With the hardware setup complete, I moved on to updating the software.
I rewrote portions of the code to include the joystick's inputs. This wasn't overly difficult, as the modular nature of our setup allowed for relatively straightforward modifications. The data format we were using, JSON, needed to be updated to include the joystick values. Now, in addition to the gyroscope's XYZ orientation data, the JSON string also contained the XY values from the joystick and a boolean indicating whether the joystick button was pressed.
The prototype board now featured the gyroscope, the ESP32, and the joystick, each with its own header, properly soldered and connected underneath with wires. This DIY circuit board was designed for flexibility: each component could be removed or replaced as needed, making it perfect for ongoing development and testing.
In terms of wiring, the video shows a single wire connected to the ESP32 microcontroller board. This wire is used solely for uploading code to the ESP32 and powering it during testing. In the final production stage, the device will be powered by a battery, eliminating the need for this wire. It's important to note that this wire does not transmit data to Unreal Engine; it is purely for power and code uploads during development.
This setup allowed us to seamlessly integrate the joystick with our existing sensor system, creating a robust and flexible control scheme for the game. The joystick's values were now part of the data stream sent to Unreal Engine, enabling precise control over the cannon's firing rate and direction. This integration not only enhanced the gameplay experience but also demonstrated the versatility and expandability of our custom sensor platform.

After finalizing the joystick integration and completing the DIY prototype circuit board, I shifted my focus back to the 3D development and modeling of the kitchen environment for our game. We meticulously added various kitchen elements such as cupboards, fridges, and shelves to create an authentic kitchen vibe. These details were crucial for immersing players in the game's environment.
Looking ahead, we planned to incorporate breakable objects like plates and utensils into the kitchen scene. When the ball collides with these objects during gameplay, they will shatter in real-time, enhancing the satisfaction and realism of the experience.
Next, we turned our attention to designing the bees themselves. The bees were designed to be cute yet believable, featuring black eyes, a textured body, and minimalistic wings. Animating the wings and coding their behavior to fly around the kitchen area naturally was a fun challenge. We ensured that the bees would move randomly with a slight delay, providing players with opportunities to aim and shoot.
At any given time, there were five bees flying around the kitchen. When a bee was hit, it would realistically fall and disappear, only to be replaced by a new bee flying in through the windows. This spawning mechanism added dynamism to the gameplay, ensuring that players always had targets to engage with.
Speaking of controls, the sensor's movements controlled the cannon's orientation: tilting left or right moved the gun horizontally, while tilting forward or backward adjusted its vertical position. We intentionally slowed down the vertical motion to add a layer of realism and challenge to aiming.
Meanwhile, the joystick's sensitivity played a crucial role in controlling the cannon's firing rate. Slight movements of the joystick resulted in balls with lower velocities, while pushing the joystick further increased the projectile speed. This sensitivity allowed players to fine-tune their shooting strategy based on the bees' movement patterns and the game's pacing.
Overall, integrating these elements—detailed kitchen environments, interactive bees with realistic physics, and responsive control schemes—created an engaging and immersive gameplay experience. Each component contributed to making our game not only enjoyable but also challenging, ensuring that players would have fun while honing their shooting skills in the whimsical kitchen setting.



As we approached the final stages of development, we refined the DIY prototype circuit board to ensure it was user-friendly and portable. Adding a small vibrator was the finishing touch, enhancing immersion through haptic feedback. Whenever a bee was hit or the cannon fired, the vibrator provided subtle vibrations, heightening the player's sense of engagement and realism.
In collaboration with Unreal Engine, signals were set up to trigger the vibrator accordingly, syncing seamlessly with gameplay events. This integration not only added tactile feedback but also enhanced the overall experience, making each interaction with the game environment feel more lifelike and responsive.
With these final adjustments completed, our innovative kitchen-themed game was ready to captivate players with its blend of detailed environments, interactive challenges, and immersive feedback mechanisms. Whether aiming at buzzing bees or admiring the intricacies of the kitchen setting, players were sure to enjoy a dynamic and engaging experience from start to finish.



Comments

Popular posts from this blog

A Multipurpose Mini Desktop Assistant Robot

       We have named it 'Cookie Bot' 🍪 Cookie Bot is a multipurpose mini desktop assistant robot that you can control with your voice when needed but also has a mind of its own ! It uses a combination of AI, Machine Learning, and speech recognition to control its movements and actions based on different situations and surroundings. Users can interact with the robot through voice commands and its voice assistant artificial intelligence system allows it to detect and understand user commands in different natural languages including English and Hindi !  Cookie Bot acts lively, moves around on its own using a path finding algorithm to navigate and avoid obstacles while responding to different commands from the user. The Cookie Bot uses a LIDER sensor to detect objects in its path and a Ultrasonic sensor to sense objects and objects in its surrounding environment. Here's a video of the first working prototype : Prototype 1 : December 15th, 2022 Prototype 1 : Projec...

Search and Rescue Deployable Assistant

   The Project Proposal Objectives : The future calls for a safer, more efficient, and reliable habitable environment for everyone throughout the globe - an attack, accident, and disaster-proof infrastructure with zero casualties in such events. But if there are any, we need to have the technology and resources to combat such situations. SARDA is a deployable robotic unit intended to help first responders in such crucial situations to carry out search and rescue operations in dangerous environments.  When deployed into the disaster site, it helps to map and render a dynamic color coded 3D model of it's immediate surrounding along with data like temperature and humidity ; Which, not only aids the rescue team to better navigate the terrain but also informs us in case of fire and smoke along with it's exact location. This digital twin can also be overridden with manual control, providing us with an efficient two-way communication system. The Deploy-able unit ...

Morse code Broadcaster App & Receiver using Arduino

Me and Sayanti Chatterjee had been working on this for over a month now.  This was really an ambitious project and we tried to pull off something big ! The app takes in a string of words - encodes it into Morse code and broadcasts it in form of light pulses using the phones flash light in accordance with both of the frequency parameters. Changing those parameters changes the speed of the broadcast. On the other end there's a Arduino with a photo-resistor which keeps sleeping and wakes up only when senses the first light pulse. ( So, basically it's a auto on/off feature ) which receives and reads those light flashes, processes it and decodes it into it's original form. ( Again, in accordance with those parameters ) Displays it and goes back to sleep ! This is how wireless data transfer works ! It's just a simplified form of a WiFi or a cell tower. We've recreated a model wireless communication system from scratch !  What is the most important skill that you can have...

Homemade 2-axis gimbal using Arduino

  I present to you the cheapest camera or object stabilizer in the whole world ! A 2-axis gimbal that keeps an object steady in a certain position despite the movement of the base on which it is mounted. This means when the base keeps changing its position constantly, the object will remain stable and there won’t be any change in its position. It all started with my new ADXL345 and I thought to myself why not try and build a hand-held gimbal at home since these things are rather costly out there. So, I fired up max and as usual started working on the digital prototype or the blueprint. I had a few servos left from the previous project that I worked on and two of them were enough for this simple stabilizer. And I have learnt from my mistakes ! Knowing that these servos won't be able to put up with so much, I designed the frame in a way that would fairly distribute the load away from the motor. With all this in mind, I roughly designed the whole thing and tried to make i...

Ball Game using Accelerometer & Arduino

   Project Proposal PDF : Armball Mania Project Proposal I was recently experimenting with serial communication between Arduino and ue4 and suddenly had this urge to make a fun sensor controlled game . Something different and intuitive ! Now, I remember that I had the ADXL from my previous project which had become one of my favorite sensor ! - and I knew exactly what to do. I know, I know. Why am I using an accelerometer ! Using a gyro would've been a better idea. And you're right, That's the intuitive part !    The Arduino Part Before everything, I needed to test if it even works. So, I created a demo project, where I would control the pitch yaw and roll of a flat rectangular object with live inputs from the sensor which Will be in the users hands. Serial communication was a bit tricky. And I needed to open and close the ports dynamically so that I can change it on the go. After a bit of tweaking, I got it to work ! To summarize the protocol in English, ...

DIY Contactless Mist Sanitizer

  Today I'm going to show you how I turned a broken pocket mist generator into: A Contactless Mist Sanitizer Machine  in just one day. Sounds cool, right? Let's get started ! First, let me explain what a pocket mist generator is. It's basically a device that sprays a fine mist of liquid, usually water or sanitizer, to moisturize or disinfect your skin or surroundings. It's handy and portable, but mine stopped working after a few months of use. So I decided to open it up and see what's inside. To my surprise, I found out that it doesn't use any heating element or pump to create the mist. Instead, it has a tiny diaphragm that vibrates at a very high frequency, around 100 kHz, and breaks the liquid into tiny droplets that form the mist. This is called ultrasonic atomization, and it's very efficient and quiet. I wanted to control this diaphragm using my Arduino Uno, but I couldn't generate such a high frequency with it. So I had to use the origi...

DIY LiDAR SLAM Robot from Scratch

    Showcase & Documentary  1. Deep Learning Based Calibration  2. ICP Based Odometry & Positioning (Manual)  3. Path-Finding using A* Algorithm & Traversing (Manual) 4. Automatic Navigation & Path-Finding 5. Complete Autonomus Navigation With Feedback Loop  Download Vagabond:  https://github.com/Kawai-Senpai/Vagabond/ Welcome to this exciting exploration into the world of SLAM—Simultaneous Localization and Mapping. Most people working on SLAM typically rely on Robot Operating System (ROS) and predefined libraries, using simulations instead of real-world scenarios. But we decided to take a different route. We believed that if we wanted to truly master SLAM, we needed to do it the right way—from scratch. Rather than using pre-built templates and libraries, which can be picked up at any time, we challenged ourselves to build a SLAM system manually. Now, we didn’t have the budget to buy a professional LiDAR sensor, which can be quite expen...

Miniature Remote controlled Robotic Arm

    A remote controlled cute little miniature version of a robotic arm which can sit on your table and pick up your eraser when you drop it. I've always been fascinated by Industrial Robotic arms. They are so simple yet complicated ! And I wanted to try and make one from the ground up without any help. Kind of wanted to simplify it and work with what I got. Planning At the moment, I had only two servos and 1 stepper motor. So, I needed to build the whole thing with nothing but those. So, I fired up Max and started working on the blueprint.     It's like a prototype that I like to create virtually - Which give me the Idea on How the real thing should be built ! And also, I can change stuffs easily here if things dont work out and improve the overall model if I need to. So, I found a way to create a cute little robotic mechanical arm with only the things I got. This would be able to pick up things with the help of that mouth and move ut around. Pretty simple...

AI-Powered 6-DOF Robot in Unreal Engine

      Waste management has become one of the most pressing issues of our time, and innovative solutions are needed now more than ever. What if we could blend the precision of robotics with the power of AI to create a system that not only automates waste segregation but also bridges the gap between virtual simulations and real-world applications? In this documentary, we’ll take you behind the scenes of a groundbreaking project: the development of a 6-degree-of-freedom robotic arm designed for waste segregation, all simulated within the immersive environment of Unreal Engine. The journey began with the idea of creating a robotic arm that could mimic human movements with high precision. To achieve this, we focused on developing a 6-degree-of-freedom (6-DOF) system, allowing the arm to move in any direction, rotate, and grasp objects as efficiently as a human hand. But building this complex system wasn’t just about mechanics—it was about crafting a seamless interaction betwee...