Posts Tagged ‘level’

CryptFloors: random generation, go!

January 28, 2008

I decided to see how hard it would be to hook my Random Level Generator to ActionRPG. I had it going in under an hour. I’m shocked at my own efficiency:

 actionrpg-200801282053.png

So yeah, there you have it. For the first four levels under the church, I’m randomly generating rooms and filling them with a crapload of entities. I found the levels to be too small at 32×32 so I jacked them up to 64×64. I’m not sure if thats too big or what, I’ll have to playtest a bit more before I can really tell. I’ll probably drop back to 48×48 if I find it’s too big the way it is now.

A few additional changes that may not be readily apparent:
– The stats panel in the upper left is now shortened until you open the inventory.
– The player can now move on diagonals. You couldn’t get him through doors unless you had a wall to line him up, before.
– Doors are available as a tile used in the random generation, though they act as floor tiles right now.
– Randomizer uses constant seed system now. Great for saving games with.

There’s still a ton to do, I’d really like to try out the Cellular Automata Method for the Caves. I think it will yield very good results. I’ll be doing it in the Level Generator project before I move it in here. That testbed was a super-great idea. I’m so smart.

Advertisements

Still working on Blogging Ultima III NES

January 28, 2008

The thought of mapping out 6 or 7 more dungeons on paper isn’t exactly an exciting deal to me, so I wound up putting a hold on moving forward in the game. I have enough material to write up days 2 and 3, I’ve just been focused on ActionRPG and my random level generator for the last couple of days. I still have to finish up my Mana Sanctuary youtubes in Final Fantasy Adventure, too. I’ll make up a page for those when I get around to it. I like these games, I just don’t like the massively repetitive parts. Not my idea of a smashing time.

Random Level Generator

January 28, 2008

I felt it was time to at least set up a testbed for working on some random level generators. As I was looking around, I realized that emulating the look of a Roguelike would be a quick and dirty way to show off a dungeon map. I got right into it and built a WinForms app and gave it the first two test buttons you will see below:

Level Generator - Random Rectangles

I started taking a look at some Roguelike map-related information at roguebasin, that Viridian was kind enough to pass along to me. There wasn’t a whole lot I could really sink my teeth into, but an article originally written by Mike Anderson really caught my attention. I googled and found a page where he provided an example where he was stepping through and showing the algorithm at work. Once I saw that, I was hooked. I wrote up a rooms-only version and wound up with maps that looked like this:

Level Generator - Rooms-Only Anderson Algo 

As you can see, I’ve got something to work with now. Even if it doesn’t make perfect Diablo 1 maps, who cares! I just want some rooms to move around in for now. And this shows that I can have exactly that without a whole lot of trouble.

Make no mistake, I’m not done with this by a long shot. I’m looking at the walls of interconnected rooms and considering rolling for different types of openings: standard wall-door, completely open, pillars, portcullis-walls with door, and so on. I think that will make it look much more Diablo-esque. On top of that, if you consider that there are required rooms for certain floors (the Butcher’s room, for example), I may have nailed their creation method. Only time and effort can tell for sure!

How does Diablo build its maps?

January 18, 2008

I took a bit of time to try and look up how Diablo 1 loads or creates its maps – and I came up with nothing but tile graphics. I have to assume that when you use a stair to go to a level you haven’t been in yet, the progress bar is indicating that the game is generating the map from scratch. I used several tools to look into the Diablo MPQ datafile to try and find more information out, but I was unsuccessful. Without information or raw data, I had to look to other means of working towards building my own maps.

I have the thought now and again that I should really be trying to create my own content. Right now I can’t really support content I’m not ready to build, so it seems reasonable to borrow other content. That’s why you see me building a Diablo clone – it’s a good stepping stone to start off with. I’ve built mazes before, but never anything more complicated than a 1-tile-wide corridor maze. As I think on things, I could probably look up Rogue‘s level creation method, but since I’ve already done this much I figure I might as well see it through.

Getting back to the problem – I wasn’t able to find any information about how Diablo builds its levels, and there was no indication from the datafile how to go about it either. So I decided to take another approach – take screenshots of the automap and put them together in an image-processing program (I like Paint.NET). I wind up with images that look like:

diablomaplv1-200801180807.png

With enough of these, I can start to guess at the patterns and come up with my own builder. It’s a good idea, but the mashup above is awfully hard on the eyes. I wanted to filter out the non-map information, but I didn’t want to hand-edit the compiled image.. but how would I do that? I know GDI+ a bit, but I just wanted a quick-and-dirty solution that I know only one way of creating: Allegro. So I broke down and downloaded Dev-C++ and grabbed Allegro for it. After a bit of wrangling with C++ and a couple of recompiles, I handed my new tool the image and wound up with:

diablomaplv1-200801180807_filtered.png

Perfect! Now I can really get an idea of what the folks at Blizzard were doing.

It would really have been helpful for the guys at Diablo Evolution to have put something about the map generation somewhere on their site. These guys probably know more than anyone else about Diablo. They mention that some of the screenshots in the early days of pre-final Diablo were “impossible” and they could only know that if they knew how the maps were being built. I still have to dig some more before I decide to give up on that route, but for now I’ve got a good lead.