• entries
    18
  • comments
    12
  • views
    17012

Dungeon levels using threading

Sign in to follow this  

1339 views

Phew, this was probably the most difficult feature to implement ever. Now it works though. A lot of you probably forgot about what project I was working on, so let me remind you: I am trying to make a isometric roguelike, with a lot of monsters and items and stuff. A game like this usually has a lot of levels, and finally, the same can be said for my game. Using some smart though buggy code, the level is generated in a seporate thread, then piped back to the main thread, partially parsed, and displayed. A level can usually be generated after only a few moves from the player, way before the player actually finds the exit.

18.png
While working, I kept getting extra strings and bytes stuck in the pipe. It turned out that the pipe was taking a really long time to start up, and the very first message took until much later in my other thread to actually come out, right in the middle of a check status loop. Luckilly, I found the solution in the middle of solving another bug.
A lot still needs to be done on this system though. Right now, only downwards motion is supported. The game generates the level immediately below your current level in advance, if the player somehow skips right on to another level, the game needs to start generating that level right away. I also need to store old levels before moving on to new levels. This way, if the player comes back up, he can get back his old stuff.
19.png
I am also probably going to decrease the size of each level dramatically. I hope to find a artist who can draw some higher resolution graphics, then display 10 times less pictures in 10 times higher quality. This way, the player won't have to spend a long time walking around the level, and can focus on interacting with stuff.

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now