Game Dev and AI: How ChatGPT Has Helped
Tags: ai, unity3d, chatgpt, learning
Published: 2023-08-25 20:43:57

Before we begin, let me make a disclaimer. This post isn't about integrating AI into games, crafting your AI system, or contemplating how AI will replace developer jobs and lead us to a WALL-E-esque future of blob people on a space station, as depicted in Pixar's WALL-E. Instead, I'm here to share personal thoughts and experiences regarding my use of AI, specifically ChatGPT (Chat), as a tool to assist with my projects and expand my understanding of complex concepts. Put shortly, this is not an exploration of grand AI narratives. Now, let's dive into things.

When ChatGPT entered the scene, I already had a year's worth of coding experience under my belt. While I was still very much a beginner, I was diligently crafting gameplay features within a solo project in Unity. However, my journey with Chat didn't start until several months later. Once I embraced it as a tool, I was pleasantly surprised by its ability not only to comprehend but also to explain concepts at a level that resonated with me, effectively fostering a dialogue for learning.

My learning journey prior to Chat mostly involved sifting through outdated forums for solutions and scouring YouTube for valuable insights from leaders in the Unity development community. Let me step onto a soapbox for a moment. Personally, I harbor reservations about forums. Please don't brandish pitchforks if you're an ardent forum enthusiast; this is just my take. I often find forums to be less helpful. Typically, frustrated individuals post their problems, already upset by their inability to locate a solution. Their code tends to lack clarity, making it challenging for me to determine if their issues relate to mine. Furthermore, while some responders are genuinely helpful, others adopt a condescending tone, morphing the problem-solving process into a "coding prowess showdown" with a frustrated developer. To put it succinctly, scrolling through forums is time-consuming, distracting, exhausting, and seldom yields useful insights—especially when grappling with the development of unique systems. But I digress; the idea of spending time on a forum merely makes me cringe.

On the other hand, YouTube has proven more beneficial in my experience. Nonetheless, barring a few exceptions, finding optimal examples of advanced and in-depth concepts in Unity, game development, and C# remains challenging. This is especially true when these concepts are presented in a manner that steps fully into technical jargon and fails to employ relatable, "real-world" examples. I recognize the significance of technical jargon, but it's important to acknowledge that it can be a stumbling block for newcomers attempting self-teaching. To summarize, while I could locate explanations suitable for beginners concerning basic concepts, I struggled to find explanations at the beginner/intermediate level for more advanced concepts. Moreover, comprehensive explanations of concepts on YouTube are often scarce, as most content creators gravitate towards quick-fix solutions ready for implementation in their own projects. So, on one hand you have videos with millions of views showing how to implement a single feature. Then on the other hand you have a video with a few thousand views that is so complex and bland that I’d rather be sitting in an economics class led by Ben Stein.
To cut to the chase, my early learning primarily involved watching videos, applying the concepts to my project, and subsequently dissecting and tinkering with them until I grasped their essence. This approach, while serviceable, yielded a somewhat chaotic project—littered with disorganized functionalities that drove me crazy. I may or may not have closed my laptop a bit too firmly in these instances, and caused a permanent issue with the screen... Nevertheless, I yearned for a firmer grasp of architecture, design patterns, and best practices.

Coming from an educational background and holding a Master's of Science in Counseling, I understood the process of learning and knowledge advancement. However, I hadn't fully committed to elevating my game development education to the same level. That is, until the persistent itch to learn more got the better of me. I enrolled in a bootcamp, attended game development conferences, and crystallized my understanding of what I needed to learn. And then came ChatGPT, seemingly timed to align with my increasing awareness of coding intricacies. Had Chat entered the picture at the outset of my journey, I might have grown overly dependent on it. If it had appeared after a decade of experience, I might have stubbornly refrained from leveraging it, adopting the common stance of "I had to learn the hard way, so others should too." However, at this juncture, I was grasping design patterns, understanding their purpose, and acquainting myself with technical terms that previously befuddled and discouraged me. My knowledge deepened on Unity's best practices and SOLID principles of object-oriented programming, and I was ready to put theory into action. Admittedly, I could have absorbed these lessons without Chat's aid, but the speed at which I assimilated, implemented, and expanded upon them took me by surprise.
So, how did I harness Chat to achieve this feat? Allow me to preface by stating that I don't advocate asking Chat to generate code and then mindlessly pasting it into my project. Even at my skill level, I can discern that much of the code it produces is sub-optimal and unreliable. In fact, I rarely take code snippets directly from Chat and incorporate them into my project. Instead, I employ Chat as a mentor, a guide, an intellectual sparring partner with whom I can engage. As a solo developer, this resource has proven invaluable. It grants me insights into design patterns, coding conventions, Unity error messages, and even previously unknown Unity features. Now, this wealth of information lies quite literally at my fingertips. In essence, Chat has become my "learning assistant." While I often lament the years spent in a career I ultimately dislike, Chat has expedited my information-seeking capabilities and managed to fill some of the void left by the time that felt wasted. I'm appreciative of the knowledge and enamored with the ability to learn, and it's this facet of AI that truly delights me.

To illustrate with an example, I frequently share my architectural plans for a system in my project with Chat. Subsequently, I ask for its feedback. I pose questions like, "Does this adhere to X design pattern?" or "Do you have any suggestions for enhancing adherence to X design pattern?" and "How might I manage this class's dependence on another class?" While the solutions it offers are occasionally flawed, I then outline my concerns about a particular solution, prompting Chat to produce a revised suggestion. This iterative exchange mirrors the experience of collaborating with a project teammate, a dynamic that has led to numerous "aha!" moments of comprehension or discovery. In education, it resembles the moment when, through a back-and-forth dialogue, a student experiences an "aha!" moment—an instance of illumination—grasping and being able to apply a concept effectively.

As alluded to earlier, this post doesn't delve into AI's impending transformations. Rather, it's an account of my experiences with AI as they stand. AI is not the panacea for all programming woes, capable of transforming any ten-year-old with an idea into a master game developer. However, I firmly believe that AI's potential as a potent modern-day learning tool should not be disregarded. Perhaps I'm dwelling on this aspect too affectionately, a reflection of my educational background comes to mind and considers the individuals who aspire greater purpose, but find themselves limited by socioeconomic status or geographic location. For such individuals, Chat holds the power to dismantle barriers to learning. Perhaps that's my educator's sensibility talking, but I hope that the next time an experienced developer scoffs at the use of AI, they pause to contemplate the impact of informational access on those who lack the privilege of a traditional education due to life's circumstances. And I'm not exclusively referring to programming education; throughout history, learning has revolved around absorbing accurate information from individuals who've conducted research, established principles, and made them accessible. AI assumes the mantle of the third aspect—accessibility—and compresses a wealth of knowledge into a condensed, personalized, and comprehensible format.

As always, thanks for your time and attention. Keep focused in learning, aim your sights on growth, stay persistent, and achieve your learning goals.