Dungeon Sweep: Knight -- devlog 001
Tags: indie, gamedev
Published: 2023-04-25 22:27:29

I recently decided I wanted to make an indie game. I have had this idea for a while and I think it's about time.

The idea is a variation of Minesweeper with RPG elements. I'm thinking about calling it **Dungeon Sweep: Knight**.

## Art

I can't art, so I decided to go hunting for a ready-to-use tileset. A quick google search brought me to a [16x16-dungeon-tileset](https://0x72.itch.io/16x16-dungeon-tileset) with a style that I can only describe as perfect.

![Dungeon Map](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjjssqv60kwqjwtl99uq.png)

## Game Engine

After barely doing any research, I landed on [PhaserJS](https://phaser.io/). My decision primarily was it still being in active development and not abandoned yet like all the others. So let's give it a try!

I know I can use [Apache Cordova](https://cordova.apache.org/) to turn this into native Android and iOS. I don't know how well that process works, but that's a problem for Future Joel, not Today Joel.

## Generating a Dungeon

Now that I have the perfect tileset in hand, it's time to create a dungeon. This ended up being a lot harder than I thought it would be. My initial plan was to hand-create dungeons using plain text files. Run that through a function and bam, dungeon!

Example early dungeon map (that didn't work):

```plaintext
#########################
#     #    x        P   #
#     #        x        #
#     ############      #
#   x       x       x   #
#########################
```

I had a lot of difficulties with this. The first is I am using `#` to draw a top wall, left wall, right wall, and bottom wall. The graphics were different for each wall. This was going to be difficult.

So I decided to run these problems through ChatGPT. Let ChatGPT solve this so I can get on with the fun stuff. Unfortunately, ChatGPT was TERRIBLE at this. Even worse than me. So that wasn't gonna work.

After realizing how difficult a problem I gave myself, I stepped back and did a search on NPM for dungeon generators. There were MANY on there, but one stuck out.


![Open Source Dungeon Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tgcq58aetox9d20oqalh.png)

[@halftheopposite/dungeon](https://www.npmjs.com/package/@halftheopposite/dungeon) was exactly what I was looking for. It was configurable and I was confident I could make it work.

I ended up abandoning my custom dungeon generator for this one.

The dungeon generator used a different tileset, so I tweaked it until my tileset would work with it. This ended up being a little more difficult than I had anticipated since each dungeon tile returned was a number. So I had to map each number to a graphic. This was tedious but once it was done I fired up the game and it generated this beautiful map!


![Beautiful Map](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n0dz5qa5tqlr6xrt3f2h.png)

I'm trying to keep the game as a 9:16 portrait ratio so mobile view works well.

## What's Next

I have a solid base for my game, engine, graphics, random dungeons that look great. Next I'll be adding the gameplay mechanics. I'll have to drop down some enemies, lay a fog of war on top.

I think I'll have the Knight run around chopping at everything, I think that could also be fun.

Cheers 🍻