Hacker News new | past | comments | ask | show | jobs | submit login

> More importantly, it gives me the courage to dream and attempt things beyond my current abilities.

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.




I taught myself to code just to build a prototype of an app I wanted to create. My plan was to launch the prototype, get some market feedback, and then find a technical cofounder or hire someone.

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.


I am software engineer and I have certainly attempted use GPT for coding with mixed results.

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.


I use GPT-4 for coding and technical tasks every day, its abilities to make ideas a reality which would otherwise take me days or weeks is astonishing.

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.


Very sorry to hear about your upbringing, btw. I hope writing your story helps.


Given the token count limits on input and output, I've been wondering how folks work on these long-running projects? Is it just not a problem, or are there some tactics? I find in trying to build up lengthy outputs that it starts truncating or leaving out things from way before.


I think this is a good question. Screenshots are hard on HN, but I could write up a blog post about it all once I have a demo of the game.

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.


Super useful, thanks for writing this up. I bet a short blog post with screenshots would go over great.


What happens when you ask chatgpt to create a game similar to one that does not exist?


If you can induce it to hallucinate, it should just do whatever it associates that the words in that title with.


I use the API and have a generic prompt prefix for each programming language and type of task to try to get as much bang for my buck with as small of a token count as possible, and then tossing in a single query with a bit of project-specific code fleshes out the rest of what I'm asking it. Prompt tokens are usually around 300-1000, leaving over 3000 for the response (which it rarely fully uses).

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.


Shameless plug: I created promptr to help with this.

https://github.com/ferrislucas/promptr

Edit: this PR has some examples of what’s possible https://github.com/ferrislucas/promptr/pull/38


You have to input just the pieces you want help with. It can't do a whole project, but you can tell it the tech stack, and maybe give it a few of your classes, and it can then write a new class for you.


I like how everyone has been using ChatGPT to code in Javascript, as I have done something as well.


ChatGPT benefits from how abundant languages like Javascript and Python are. When you start diving into the lesser used languages, the struggle becomes real. Even worse if there have been substantial breaking changes in the past ~2 years.


TypeScript happens to be my current strongest language. I picked Phaser since I wanted to learn the ins and outs of building the game and not need to worry about the language I was writing in. This was also helpful because GPT-4 would still get small things wrong with the TypeScript, but I was able to easily fix those without needing to ask it.

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.


I’ve been using it a lot for programming, but I also have a security background and it will often generate insecure code. I’ll point it out and tell it to fix and it will.

So be careful if you don’t want AI-generated sql intentions!


Different people write code of different quality, and we'd expect LLMs to imitate the median quality of code. So it's clear that if you have a background in something then it will generate worse code than you would - however, if you'd compare this code with something written by a new junior hire, how would it compare? IMHO there are many people who are objectively below median, and for them I'd expect that a LLM can generate more secure code than they would write themselves.


The power of LLMs atm is that they allow a person to be "median" in a very wide range of topics. This is extremely powerful, even to folks that can attain an above average mastery. It also does this quickly.

There was a recent article on Slashdot titled something how metaverse may increase the gdp by like 2 or 3 percent. It was obviously laughed at. It's actually LLMs that will do this, and easily.


It's also a solid rubber duck, it'll test you by giving you misinfo and you have to tease it back from the brink.


Yeah, a coworker tried an exercise like this, and it was basically (even with as-an-expert prompts) like trying to mentor a high school intern that's trolling you (except that it won't actually get better at anything in the process.)


As if injections weren’t bad enough, they’re now done with intent.


Intent worries me less! It’s the PHP days all over again - lots of new coders (good thing!), copying insecure code (VERY bad thing!), and it won’t end well.


Yes... The last time this happened we got Facebook and the world is still recovering from that


Honestly one thing that worries me the most is the biggest applications of AI at scale so far are to manipulate humans to click on things (ads).

Google has been using this stuff for years, OpenAI has done the world a great service by opening it up.


> So be careful if you don’t want AI-generated sql intentions!

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.


> More importantly, it gives me the courage to dream and attempt things beyond my current abilities.

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.


Heck yeah, cool! Similar experience here too. In only a few hours I got a basic working custom JavaScript space shooter going, and I've since started a Whac-a-Mole style game.

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.


I'm trying to visual the process you're using for this, and it's just not coming to me. Can you give me a run-down on it, or point me somewhere that has one?


Yep! I answered on another comment: https://news.ycombinator.com/item?id=35891575

I might expand on this in a blog post.


I'm thinking about doing this without any game dev experience as well. All I need is access to GPT4 now...


If you don't want to pay for ChatGPT Plus, you can use an alternative client (e.g. https://www.chatbotui.com) with an API key fairly cheaply.


Wait. I have an API key. Is GPT-4 available already?


Only if you've gotten through the waitlist. I signed up at least a month ago, no word. There was a comment thread the other day about getting around the wait by selecting the option that you're looking to build plugins, which apparently gets you expedited.

I haven't tried it. As always, YMMV.


Aaaah it started working the same day I paid for (and cancelled) ChatGPT Plus and I probably missed the waiting list email!


You have to request the access for the GPT-4 API.


I though phind runs with gpt4?


release it !




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: