AI can get you pretty far when it comes to a lot of things, and tools like ChatGPT are great at helping people. You can use them to plan meals, fitness plans, help you with programming, and a whole lot more. I used ChatGPT to try and help me make Minecraft, and to its credit, it did an okay job with the short period of time I actually played around with it.
I first elected to try and do it in Python, but ChatGPT got pretty confused and ended up making a block that spun around in a circle before then trying to generate an OpenGL-based plane that was blindingly green. At that point, I stopped, and I switched over to using Unity 3D instead. Given that's a game engine actually designed for making games, I figured it'd work a lot better. It definitely did, that's for sure.
Using ChatGPT to program in Python, C, and Java
ChatGPT is scarily good at writing code.
Making Minecraft with ChatGPT starts with assessing what's possible
My early version doesn't have anything too crazy, ChatGPT can't make any advanced textures
The biggest problem to me wasn't that ChatGPT couldn't make the code, it was that ChatGPT couldn't make the textures. I'm no artist, and the best I could do was browse the Unity Asset store and download some textures and assets on there. I asked ChatGPT to make me a Minecraft clone in Unity, and the steps started off promising.
The FPS controller mentioned here is part of a now-deprecated Standard Assets library that you can no longer get. However, it was still linked to my Unity account as I have been using it for a number of years, so I was able to continue. If you try to do something similar, you can tell ChatGPT that you can't download standard assets and it will walk you through recreating the FPS controller prefab.
From there, it gave me basic code to generate a flat world and added basic block breaking and block placing mechanics. The above video shows how it works in this current state, using a basic array of Cube assets.
Adding random terrain generation
This part was super easy with ChatGPT
I asked ChatGPT to create random terrain generation, as Minecraft (unless you play in a flat world) doesn't have just a level field for the entire width of the world. I also asked it to add water to the level (like you would find in lakes in Minecraft) and to make it so that block placements would be fixed to rounded X, Y, and Z values. This means that they are placed in line with other blocks, rather than just anywhere in the 3D plane of existence.
The water blocks take texture of water and can be traversed through, but they're still cube elements of water. I didn't want to complicate things too much, and they work as is to give the effect of water. Likewise, the block placement and destruction works well, but there is only one type of block at present. With random world generation too, it makes the world interesting and unique each time, just like Minecraft.
The script that ChatGPT gave is a Perlin noise generator, an algorithm that generates linearly increasing and decreasing noise values. This is what gives the nice gradients and hill-like generation to the world above. There's a lot of work to do if you wanted to make true biomes like in Minecraft, but it gets the job done for a basic recreation of something like Minecraft.
Adding trees, passive mobs
When pigs fly...
Next up, I wanted to add trees and pigs, simply just because I could. The trees are a little bit off the ground (which is fine), but the pigs... well, you'll see what I mean in the video above. I asked ChatGPT to give them random movement and to jump when they hit a block, and that they certainly did. ChatGPT also modified the world generation code to add randomly spawning trees based on a prefab which worked excellently.
Aside from the flying pigs, the rest of this worked surprisingly well. I kept the pigs as they are; they add a bit of a unique touch that regular Minecraft simply can't replicate. It took a bit to get the big spawn logic working, but part of that was because I didn't have my terrain tagged correctly. Once I did, it worked just fine.
Now on to adding the finishing touches, and I'll have a very, very basic Minecraft clone done in a pretty quick time!
Graphics overhaul to look more like Minecraft
A better skybox and recognizable textures
I found a Unity package with a block that looked like a Minecraft glass block, and I swapped out the skybox with a free alternative. From there, the transformation was complete, and the game looks and functions similarly to Minecraft in its basic control and world elements.
Of course, this is nowhere near the depth of the game even in its block variety, but the mob spawning, block placement and breaking, and terrain generation were all done with ChatGPT. For anything that was broken or otherwise didn't work, I could troubleshoot it with ChatGPT and get it working immediately. For example, one problem was the tagging I mentioned earlier, ChatGPT made me realize I hadn't tagged my objects correctly.
If I had more time, there was a lot more I would have added. ChatGPT actually suggested an entire chunk loading and generation sequence complete with code, but because of the time constraints of how much I was willing to put into this article, I opted not to overhaul much of what I had already done to implement it. There's potential though, and I suspect that one could make a much larger game with the help of ChatGPT if they really wanted to.
If you're looking to do programming with ChatGPT, there's a lot that you can do from the simplest of projects to larger ones like these. This was done in under an hour after having not used Unity in two years, so imagine what you could do with more time and a more fleshed-out idea? You'll need a powerful enough PC to put together a pretty large game in Unity, but if you can, ChatGPT can certainly help you out with whatever you need.
Best all-in-one computers in 2024
Combine your desktop and monitor into one sleek package with these great all-in-one PCs
