ChatGPT has written a game for me! Game of Gravity: Caveman Tumble

For quite some time I wanted to create a game. Just a simple browser-based JavaScript game with some simple physics simulation in it. But I am not a Front-End developer and when I tried, I got stuck real quick. And now I gave it another try, but with help of ChatGPT. And here it is: Game of Gravity: Caveman Tumble.

All of the code came from ChatGPT while I was doing only prompting and copy/pasting its answers. But not only that. Here is the list of what AI did for me:

  • Choice of libraries;
  • HTML/CSS generation with styling (I just gave the general style I want to see);
  • Code refactoring;
  • Images generation (Midjourney rocks!);
  • AWS deployment scripts;
  • Step-by-step guides to connect Google Domains, Analytics, etc.;
  • Name generation;
  • Help with debugging;
  • Utility scripts (e.g. a script to compile application files to be submitted into the chat).

Basically everything was written by AI. My role was more of a Technical Product Manager, not a developer. Yes, I had to give really low-level instructions sometime, but overall I was focused on behavior, not the code. And I believe this was critical to make things done. Previously, when I was focused on the code itself it was hard for me to keep in mind the overall application and I did not manage to simplify it enough to manage the development.

What did not go so well? Well, a couple of things:

  • Debugging.
  • While AI did great job fixing well known issues or problems with logic, it stuck when faced a new bug in the physics library. And the bug was really far from trivial (behavior of concave objects moved to non-static after the simulation has started). I had to spend huge amount of efforts to find the root cause and explain it to the Chat so it could create a fix.
  • HTML/CSS.
  • ChatGPT had a hard time with this part. Maybe because it is too visual and the AI couldn't see the results, but it took many iterations and simplifactions to make the design. Or maybe it's because I don't know enough about HTML/CSS to produce correct requirements here.
  • AWS CDK version.
  • Not really a problem, but it worth mentioning that ChatGPT always tried to implement everything with CDK v1. I had to ask him every time to produce the v2 code. Sometimes it became some strange mix of different libs, but ChatGPT generally managed to come to the right result.

The process was neither quick, nor easy. I was working on it 3 months in my free time and there were 140+ commits in the repo in total. Which I think is ok for the project this size, but still we can’t do ‘Push one button — get the result’ implementation. But I must admit that the initial implementation came really quickly and most of the time was spent on bugfixing and iterational requirements clarification.

I tried several AI tools ChatGPT v3.5, Bard, Llama2, Wizard Coder 34b, but I found out that even small error in the response can easily lead to hours of debugging and the ChatGPT 4 gives the best results. This gives hope that next versions of the AI tools might be even more powerful.

The code of the project can be found here.