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:
- [New] 2024 Approved Ephemeral Echoes of Facebook
- [Updated] Constructing an Inviting Subscribe Link for YouTube Enthusiasts for 2024
- [Updated] In 2024, Hide-and-View FB Snapshot Tool
- Comprehensive Logitech C615 Webcam Assessment: Balancing Quality with Cost
- Creation of International Institutions
- Delving Into the Design Brilliance of Rayman Legends' Platform Playgrounds
- Economical SSL Certificate Exploration
- Elevating PS3 Space: Tips for HDD Expansion
- Embracing Tamriel's Wilderness: An In-Depth Review of Skyrim on the Nintendo Switch
- Expert Evaluation: How the Tiny Unihertz Atom XL Outperforms in Durability & Power
- Exploring the Depths of Narrative Worldbuilding in 'Torment: Tides of Numenera' - A Sci-Fi CRPG Overview
- Exploring Venu Sports: An In-Depth Look at Its Potential Launch
- How Can Samsung Galaxy S23 UltraMirror Share to PC? | Dr.fone
- In 2024, How to Screen Mirroring Honor Magic 6 to PC? | Dr.fone
- Nixplay Seed Review: Outstanding Photo Framing Option
- Quick Fixes for Why Is My Poco C65 Black and White | Dr.fone
- Top Rated SEO Agencies in San Francisco (USA) : Your Comprehensive Guide with SEO PowerSuite
- Title: My Journey Into Game Development with ChatGPT: A Comprehensive Review
- Author: Edward
- Created at : 2024-11-10 17:36:31
- Updated at : 2024-11-14 16:17:48
- 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.