Making an AI-Assisted Game in 14 Days: What I Learned (Part 4/4)

Michael Hsieh
8 min readFeb 5, 2024

--

Catch Up, Or Pay the Price

Photo by Valentin BEAUVAIS on Unsplash

After finishing my game, it was time to look at results and how I progressed using free AI tools. Then compare them to how I might have progressed without them. Also, summarizing how certain AI were helpful on certain tasks.

Chibi Toss gameplay

Takeways

The results of using AI was a little underwhelming, to be honest. I did not get as far as I wanted to, so the game is lacking in areas like visuals, sprite detection, and challenge level. However, I definitely saw a boost in productivity.

I would guess it made me roughly 2x more productive. A couple numbers are provided below to back that claim up, but it’s not comprehensive or anything.

Results: ChatGPT-3.5

The game has 2 files, one for the UI, and one main file.

My main game file had roughly 4 classes and 34 functions relating to playing the game. Of those, roughly 3 classes and 16 functions were more-or-less generated from ChatGPT:

  • Tile, Sprite, and SpriteInfo model classes
  • Functions relating to distance, bed random positions, is sprite resting, touch detection, sprite launching

I did have to edit a couple lines, for example fitting randomly generated beds within the bounds of the screen.

A win for the robot

That’s roughly 50% code by the AI.

The rest used ChatGPT’s code but also required more modification to get desired results, mostly in doing setup.

  • GameScene class unsurprisingly required lots of changes because that’s where most of the gameplay code is.
  • Functions relating to sprite setup, camera tracking, and collisions needed adjusting, as well as updates such as for the score

One of the reasons was ChatGPT-3.5 could not remember what I told it previously, so code that required prior knowledge was written without such knowledge in place.

I believe this is partly because the free version is lacking what’s called a longer context window.

For example, sprite setup needed randomization for positions and changing images. ChatGPT’s snippets were incomplete and didn’t match with my previous setup code when asked for changes.

I guess one option would be to paste your entire code into the chat window, if you can, but this felt a little weird to me at the time. In the future I could attempt this.

Human and robot, combined

My UI file, on the other hand, required extensive modifications. It was to add menu elements like the score. Also I had a lot of trouble setting up the scene using the given code of ChatGPT-3.5. One early setback with its old, wrong code delayed me for some time.

Overall, it boosted development though also I had to watch out for mistakes.

If ChatGPT-3.5 can search the Internet and have longer conversation memory like in ChatGPT-4.0, then I believe a lot of mistakes will be lessened. Which makes using this AI more appealing.

My conclusion: 3.5 is good, but not as much as it could be. Consider using ChatGPT-4.0.

Results: Stable Diffusion

Stable Diffusion was good at getting me off the ground. I could generate sprite images to serve as a base well enough. The pain point came from researching different methods to modify those images to my liking.

A lot of trial-and-error was involved, especially for changing facial expressions but keeping the sprite otherwise the same.

I needed to search through many checkpoint models and LoRAs, try them out individually, and then try to fix results. Besides those, I needed to understand different settings in Automatic1111 user interface, such as the denoising strength and masked options for inpainting.

There were simply too many adjustable settings, interacting parts, and possible sources of error for me to keep track of. Debugging proved to be slow.

Happy expression using LoRA

The images themselves did not keep a consistent visual style, in my case chibi cartoon. The background and sprites for example are different styles, the background being more photorealistic. The images also had problems like blurs or smudging that I needed to fix. It took several generations to get decent results, and even then some manual editing was required.

I ran into AI’s famous consistency problem. Though, many people are already advancing ways to fix that.

Pace of AI improvements coming out is fast, but at times feels like navigating a labyrinth

Now, you could use Midjourney, Dall-E 3, or some other commerical generative model. The appeal of a Stable Diffusion model, however, was that it was free and very customizable. Many extensions are available. You can also see how it works under the hood.

I kept feeling the limitation was myself — not knowing the domain of AI image generation well enough to be effective with it.

My conclusion: Either get very good at finding and learning effective generation techniques, or pick commercial models to get moving faster.

Pay the Price

I don’t exactly mean you should pay for commercial models. I mean that, free or commercial, either way you must pay a price. The “cost” of a free model is it’s less on the cutting-edge in terms of effectiveness. This will limit your ability to take advantage of the AI. Not only that, but you must figure out a workflow that works for you and your projects.

Basically you have to spend energy playing catch-up.

The “cost” of a commercial model, is you are giving companies your money. And sometimes they are already big companies, or you want to save money, or whatever.

Even if some commercial models allow you to use their model for free, you are typically limited in using them.

You also are dependent on them. You don’t know how their AI tools work, and they can change the model or pricing on you without warning. Lock-in. Less customization. Not cheap.

However, you will make more progress with your own projects with paid or limited-free commercial than going the free route, I believe.

Future Considerations: Current AI

Now I’m going to talk in general about AI and the future. Just my opinions and hypotheses.

In a previous article I made a couple highlights relating to ChatGPT which I’m repeating here:

ChatGPT can be very wordy even for a simple problem. In some cases, it has not yet learned to give short, readable solutions based on your skill level when you first ask it a question.

Think this will be solved eventually.

If it doesn’t have a good solution, it will not tell you so. It will repeatedly attempt to give you answers, confidently.

Of course as a chatbot, it’s incentivized by OpenAI to give you something and make you feel like it’s useful. However, you must be careful if you’re dealing with a model that can’t search things online or run code itself. Otherwise you may end up running in circles trying to get help.

ChatGPT is most useful if you already have a good grasp of the context or background of why you face problems in the first place.

I wasn’t sure how exactly to word this. Sentence still doesn’t feel right to me. What I mean is understanding fundamental concepts and the landscape of whatever you’re working on helps.

Want to make a game? Then understanding your game genre, game development tools, and best practices doesn’t hurt.

In that sense, people who already work in an industry will be able to take much more advantage of AI than amateurs.

You can get a back-and-forth tutoring role in a subject when using an AI. Like an interactive form of learning. When I was coding a game with ChatGPT, I learned a bit more about game development than I normally would. When I was making images with Stable Diffusion, I learned a bit more about digital art basics.

On an optimistic note, I think AI could help people gain more interest in fields if they’re exploring projects related to that job.

Future Considerations: Work+

People will focus more and more on having good higher-level concepts, and deal less with low-level concepts that AI can handle.

Yeah. I think this extends to knowledge-work jobs in general.

A lot of worry about AI replacing jobs is understandable, but I think what’s less apparent is the increased expectations and pressures which will be put on existing workers.

Let’s take a picture of the near future. Assume people have made AI that can overcome its current limits.

If you’re a software developer, everyone’s got coding assistants now. You’re now expected to crank out more working code in shorter time than before.

If you’re a writer, the quality of your human writing must be able to exceed that of a thousand nimble chatbots in order to eke out a living. And chatbots, like it or not, can write.

If you’re an artist, you can now use your existing skill to perhaps retouch or exceed AI art, but now AI art is reaching prior human levels.

If you make movies, now your movies and overall direction need to be top-notch, because parts within can be automated.

Best to be prepared.

1 person can now be expected to do the work of 10 people (exaggerating here, depends on the job and one’s skill level). It’s not only that AI will replace jobs. It’s that we’ll all be forced to produce higher-quality work than ever before. Customer expectations will shift, because now more is possible in less time.

It can be good in a way. Now instead of worrying about, say, coding tasks for an app, you can focus on your app design in general. Routine tasks, research, tests, and mini-features can be done in a flash, on command. You can pay attention to how to stitch those tasks, generated by an AI, into something more pleasing and more useful for users.

Conclusion

I’ve read articles talking about AI gaining general intelligence and causing humanity’s mass extinction. That’s silly in my mind. It downplays real problems. We already face difficulties now, adapting to tools coming out, and people good or bad will use AI for all kinds of purposes.

I think of much more concern for us is AI augmentation taking over our lives, at least here in the tech-centered parts of the US, and dealing with so much change.

Us being pushed into a new mode of living.

Anyways, thanks for reading. That’s all for now.

--

--

Michael Hsieh

California-based Mobile App Developer. Software Engineer. I like sharing what I've learned with others.