Skip to main content

I used ChatGPT to help me make my first game. Don’t make the same mistakes I did

Asking ChatGPT about making my first game.
Jon Martindale / DigitalTrends

Alongside writing articles about ChatGPT, coming to terms with AI chatbot has been a major mission of mine for the past year. I’ve found it useful for coming up with recipe ideas from a list of ingredients, writing fun alternate history ideas, and answering board game rules clarifications. But I wanted to see if it could do something more impressive: teach me how to make a game.

The first hurdle

I’ve wanted to make a game for a while now. I programmed a bunch of basic Flash games when I was a kid — if you can find my Newgrounds profile, you can have a good laugh at them — but I’ve had a few ideas ticking in my mind that have calcified into thoughts that will not shift. I need to make them someday and maybe someday is now.

But knowing how to start making a game isn’t easy. I didn’t really know what kind of game I was trying to make, or what engine I should use, or how you actually start making a game. Until recently, I just hadn’t done it. I’d downloaded Unity once, became intimidated, and uninstalled it.

So, the first step in my game-making journey was to talk to ChatGPT about it. No fancy custom GPT, no plug-ins, just me and my pal — who I’d asked to respond in an encouraging and understanding way — like it was teaching a child.

It talked me through the main game engines, and after explaining my idea for a game, it had some suggestions. It ultimately suggested I could make it in 2D and that although the big engines would be great too, I might be better off with something like Godot or Game Maker Studio.

I did some external research and ultimately settled on Game Maker. It seemed like the most straightforward. ChatGPT was excited for me when I said I’d settled on an engine, and then we got to work on outlining my project.

Now what?

So, how do I actually make a game? ChatGPT suggested I learn the engine, which makes a lot of sense. But how do I do that? There were a few approaches it said could work, including doing a tutorial. That made sense, so I found a tutorial for Game Maker on YouTube and ran through it in a couple of hours, making an Asteroids clone that preteen Jon would definitely have enjoyed playing on the school computers instead of doing the work that had been assigned.

An asteroids clone running in Game Maker.
I am become game developer, destroyer of free time. Jon Martindale / DigitalTrends

But that only really taught me the basics of where things were in the engine. I wrote in the Event logic that the video gave me, and it worked! Great. Now what?

Most good advice I’ve read from experienced developers was just to make another tutorial game. And then another, then another, and keep going until I was versed in the engine enough to understand it. And only then I could tackle my own game.

But I’m not a complete noob operating by myself, am I? I have a relative programming expert at my right hand whenever I have a question, or even need a code snippet example to copy and paste. I have ChatGPT. I can skip that and go right to making my own game. Or so I thought.

It’s all good — until it isn’t

I got off to a flying start. With ChatGPT to walk me through what I needed to do, give me code examples when I was stuck, or make suggestions about how I could do things differently, I made swift progress. Within a few hours, I had a bare-bones prototype of the game.

So, I asked ChatGPT how I could expand the game to make it bigger, longer, more fun, and it turned out that the prototype I had made was completely bespoke, with zero capability for expansion without retooling everything.

But that’s OK. That’s why it’s a prototype, right? So, we start again, and this time I make a CustomGPT that’s more forthcoming with what I need and knows what I’m working on. I made one that had knowledge of all my in-game objects and scripts, some of their code snippets, variable names — the works. And we started again from the ground up, this time using arrays and structs, which is compartmentalized, modular code that calls to scripts and dynamically destroys instances I no longer need, and so on.

But if I’m honest, I don’t really know what most of that means. And on one particular night, I was tired, but really wanted to get this bit finished before I had to take a couple days away from it for life and kids and everything else. So, I took a shortcut, letting ChatGPT actually write me the code I needed. To my delight, I plugged it in, and it worked. Great. Goodnight.

Unfortunately, what started as a one-off became a habit all too quickly. I began using variable names ChatGPT had come up with, having it comment on the code to help me come back to it later. I was learning lots about how to make a game and starting to find moving around the engine easier. The second prototype was coming together, but then I hit a stumbling block.

A major object just wouldn’t behave like I wanted it to. ChatGPT suggested some fixes, but they didn’t work. I tried figuring it out myself. For hours. And I got nowhere.

I ended up copying the entire event code of every single in-game object and every script into ChatGPT and asking it to find the problem. It did. But the fixes didn’t work. And that was it. I had nothing. Nowhere to turn to.

I wasn’t skilled enough to bug hunt it myself, and I hadn’t used proper version control to roll it back. I had hit a dead end because of my own desire for speedy development at the cost of understanding. I hadn’t learned enough about how to make a game, so now that the game I’d made was broken, I had no idea how to fix it.

The problem

The problem with using ChatGPT to teach me how to make a game, and I imagine many other topics, is that ChatGPT doesn’t know anything. It can access information, and it can write something that sounds like it knows what it’s talking about, but it doesn’t know. So, when I asked it to help me make something in a certain way, it helped me do it in that certain way, without explaining to me that there are better ways to do it.

Event logic in Game Maker Studio.
I only understand about half of what’s going on here. And I “wrote” most of it. Jon Martindale / DigitalTrends

I didn’t have trouble with hallucination, but I did have difficulty with the way ChatGPT doesn’t have the latest Game Maker Studio manual on hand, so it would often make suggestions for deprecated logic that the Game Maker engine threw up all sorts of red flags over.

My custom GPT, and even the more professionally prompted Grimoire coding wizard, are not intuitive. They can’t anticipate your problems, or imagine that your scope may change in the future, or what you might want or need several conversations from now. It just isn’t a good substitute for a human teacher, or having the knowledge yourself.

The solution

I haven’t given up on my game-making journey. Indeed, I’m making the next prototype, and I’m still using ChatGPT — but with a new approach. I’m writing all the code by hand, making sure that I name all the variables and scripts, and writing comments that make sense for me. That way, when I inevitably break something, I’ll know how it all works, so I can workshop solutions.

If I don’t know how to do something, I ask ChatGPT to explain it to me in generalities, and then I use that information it gave me to make my own changes in my own game. It’s slower, but much more stable. When a problem arises, I can fix it, because I’m actually learning how to make a game. Not just getting ChatGPT to make it for me while I’m along for the ride.

My developer friends think this is all very funny because, after having a modern AI as the linchpin for my early failings, I’m just learning how to code like everyone else did. Slowly, and with lots of mistakes.

Asking Grimoire about the article.
Jon Martindale / DigitalTrends

I should have asked Grimoire about this from the start. When I want to learn something, I learn it from the manual. When I want to double-check something, I have ChatGPT give it a once over to make sure I’m heading in the right direction. I’ve also implemented the GitHub desktop so if I ever go too far off any deep ends, I can quickly claw it back to where it all makes sense again.

I still think ChatGPT is an amazing tool that will continue to improve in its ability to act as an expert tutor that’s available day and night, for comparatively little money, and with whatever tone of voice you want to give it. Just having it create a to-do list for me at the end of a coding session that also praises my efforts and lists my achievements, is really encouraging, as well as practical.

But it’s not the definitivel solution I hoped it would be. And that’s OK. I’m still going to keep making my game, and I’ll still keep using ChatGPT to help me where it can. Hopefully, in a year or two, you’ll see my colleagues here begrudgingly helping me to promote it. We’ll see.

Editors' Recommendations

Jon Martindale
Jon Martindale is the Evergreen Coordinator for Computing, overseeing a team of writers addressing all the latest how to…
NY lawyers fined for using fake ChatGPT cases in legal brief
The ChatGPT website on an iPhone.

The clumsy use of ChatGPT has landed a New York City law firm with a $5,000 fine.

Having heard so much about OpenAI’s impressive AI-powered chatbot, lawyer Steven Schwartz decided to use it for research, adding ChatGPT-generated case citations to a legal brief handed to a judge earlier this year. But it soon emerged that the cases had been entirely made up by the chatbot.

Read more
Apple CEO says he uses ChatGPT, weeks after Apple banned it
Tim Cook at WWDC 2022.

Apple had one of its largest WWDC keynotes in recent memory this year, with monumental announcements like the new Vision Pro headset. But one area where Apple was shockingly silent was AI, especially after the cascading rise of apps like ChatGPT.

Apple's CEO, Tim Cook, said the company is being patient with AI for now in an interview with Good Morning America. "I do think it's so important to be very deliberate and very thoughtful in the development and the deployment of [Large Language Models]," Cook said. "Because they can be so powerful that you worry about things like bias, things like misinformation, maybe worse in some cases."

Read more
Nvidia is bringing ChatGPT-style AI to video games, and I’m already worried
Nvidia CEO delivering a keynote at Computex.

Nvidia is bringing generative AI to video games. Announced during its Computex 2023 keynote, Nvidia ACE is a new platform that allows developers to use generative AI to power conversations with characters in games.

Think ChatGPT, but instead of a general-purpose chatbot, you get a chatbot with a specific backstory and lore. Nvidia is stressing that flexibility is one of the most important aspects of ACE, as it will allow characters to have a fleshed-out backstory that informs their responses and keeps them from getting too off-topic. The company's recently announced NeMo Guardrails play a role in this, directing the conversation away from topics the developer doesn't intend.

Read more