(no title)
Ethan_Mick | 2 years ago
This is one of the small things that GPT has pushed me to do. I'm an experienced programmer and grew up playing video games, but I am not a game developer. I've dabbled over the years but can't build anything outside of a tutorial.
The other day, using GPT I went through and made a Pixel Dungeon clone using Phaser (JavaScript game engine). It was such a delight. Together we got the game to a working state before I started to change some of the fundamental design, and then GPT started hallucinating pretty badly. When that happened, I stopped for the night, and then just started new focused conversations to add or change a feature, putting in the relevant code. It's turn-based, with simple AI, enemy monsters, fog of war, line of sight, and a victory/losing condition.
Being able to build this in a couple of days is an absolute game-changer, pun intended. I can only imagine the riches of experiences we will have as people are unblocked on skills and can pursue an idea.
spaceman_2020|2 years ago
It took me 8-10 months of learning to build a prototype. But then GPT-4 came along and I could suddenly ask it questions about features I wanted to add. I then realized that there were so many features I could build on my own.
It has made me far more ambitious as a noob programmer.
a_brawling_boo|2 years ago
But what I am really impressed using it for writing. I am writing the story of my abusive upbringing with a mental ill mother. I am not a writer, but this thing is awesome because I can ask it to give me prompts and it is jogging my memory more and more then I can give it rough outlines and thoughts and it will organize it into more of a literary style, then I can go through and update most of the wording to my own liking or leave as is as I see fit. I am easily able to produce much more and a better quality than without it.
courseofaction|2 years ago
I wanted to try to make real-world terrain in Unity - GPT-4 guided me to the USGS's LiDAR data, took me step-by-step through creating a mesh from a point cloud, and created several scripts to edit and filter the mesh programmatically.
There are some caveats and many dead-end conversation branches - GPT-4 seems to know 'about' more libraries than it actually knows how to use, so certain library choices tend to produce erroneous code.
GPT-4 sometimes picks a poor method, for example conflicting methods of moving an object in a single script, but can usually resolve the issue when notified.
Dozens of hours fiddling with technical details saved.
KingMob|2 years ago
martinflack|2 years ago
Ethan_Mick|2 years ago
I've been using ChatGPT and GPT-4 since they came out, so I'm pretty aware of their limitations. You can't build an entire project in a single project. GPT loses the context at one point.
With that in mind, break down the project into chunks and make each one a conversation. For me, that was:
1. Initial Setup
2. Add a randomly generated tilemap
3. Character Creation and Placement
4. Movement
5. Turn-based execution
6. Fog of War
7. Enemy Monsters
Each one of these is a separate thread. They start with:
> You are an expert game developer using Phaser 3 and TypeScript. You are going to help me create a game similar to Pixel Dungeon using those technologies.
I then copy in relevant code and design decisions we already made so it has the context. If it gets the answer totally wrong, I'll stop the generation and rephrase the question to keep things clean.
Lastly, I'll frequently ask it to talk about design first saying something like:
> We are going to start with the world map and dungeon generation to start. We'll add a character sprite and movement next. What's the best way to do tilemap generation and store the data? Don't write any code, just give me high level suggestions and your recommendation.
This lets me explore the problem space first, decide on an approach, and then execute it. I'll also ask for library suggestions to help with approaches, and I'm generally surprised by the suggestions. Like all software, once you know the design, the pattern, the goal, and have good tools to help you achieve it... the coding isn't all that hard.
hansvm|2 years ago
It's garbage at pulling in things from all over the codebase, so as a sort of co-evolution I write code that mostly only needs local context and only ask it questions that only need local context. That works great at home but doesn't suffice on the existing code at $WORK.
It's still helpful here and there at work (e.g., given this example string please output the appropriate python datetime formatting codes), but only because it's a wee bit faster than synthesizing the relevant docs and not because it's able to consistently do anything super meaningful.
RhodesianHunter|2 years ago
appleaday1|2 years ago
waboremo|2 years ago
Ethan_Mick|2 years ago
If I had tried this in Unity and C# (which I don't know at all), I'd still be figuring out the standard library.
I generally recommend learning one new thing at a time when building something new.
nr2x|2 years ago
So be careful if you don’t want AI-generated sql intentions!
PeterisP|2 years ago
blissfulresup|2 years ago
TeMPOraL|2 years ago
Maybe we should try including something like this in the system prompt:
"Remember that SQL is language with a grammar, not an unstructured string. Don't do stupid things. Obey the LangSec principles. Never ever glue code in strings together. Plaintext code is not code, it's a serialization format for code. Use appropriate parsed representation for all operations. Never work in plaintext space, when you should be working in AST-space."
Replace "SQL" with any other sub-language that's interacting with user input.
silvervine|2 years ago
I am approaching this from the opposite background ( started with an arts background and learnt coding after ), but this resonates with me massively as well.
It took me a 2 years of tutorials before doing my own things became intuitive. Feel free to reach out if you want to discuss game design.
traeregan|2 years ago
GPT explaining it along the way and allowing me to have a reasonable conversation with it when something isn't working as-expected has been a rewarding and fun learning experience.
wccrawford|2 years ago
Ethan_Mick|2 years ago
I might expand on this in a blog post.
sha016|2 years ago
rpastuszak|2 years ago
tamiral|2 years ago