My first few experiments with ChatGPT game development have been cautious successes: A couple of mostly working Unity shaders and scripts, a simple 2d game where the player is a D (dog). You click to plant * (trees), and move the dog with arrow keys. The dog collides with the trees. Great success.
Most impressively so far, in about 30 minutes I managed to have a crude .io-esque agent-based ecosystem simulation running in a single C++ file, generated almost entirely by the AI, minus a few technical corrections which were easier to do by hand.
Here’s the code: https://github.com/NClin/ChatGPTMakesFish
I am stunned by the potential of ChatGPT for game development, and development in general. This was my first time on ChatGPT, having just been handed a friend’s laptop, bumbling through with natural language, without having so much as read the FAQ. By that I mean: This was not hard.
Here’s the workflow I imagined: ask ChatGPT for an architecture, then ask for the parts, stick it together, run it. It worked.
Here was the initial prompt:
And Bam, an architecture: I’ll give this full output to give an idea of how detailed and coherent the AI’s responses are - they are extremely useful, and can suggest multiple approaches to a problem, with pros and cons.
I didn’t want to beat around the bush, so I thought I’d just ask it to do it:
And, essentially, it worked:
There were a few teething problems, the output was consistently stopping half-way through and outputting broken code after continuing:
However finding a workaround was not difficult: In this case I targeted the broken function, then pasted it in where the code was discontinuous - probem solved.
The AI also guessed at a few non-existent functions, but either found correct ones (sometimes with explicit directions), or simply wrote a fitting solution, with further prompts.
Something else that happened: Half way through I realized I was using the wrong C++ version. I asked the AI for step-by-step directions to fix that. It provided correct step-by-step instructions with more clarity than google. I wouldn’t google this problem in the future - ChatGPT was simply more useful.
We then got stuck with on simple string conversion problem which I spent 10 minutes trying to get the AI to solve before manually repairing it - potentially crippling to a C++ newbie using this workflow.
It works:
What Excites Me About This
Game development is a massive headache. You have a cool idea, you find some cool algorithms to implement it, make a couple of cool bits of art, then you spent 3 months trying to work CMake out while switching back to Unity for experiments while burning yourself out on computer science and wondering if you should be putting this energy towards something remunerative. The technical challenges are immense for a pursuit requiring so much abstract design thought. Doing constant battle with the devils of details exhausts and distracts you. You end up an engineer - this hump, if all I’m told is true, never truly ends.
So basically, the cognitive load and sheer energy expenditure of the technical work takes away from the creative output.
ChatGPT solves this.
There are bugs to fix, and I’m sure we’ll find limitations as we go, but I cannot wait to see what’s to come as this tool becomes refined and better integrated with programming tools. When a programmer can ask ChatGPT questions directly in an IDE, with the AI answering in the context of the entire current project or codebase, I believe this tool’s power will be increased by orders of magnitude.