From Idea to Implementation: How Game Developers Can Utilize ChatGPT in Practical Ways
How Game Developers Can Utilize ChatGPT in Practical Ways

Brief overview of ChatGPT and its potential uses in game development

ChatGPT (Generative Pre-trained Transformer) is an artificial intelligence language model that has been pre-trained on a massive amount of text data. It is capable of generating human-like language and can be used for a variety of natural language processing tasks, including text completion, summarization, and translation.

In game development, ChatGPT can be a valuable tool for generating code and providing suggestions or prompts for developers. By inputting a description of a desired game feature or behavior, ChatGPT can generate code that can help developers save time and improve the quality of their work.

For example, ChatGPT could be used to generate code for complex AI behaviors, physics simulations, or other game mechanics. It can also be used to suggest improvements or optimizations to existing code.

While ChatGPT is not a replacement for skilled game developers, it can be a valuable tool to help streamline the development process and allow developers to focus on the creative aspects of game development. As AI and machine learning continue to advance, it’s likely that ChatGPT and other similar tools will become increasingly important in game development and other fields.

Introduction to the specific task of creating floating stones that change speed based on the player’s distance

In an existing game, I was tasked with implementing a group of floating stones that would change behavior as the player moved closer to them. In their idle state, the stones should float smoothly and slowly, but as the player approaches, they should start to jitter more and more.

This required creating a class, implementing dependencies, and other code that couldn’t be achieved through animator controllers or libraries. While this wasn’t a “nightmare” level task, it was still time-consuming. ChatGPT proved to be a useful tool for generating code snippets and saving time in the development process.

Explanation of how ChatGPT can be used to generate code for game development tasks

When working with ChatGPT, it’s important to start with the right context. In my case, I began with a promo message about the technology I planned to use. It’s important to keep in mind that ChatGPT is just a tool and won’t generate ideas or code on its own. You need to provide clear and detailed input for the best results.

That said, ChatGPT can be a real-time-saver. When using the tool, it’s essential to provide a detailed description of what you’re trying to achieve. The more information you provide, the better the output will be. It’s important to note that using ChatGPT should take less time than achieving the same result without it. So, don’t be afraid to put in the effort to provide a detailed description. With ChatGPT, you can streamline your development process and focus on other aspects of your project.

Example prompts and code snippets used to generate the necessary code for this task

Let’s dive into the practical use of ChatGPT. As I mentioned earlier, I started by providing context about my game engine and coding language.

I want to ask you to help us create some code for my game based on Unity SDK, C# code language.

ChatGPT responded kindly, and I moved on to the next step — providing a detailed description of the task and its conditions.

A few words about the context of the task. In the game, players can find floating stones. These stones have random directions of jittering, but this jittering is very smooth. If the player appears within around 10 meters of the stone, the jittering speed becomes faster and the speed depends on the player’s distance to the stone (more if closer).

As a result, ChatGPT provided me with a basic realization of the class I needed to implement. While the code wasn’t perfect, it covered around 80% of what I needed to do.

using UnityEngine;

public class FloatingStone : MonoBehaviour
{
    public float maxSpeed = 1f;
    public float minDistance = 10f;

    private Vector3 initialPosition;
    private float initialSpeed;
    private bool isPlayerNearby;

    private void Start()
    {
        initialPosition = transform.position;
        initialSpeed = Random.Range(0.2f, 0.5f);
    }

    private void Update()
    {
        float speed = isPlayerNearby ? CalculateJitteringSpeed() : initialSpeed;
        transform.position = initialPosition + new Vector3(
            Mathf.PerlinNoise(Time.time * speed, 0) - 0.5f,
            Mathf.PerlinNoise(0, Time.time * speed) - 0.5f,
            Mathf.PerlinNoise(Time.time * speed, Time.time * speed) - 0.5f
        );
    }

    private float CalculateJitteringSpeed()
    {
        float distanceToPlayer = Vector3.Distance(transform.position, 
                                                  PlayerController.instance.transform.position);
        float speed = Mathf.Lerp(initialSpeed, maxSpeed, (minDistance - distanceToPlayer) / minDistance);
        return Mathf.Clamp(speed, initialSpeed, maxSpeed);
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            isPlayerNearby = true;
        }
    }

    private void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            isPlayerNearby = false;
        }
    }
}

Next, I made some corrections — I added context about using Zenject for player injection and refactored the class to align with project conventions. I then asked ChatGPT to use my updated code version and add jittering rotation to the object based on the same conditions.

After this step, I received the final version of the code that I could use in my project. I made some minor changes on my end, and in the last step, I asked ChatGPT to add XML comments to the final class and received the desired result.

The final result of the code


public class FloatingStone : MonoBehaviour
 {
     [SerializeField] private SpeedSettings speedSettings;
     [SerializeField] private float minDistance = 10f;
     [SerializeField] private float amplitude = 0.5f;
     [SerializeField] private float rotationAmplitude = 1f;
     [SerializeField] private new SphereCollider collider;
 
     private Vector3 initialPosition;
     private Quaternion initialRotation;
     private float initialSpeed;
     private bool isPlayerNearby;
     private Transform player;
 
     [Inject]
     private void Constructor(IPlayer player)
     {
         this.player = player.Transform;
     }
 
     private void Awake()
     {
         initialPosition = transform.position;
         initialRotation = transform.rotation;
         initialSpeed = speedSettings.GetRandomSpeed();
         collider.radius = minDistance;
     }
 
     private void Update()
     {
         float speed = isPlayerNearby ? CalculateJitteringSpeed() : initialSpeed;
         Vector3 newPosition = initialPosition + new Vector3(
             Mathf.PerlinNoise(Time.time * speed, 0) - amplitude,
             Mathf.PerlinNoise(0, Time.time * speed) - amplitude,
             Mathf.PerlinNoise(Time.time * speed, Time.time * speed) - amplitude
         );

         Quaternion newRotation = initialRotation * Quaternion.Euler(
             Mathf.PerlinNoise(Time.time * speed, 0) * rotationAmplitude - rotationAmplitude / 2f,
             Mathf.PerlinNoise(0, Time.time * speed) * rotationAmplitude - rotationAmplitude / 2f,
             Mathf.PerlinNoise(Time.time * speed, Time.time * speed) * rotationAmplitude - rotationAmplitude / 2f
         );

         transform.position = Vector3.SmoothDamp(transform.position, newPosition, ref velocity, 0.1f);
         transform.rotation = Quaternion.Slerp(transform.rotation, newRotation, Time.deltaTime * 5f);
     }
 
     private Vector3 velocity = Vector3.zero;
 
     private float CalculateJitteringSpeed()
     {
         float distanceToPlayer = Vector3.Distance(transform.position, player.position);
         distanceToPlayer = Random.Range(distanceToPlayer - 0.1f, distanceToPlayer + 0.1f);
         float speed = Mathf.Lerp(initialSpeed, speedSettings.GetMaxSpeed(), (minDistance - distanceToPlayer) / minDistance);
         return Mathf.Clamp(speed, initialSpeed, speedSettings.GetMaxSpeed());
     }
 
     private void OnTriggerEnter(Collider other)
     {
         if (other.CompareTag("Player"))
         {
             isPlayerNearby = true;
         }
     }
 
     private void OnTriggerExit(Collider other)
     {
         if (other.CompareTag("Player"))
         {
             isPlayerNearby = false;
         }
     }
     
     
     [Serializable]
     private struct SpeedSettings
     {
         [SerializeField] private float max;
         [SerializeField] private float from;
         [SerializeField] private float to;
         
         public float GetRandomSpeed() => Random.Range(from, to);
         public float GetMaxSpeed() => max;
     }
 }

How ChatGPT can save game developers time and improve code quality

ChatGPT is a powerful tool that can help game developers save a significant amount of time and improve the quality of their code. In fact, it can save up to 60–70% of the time needed for task implementation. As a professional developer, I knew how to implement a task from scratch, but still needed to write each line of code, optimize it, and debug it. However, with ChatGPT, I was able to save a lot of time on the first point and focus on the last two points. This is the main idea of my article about using ChatGPT for coding in real life.

In game development, time is a crucial factor. Developers have to work under tight schedules and deadlines. This is where ChatGPT can come in handy. It can help game developers save time by providing them with basic code implementations that they can use as a starting point. With ChatGPT, developers can get a basic realization of the class they need to implement and then modify it according to their needs. Another advantage of using ChatGPT is that it can improve the quality of code. ChatGPT provides developers with different code options that they can use as a reference. This can help developers write cleaner, more efficient code that is easier to maintain and debug.

Latest Articles

March 24, 2025
VR & MR Headsets: How to Choose the Right One for Your Product

Introduction Virtual and mixed reality headsets are not just cool toys to show off at parties, though they’re definitely good for that. They train surgeons without risking a single patient, build immersive classrooms without ever leaving home, and even help to design something with unparalleled precision. But choosing VR/MR headsets … It’s not as simple as picking what looks sleek or what catches your eye on the shelf. And we get it. The difference between a headset that’s wired, standalone, or capable of merging the real and digital worlds is confusing sometimes. But we’ll break it all down in a way that makes sense. Types of VR Headsets VR and MR headsets have different capabilities. However, choosing the perfect one is less about specs and more about how they fit your needs and what you want to achieve. Here’s the lineup… Wired Headsets Wired headsets like HTC Vive Pro and Oculus Rift S should be connected to a high-performance PC to deliver stunningly detailed visuals and incredibly accurate tracking. Expect razor-sharp visuals that make virtual grass look better than real grass and tracking so on-point, you’d swear it knows what you’re about to do before you do. Wired headsets are best for high-stakes environments like surgical training, designing complex structures, or running realistic simulations for industries like aerospace. However, you’ll need a powerful computer to even get started, and a cable does mean less freedom to move around. Standalone Headsets No strings attached. Literally. Standalone headsets like Oculus Quest Pro, Meta Quest 3, Pico Neo 4, and many more) are lightweight, self-contained, and wireless, so you can jump between work and play with no need for external hardware. They are perfect for on-the-go use, casual gaming, and quick training sessions. From portable training setups to spontaneous VR adventures at home, these headsets are flexible and always ready for action (and by “action”, we mostly mean Zoom calls in VR if we’re being honest). However, standalone headsets may not flex enough for detailed, high-performance applications like ultra-realistic design work or creating highly detailed environments. Mixed Reality (MR) Headsets Mixed reality headsets blur the line between physical and digital worlds. They don’t just whisk you to a virtual reality — they invite the virtual to come hang out in your real one. And this means holograms nested on your desk, live data charts floating in the air, and playing chess with a virtual opponent right at your dining room table. MR headsets like HoloLens 2 or Magic Leap 2 shine in hybrid learning environments, AR-powered training, and collaborative work requiring detailed, interactive visuals thanks to their advanced features like hand tracking and spacial awareness. MR headsets like HoloLens 2 or Magic Leap 2 shine in hybrid learning environments, AR-powered training, and collaborative work requiring detailed, interactive visuals thanks to their advanced features like hand tracking and spacial awareness. The question isn’t just in what these headsets can do. It’s in how they fit into your reality, your goals, and your imagination. Now, the only question left is… which type is best for your needs? Detailed Headset Comparisons It’s time for us to play matchmaker between you and the headsets that align with your goals and vision. No awkward small talk here, just straight-to-the-point profiles of the top contenders. HTC Vive Pro This is your choice if you demand nothing but the best. With a resolution of 2448 x 2448 pixels per eye, it delivers visuals so sharp and detailed that they bring virtual landscapes to life with stunning clarity. HTC Vive Pro comes with base-station tracking that practically reads your mind, and every movement you make in the real world reflects perfectly in the virtual one. But this kind of performance doesn’t come without requirements. Like any overachiever, it’s got high standards and requires some serious backup. You’ll need a PC beefy enough to bench press an Intel Core i7 and an NVIDIA GeForce RTX 2070. High maintenance is also required, but it’s totally worth it. Best for: High-performance use cases like advanced simulations, surgical training, or projects that demand ultra-realistic visuals and tracking accuracy. Meta Quest 3 Unlilke the HTC Vive Pro, the Meta Quest 3 doesn’t require a tethered PV setup cling. This headset glides between VR and MR like a pro. One minute you’re battling in an entirely virtual world, and the next, you’re tossing virtual sticky notes onto your very real fridge. Meta Quest 3 doesn’t match the ultra-high resolution of the Vive Pro, but its display resolution reaches 2064 x 2208 pixels per eye — and this means sharp and clear visuals that are more than adequate for training sessions, casual games, and other applications. Best for: Portable classrooms, mobile training sessions, or casual VR activities. Magic Leap 2 The Magic Leap 2 sets itself apart not with flashy design, but with seamless hand and eye tracking that precisely follow your movements and the headset that feels like it knows you. This headset is the one you want when you’re blending digital overlays with your real-life interactions. 2048 x 1080 pixels per eye and the 70 degrees diagonal field of view come with a price tag that’s way loftier than its competitors. But remember that visionaries always play on their terms Best for: Interactive lessons, augmented reality showstoppers, or drawing attention at industry conventions with show-stopping demos. HTC Vive XR Elite The HTC Vive XR Elite doesn’t confine itself to one category. It’s built for users who expect both performance and portability in one device. 1920 x 1920 resolution per eye doesn’t make it quite as flashy as the overachiever above, but it makes up for it with adaptability. This headset switches from wired to wireless within moments and keeps up with how you want to work or create. Best for: Flexible setups, easily transitioning between wired and wireless experiences, and managing dynamic workflows. Oculus Quest Pro The Oculus Quest Pro is a devices that lets its capabilities speak for themselves. Its smooth and reliable performance,…

October 4, 2024
Meta Connect 2024: Major Innovations in AR, VR, and AI

Meta Connect 2024 explored new horizons in the domains of augmented reality, virtual reality, and artificial intelligence. From affordable mixed reality headsets to next-generation AI-integrated devices, let’s take a look at the salient features of the event and what they entail for the future of immersive technologies. Meta CEO Mark Zuckerberg speaks at Meta Connect, Meta’s annual event on its latest software and hardware, in Menlo Park, California, on Sept. 25, 2024. David Paul Morris / Bloomberg / Contributor / Getty Images Orion AR Glasses At the metaverse where people and objects interact, Meta showcased a concept of Orion AR Glasses that allows users to view holographic video content. The focus was on hand-gesture control, offering a seamless, hands-free experience for interacting with digital content. The wearable augmented reality market estimates looked like a massive increase in sales and the buyouts of the market as analysts believed are rear-to-market figures standing at 114.5 billion US dollars in the year 2030. The Orion glasses are Meta’s courageous and aggressive tilt towards this booming market segment. Applications can extend to hands-free navigation, virtual conferences, gaming, training sessions, and more. Quest 3S Headset Meta’s Quest 3S is priced affordably at $299 for the 128 GB model, making it one of the most accessible mixed reality headsets available. This particular headset offers the possibility of both virtual immersion (via VR headsets) and active augmented interaction (via AR headsets). Meta hopes to incorporate a variety of other applications in the Quest 3S to enhance the overall experience. Display: It employs the most modern and advanced pancake lenses which deliver sharper pictures and vibrant colors and virtually eliminate the ‘screen-door effect’ witnessed in previous VR devices. Processor: Qualcomm’s Snapdragon XR2 Gen 2 chip cuts short the loading time, thus incorporating smoother graphics and better performance. Resolution: Improvement of more than 50 pixels is observed in most of the devices compared to older iterations on the market, making them better cater to the customers’ needs Hand-Tracking: Eliminating the need for software, such as controllers mandatory for interaction with the virtual world, with the advanced hand-tracking mechanisms being introduced. Mixed Reality: A smooth transition between AR and VR fluidly makes them applicable in diverse fields like training and education, health issues, games, and many others. With a projected $13 billion global market for AR/VR devices by 2025, Meta is positioning the Quest 3S as a leader in accessible mixed reality. Meta AI Updates Meta Incorporated released new AI-assisted features, such as the ability to talk to John Cena through a celebrity avatar. These avatars provide a great degree of individuality and entertainment in the digital environment. Furthermore, one can benefit from live translation functions that help enhance multilingual art communication and promote cultural and social interaction. The introduction of AI-powered avatars and the use of AI tools for translation promotes the more engaging experiences with great application potential for international business communication, social networks, and games. Approximately, 85% of customer sales interactions will be run through AI and its related technologies. By 2030, these tools may have become one of the main forms of digital communication. AI Image Generation for Facebook and Instagram Meta has also revealed new capabilities of its AI tools, which allow users to create and post images right in Facebook and Instagram. The feature helps followers or users in this case to create simple tailored images quickly and therefore contributes to the users’ social media marketing. These AI widgets align with Meta’s plans to increase user interaction on the company’s platforms. Social media engagement holds 65% of the market of visual content marketers, stating that visual content increases engagement. These tools enable the audience to easily generate high-quality sharable visual images without any design background. AI for Instagram Reels: Auto-Dubbing and Lip-Syncing Advancing Meta’s well-known Artificial Intelligence capabilities, Instagram Reels will, in the near future, come equipped with automatic dubbing and lip-syncing features powered by the artificial intelligence. This new feature is likely to ease the work of content creators, especially those looking to elevate their video storytelling with less time dedicated to editing. The feature is not limited to countries with populations of over two billion Instagram users. Instead, this refers to Instagram’s own large user base, which exceeds two billion monthly active users globally. This AI-powered feature will streamline content creation and boost the volume and quality of user-generated content. Ray-Ban Smart Glasses The company also shared the news about the extensions of the undoubted and brightest technology of the — its Ray-Ban Smart Glasses which will become commercially available in late 2024. Enhanced artificial intelligence capabilities will include the glasses with hands-free audio and the ability to provide real-time translation. The company’s vision was making Ray-Ban spectacles more user friendly to help those who wear them with complicated tasks, such as language translation, through the use of artificial intelligence. At Meta Connect 2024, again, the company declared their aim to bring immersive technology to the masses by offering low-priced equipment and advanced AI capabilities. Meta is confident to lead the new era of AR, VR, and AI innovations in products such as the Quest 3S, AI-enhanced Instagram features, and improved Ray-Ban smart glasses. With these processes integrated into our digital lives, users will discover new ways to interact, create, and communicate within virtual worlds.

September 5, 2024
Gamescom 2024: The Future of Gaming is Here, and It’s Bigger Than Ever

This year’s Gamescom 2024 in Cologne, Germany, provided proof of the gaming industry’s astounding growth. Our team was thrilled to have a chance to attend this event, which showcased the latest in gaming and gave us a glimpse into the future of the industry. Gamescom 2024 was a record-breaking conference, with over 335,000 guests from about 120 nations, making it one of the world’s largest and most international gaming gatherings. This year’s showcase had a considerable rise in attendance — nearly 15,000 people over the previous year. Gamescom 2024 introduced new hardware advances used for the next generation of video games. Improvements in CPUs and video cards, particularly from big companies in the industry like AMD and NVIDIA, are pushing the boundaries of what is feasible for games in terms of performance and graphics. For example, NVIDIA introduced the forthcoming GeForce RTX series, which promises unprecedented levels of immersion and realism. Not to be outdone, AMD has introduced a new series of Ryzen processors designed to survive the most extreme gaming settings. These technological advancements are critical as they allow video game developers to create more complex and visually stunning games, particularly for virtual reality. As processing power increases, virtual reality is reaching new heights. We saw numerous VR-capable games at Gamescom that offer players an unparalleled level of immersion. Being a VR/AR development company, we were excited to watch how technology was evolving and what new possibilities it was bringing up. The video game called “Half-Life: Alyx” has set a new standard, and it’s clear that VR is no longer a niche but a growing segment of the gaming market. Gamescom’s format proved its strength, as indicated by the fact that its two days were run in two formats. Gamescom stands out from other games exhibitions or conventions by being both a business and consumer show. This dual format enables the developers to collect feedback on their products immediately. This is especially so when meeting prospective clients during a presentation or when giving a demonstration to gamers, the response elicited is very helpful. Rarely does anyone get a chance to witness the actual implementation and real-world effect of what they have done.



Let's discuss your ideas

Contact us