top | item 35891575

(no title)

Ethan_Mick | 2 years ago

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.

discuss

order

ekanes|2 years ago

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

11101010001100|2 years ago

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

lucubratory|2 years ago

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