7 sentences made Codex make a small game for me, a minimalist version of Zelda, I can't stop playing it
Mengchen Xiaoxiao sent from Aofei Temple
Quantum Bit | Public Account QbitAI
What? Just 7 sentences made the AI generate a small game for me?
Or a "minimalist" Zelda This classic adventure game, where you can not only pick up gold coins and hide from monsters, but also have unique maps.
This is the true experience of a guy named Andrew Mayne. During the whole process, he didn’t even write a single line of code !
After posting the AI-generated game and game code online, it gained thousands of views in just a few hours:
Netizens who came to watch tried out the game he created and exclaimed “Mind blowing”.
So, how did Andrew Mayne do it?
It turns out that the AI he used to make games was the latest version of Codex from OpenAI .
In addition to being able to directly generate, modify, and edit code, this version of Codex also doubles the length of text it can process , from 2048 tokens to 4000, which is like "unlocking a layer of seal."
At first, Andrew Mayne was just curious about the creativity limit of this version of Codex and wanted to do an experiment to see if it could generate mini-games directly from text.
Unexpectedly, he couldn't stop trying it.
7 Sentence Generation Adventure Game
His first attempt was a game he named "Minimalist Zelda".
Don't be fooled by the abstract graphics. The whole game includes core game elements such as randomly generated maps, players controlling character movements with the keyboard, enemies attacking players, and collecting gold coins for extra points.
If you walk to the edge of the map, you can generate a new map, so you can keep playing... In short, it looks like a 2D adventure game prototype .
All these rules were written in just
seven sentences
in English
, while the AI wrote 190 lines of code in Javascript.
Since the guy himself is not a professional game designer, the words he uses for description are not very precise, but AI can always come up with its own understanding.
For example, in the part describing the monster, the description only says "a red monster, it moves when the player moves, trying to get close to the player, and if the player is touched, one point will be deducted."
The AI generated more than 50 lines of complete logic for monster generation, movement, and score determination based on the context.
Just replace the color blocks with simple textures, and it will look very similar to the real Zelda prototype, right?
△
The first generation Zelda prototype program was exposed
In the second mini-game, he intends to test the AI's understanding of logic by generating a simplified version of the word guessing game Wordle .
This time, only 5 paragraphs were used to describe the rules.
The answer is randomly selected from a list, and one is chosen each time and put on the console.
Describe the style of the letter input box, including width and height, center alignment of text, each input box has an independent ID; automatically capitalizes when input; and add a confirmation button.
How to determine the input results is discussed in four situations.
Later, he made more attempts, calling third-party libraries to generate 3D mazes , tic-tac-toe games that can be played against players , and small programs that add filters to photos, all without writing a single line of code .
One of the more interesting ones was the generation of the Matrix character rain visual effects, which was pretty much done by just telling the AI “create a canvas and add a Matrix rain effect” without any additional explanation:
Finally, he summarized
several experiences
and introduced how to write text descriptions to make it easier for AI to understand requirements:
-
Describe the logic part first. Then call the previously generated logic function when creating UI elements.
-
Number the descriptions. This makes it easier to see which description the AI is processing.
-
Let the AI create functions more often. If you ask the AI to generate an array of 100 items, it may write out each item one by one. If you tell the AI to create a function to generate an array, it will use a loop statement to complete it.
-
If the result is not satisfactory, try it a few more times. Setting the temperature parameter to 0.5 may produce better results with a certain degree of randomness.
It looks a bit like a product manager summarizing how to communicate with programmers.
The "re-evolution" of Codex behind the scenes
So, how useful is this latest version of Codex?
In addition to the doubling of the token limit, which is what Andrew Mayne is most interested in, the newly added functions of Insert and Edit are also quite interesting.
Let's first look at the editing function of Codex . For example, optimizing code performance can be done with just one sentence:
Or change the programming language to implement the code:
There is also " One Liner Programming" , which can be achieved with just one command:
With this feature, the difficulty of adjusting the code will be greatly reduced.
When using Codex, you can even do what Party A does, without having to manually adjust the code . You can just give orders to the "AI programmer" and it will generate what you want.
Let's take a look at the Codex's Insert function .
Not only can it automatically generate comments to remind you of the purpose of this code:
It can also understand the function based on the context and actively insert its definition for you:
Whether you are developing a framework or writing small software, you no longer need to worry about "going down one path to the end", you can make adjustments in the middle according to your needs.
Of course, these functions are also similar when applied to GPT-3. Whether it is a small trick like changing the person or changing the format:
Or modify and insert statements according to the context, no problem.
In addition to these two features, there are also some detailed updates, such as a simpler UI.
In fact, this series of new features is designed to make Codex and GPT-3 easier to use.
According to OpenAI scientists, they hope that through this update, more " non-professional players " can also play GPT-3 and Codex.
This has indeed attracted many interested netizens to try it out.
Andrew Mayne, who came up with "7 sentences to make AI play games for me", was originally just a thriller novelist .
△
He is
wearing
a SpaceX hat, too many elements
In addition to him, people including Wired editor Clive Thompson are also trying to use Codex to write code for themselves.
Clive said that Codex has a lot more knowledge than these "amateur players" and can select the most appropriate functions and libraries to meet the needs. For example, when receiving a PDF-related request, it calls the PyPDF library.
Another netizen said that he used Codex to make a "Space Invaders" game , which was also successful.
Seeing these results, some netizens lamented that when AI really learns to write code, there may only be two things left for humans to do: write better AI, or think about what can be generated with AI.
However, more cautious netizens believe that AI-generated code can easily make people dependent on it, thus ignoring the problems of the code itself. For example, the image processing code written by this author using Codex has some inaccuracies:
Some netizens also predicted that if AI is used to write code, engineers will still have to adjust it in the end, which is essentially the same thing.
Would you use AI to write tools or make games?
Reference links:
[1]https://andrewmayneblog.wordpress.com/2022/03/17/building-games-and-apps-entirely-through-natural-language-using-openais-davinci-code-model/
[2]https://twitter.com/AndrewMayne/status/1504612428432125970
[3]https://beta.openai.com/docs/engines/codex-series-private-beta
[4]https://news.ycombinator.com/item?id=30717773
[5]https://www.wired.com/story/openai-copilot-autocomplete-for-code/
[6]https://www.facebook.com/andrewmayne?_rdr
-over-
The "Artificial Intelligence" and "Smart Car" WeChat communities invite you to join!
Friends who are interested in artificial intelligence and smart cars are welcome to join us, communicate and exchange ideas with AI practitioners, and not miss the latest industry developments and technological advances.
ps. Please be sure to note your name, company and position when adding friends~
click here
Featured Posts
- Porting GD's USB protocol stack based on HAL library F4 series (Device/CDC_ACM)
- TheHALlibraryiscurrentlydevelopedusingtheGD32programandIfoundthatUSBconfigurationisabigpit.Doesanyonehaveexperienceinportingthatwecanshare? GDandHALarenotcompatibleatall,thisiscommonsense ST'sHALiscompa
- Gavin666 GD32 MCU
- What is the difference between a thermocouple and a RTD?
- Indailywork,weoftenencountertheuseoftemperaturemeasuringinstruments.Thermalresistorsandthermocouplesarebothtemperaturemeasuringinstruments.Atthesametemperaturemeasurementlocation,shouldwechoosethermalresistorsortherm
- 造物工场 PCB Design
- Prize live broadcast: TI low-power MCU products and Zigbee wireless solutions are now open for registration~
- Prizelivebroadcast:TIlow-powerMCUproductsandZigbeewirelesssolutionsarenowopenforregistration~ Clickheretoregister Livebroadcastintroduction: FirstScene SecondScene
- EEWORLD社区 TI Technology Forum
- Experience in using MQTT protocol
- TheMQTTprotocolisbuiltontopoftheTCPprotocol,justlikeacarchassiscanrunwithfourtires,butifyouwanteveryonetodrivemorecomfortably,westillhavetoaddashelltothechassis. Whydoweneedtoencapsulateanotherlayero
- Jacktang RF/Wirelessly
- Active and passive cell balancing for battery packs
- Multi-cellbatteriesaretypicallybuiltasarraysofcellsconnectedinseriesorparallel. Toomanycellsinserieswillresultinahigherpackvoltage,whiletoomanycellsinparallelwillresultinahighertotalbatterycapacity(exp
- qwqwqw2088 Analogue and Mixed Signal
- 【2024 DigiKey Creative Competition】+Environmental temperature, humidity and air pressure monitoring based on Teensy4.1
- Introduction Thisworkmainlyrealizesthemonitoringanddisplayofthetemperature,humidityandatmosphericpressureoftheenvironment.ThemaincontrolMCUusestheTeensy4.1developmentboard,andtheenvironmentalparameterdetectionuse
- 流水源 DigiKey Technology Zone