My Journey Into Game Development with ChatGPT: A Comprehensive Review
My Journey Into Game Development with ChatGPT: A Comprehensive Review
Key Takeaways
- Game engines understood by ChatGPT are suitable for coding game prototypes.
- Coding assistance from ChatGPT requires a decent understanding of the game engine being used.
- Expect ChatGPT to provide close, but not exact, solutions to coding problems. You still need to review and revise the code provided by ChatGPT.
AI is the new buzzword that everyone seems to be talking about. Even phones are getting fully implemented AI applications, but there’s a lot more you could do with tools like ChatGPT, including coding a game. I’ve been developing games for almost a decade, and have even released a few projects and participated in a couple of game jams on Itch .
When I discovered ChatGPT, the first thing I wanted to do was see if I could use it in game development. As always, ChatGPT is eager to help and almost feels like the world’s most into-it intern.
Can ChatGPT Code a Game for You?
It’s quickly apparent that GPT’s willingness to teach you to code a game is well-meaning but requires you to understand a bit about what you’re doing. As someone who’s been an amateur game developer for more than a decade, I know a little bit about coding a game. In using GPT to help me, I was interested in seeing how sophisticated it was for producing a playable game prototype.
It Certainly Understands Game Engines
A game engine is what a developer uses to create a game. Several game engines are available, including Unreal Engine , Godot , and Unity . As someone who knows Unity well, I decided to use this as my development engine. I asked a few general questions (that I know the answer to) to ensure that ChatGPT wouldn’t start hallucinating about my game engine.
After sorting out that it at least knew what it was doing, I decided to give the framework for my project, which included:
- Random generation of a scrolling background
- Having a player character controlled by directional buttons, with mouse buttons for firing
- A point system with a leaderboard
- An endless amount of enemies, so players can play casually
ChatGPT was very helpful in offering code solutions for some of the things I would need to create this game. For example, I asked it for some code for a projectile I would fire from the player’s position when they hit the “Fire” button, and it gave me this:
`using UnityEngine;
public class Projectile : MonoBehaviour
public float speed = 10f; // Adjust this value to control projectile speed
void Start()
// Move the projectile forward in its local space (assuming it’s facing right)
GetComponent
void OnTriggerEnter2D(Collider2D other)
// Check if the projectile collides with an enemy or other objects
if (other.CompareTag(“Enemy”))
// Handle enemy damage or destruction
Destroy(other.gameObject); // Destroy the enemy
Destroy(gameObject); // Destroy the projectile
else if (other.CompareTag(“Wall”))
// Destroy the projectile if it collides with a wall
Destroy(gameObject);
}`
Notably, it gave me well-commented code so I could follow along as a beginner programmer. Many places suggest that you could learn to code using AI , and the inclusion of well-commented code is part of that. You won’t have to worry if there are errors in your code if you can trace them comment by comment. However, when using GPT to build a game, I encountered several issues that would defeat a newcomer to game development.
ChatGPT Is Far From Perfect
LLMs are only as good (or as bad) as the prompts the user gives them. For example, a user could easily generate anime-type characters with MidJourney by including a few words to clarify the prompt’s end result. However, when building a game with ChatGPT, I found that there were times when the engine simply didn’t pick up what I was putting down.
In this example, I encountered an issue with spawning my projectiles, with all the “bullets” being deflected when the player moves. While this could create some interesting play patterns, I decided to ask it to fix the problem, and it suggested a fix. Unfortunately, the fix didn’t work.
I eventually fixed it myself, but it highlighted a major issue with using ChatGPT to code a game: there are some things it doesn’t know.
I eventually put together the game using a few suggestions from GPT about the persistent score as well as the random generation algorithm and scrolling for the game background. You can play the final game here .
Does It Work With Other Game Engines?
I know ChatGPT was very good with Unity once I could sort out some of the issues I ran into above. However, I wondered how coding a game with ChatGPT would work for a less-popular engine like Godot. I’m not exactly an expert in Godot, having used it far less than I did Unity. I decided to ask ChatGPT a few questions:
GPT’s Godot Problem
For those who use Godot regularly, the issue is immediately obvious. ChatGPT stopped learning in 2021 or thereabouts (at least for the free version). The script GPT gave me was based on its knowledge of Godot 2.x, which is a heavily outdated version of the current 4.x version. The glaring problem is the use of KinematicBody2D, which was replaced by CharacterBody2D in later iterations of the language.
How Much Skill Do You Need to Code a Game With ChatGPT?
If you’re considering making the next Legend of Zelda: Breath of the Wild using ChatGPT, you should probably temper your expectations. You need to have a decent understanding of the engine you’re working in to use ChatGPT as a coding assistant.
Other assistants like Microsoft Copilot might be better with general code and could help to a greater degree. The big issue is that these LLMs are looking at an abstract problem, and they’re seeing it without actually seeing it.
In simpler language, you know what the game you’re making should look like and how things in it should behave. You can explain it to ChatGPT what you want, and it will give you something close to (but not quite) what your game needs. To make it behave the way you want it to, you’ll have to fiddle around with the code that GPT gives you.
Should You Code a Game With ChatGPT?
Game development is a complex field, but thanks to engines like those mentioned above, it is much more approachable for the general public. A skilled developer could spend a few hours putting together a game that works and has all the things they want in it.
This particular project took me a total of 48 hours from start to finish. The more complex the game, the more time and effort it will take. That’s not counting the amount of time you’d have to throw into asset sourcing and development. It could get to be a pretty large project.
If you do decide to code a game with ChatGPT assisting, here are a few things to keep in mind:
- ChatGPT can make mistakes in code.
- ChatGPT might give you outdated code, requiring you to spend hours googling for a fix.
- AI can’t make game assets as of yet (not good 2D assets, anyway) so you’ll have to source assets separately.
- Some of the suggestions ChatGPT gives you won’t work and might lead you to a dead end, requiring you to rethink your implementation.
If anyone asked me today if they could learn to code a game with ChatGPT from scratch without any knowledge of the engine, I’d have to tell them no.
Also read:
- [Updated] In 2024, Effortless iDevice Photo-to-PC Migration
- Free Download: Brother HL-L2340DW Wireless Color Laser Printer Drivers & Software for Windows
- In 2024, Choosing Top 8 Free, AI-Powered SRT Translators
- In 2024, Different Methods To Unlock Your iPhone 11 Pro Max
- In Depth Review of Midland's LXT500VP3 Handheld Radios – Packed with Features but Questionable Performance
- In-Depth Evaluation of the Reliable Omoton T1 Tablet Holder: Great Value at an Unbeatable Price
- In-Depth Review of Dying Light: The Ultimate First-Person, Team-Up Survival Journey
- In-Depth Review of Sumind's Best Selling Bluetooth BT70B Transmitter: A Must-Have for Every Driver!
- Insightful Analysis of the Lavish & Rapid Glion Dolly Electric Scooter
- Introducing Karaoke Cloud Pro v2 Upgrade From Sept '14 with Extra Tracks: The Ultimate DJ Experience
- IPad Screen Recording Made Simple A Handy Overview
- Is It Worth Switching to TP-Link's Archer AX6000? How Does It Stack Up to the Nighthawk AX12?
- Is YouTube's Enhanced Service Worth the Investment?
- LG K92 5G Smartphone Assessment: Is the Upgrade Worthwhile?
- Pokemon Go Error 12 Failed to Detect Location On Oppo Reno 10 Pro 5G? | Dr.fone
- Review VLC's Capability to Record Screens
- Syma X5C Reviewed Ideal Entry-Level Flying Machine for 2024
- Title: My Journey Into Game Development with ChatGPT: A Comprehensive Review
- Author: Edward
- Created at : 2025-01-06 00:41:07
- Updated at : 2025-01-10 06:22:49
- Link: https://buynow-help.techidaily.com/my-journey-into-game-development-with-chatgpt-a-comprehensive-review/
- License: This work is licensed under CC BY-NC-SA 4.0.