AI-generated game code 🤯

All you need to do is describe what you want and GPT-3 will try to write it down as a Unity c# script.

#gamedev #madewithunity #gpt3 #deeplearning
Just to be very clear, this is *not* a joke. It's pretty much just raw GPT-3 running on a simple prompt with a large output size. I really didn't do much to prime the model here, it's just running as is. All I did was ask nicely. A script that shoots bullets, generated by GPT3A script that changes teh camera FOV, generated by GPT3A script that downloads a json, generated by GPT3A script that plays a random sound, generated by GPT3
After that my part was just creating what I lovingly call a bootleg code formatter/highlighter that runs within the built-in Unity GUI. The API sends back everything as a single line, so it needs to get cleaned up to compile and run. Unformatted codeFormatted code
If you have an OpenAI API key, you can try this yourself with the prompt followed by `using UnityEngine;` on a new line which essentially tells gpt-3 that you're looking for a piece of code, since it's trying to complete what you started. Adjusting the temperature helps.
Full transparency, the video is edited down a bit because I was having inconsistent results with different prompts.

A common issue is that the text would show up twice with numbers in between, I'm guessing it comes from samples with line numbers and a plain text version to copy. An example of an output with line numbers
Apparently it's also capable of building shaders, but those tend to be pretty long so it consumes a lot of tokens for each request and they are very complex to format so I didn't experiment much with it. An example of a generated shader
I originally wanted to tie that into my VR experiments, but I think @Alientrap already killed it with his GPT3 NPCs:

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Ivan Mathy

Ivan Mathy Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!