• Advertisement

Archived

This topic is now archived and is closed to further replies.

Randomly Generated Maps

This topic is 5047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to find out how games like Diablo and Worms generate random maps. I''ve got some theories, but I''d like to read some articles on the subject.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I dont know about worms but diablo doesnt have random maps. They have a set number of maps and they just randomly pick from those maps.

Share this post


Link to post
Share on other sites
I think Diablo also rotates its tiles. It is suprisingly hard to detect, but that may just be the view point.

Share this post


Link to post
Share on other sites
I don''t remember diablo, but their random map generator should use some hard constraints :
- for the rooms : not too big, not too small.
- for the items : not too much, not too close.
- for the ennemies : not too mu...(no this constraint was not implemented yet).

For all of this they have some values to fit such as the global difficulty of a map this imply evaluating the world generated and correct it.

For the walls, it is generated i think more by lines using tiles than by tiles directly.(all of this with orthogonal constraint)

This is my point of view.

For the worms, it can be more difficult i think.
Perhaps they generate a texture map with random data or much better with fractals and after that they use simple test with a value set before to make a black and white texture ( terrain or sky ).

Share this post


Link to post
Share on other sites
This one gives cool results:

http://dungeonmaker.sourceforge.net/

Share this post


Link to post
Share on other sites
Don't know about those, but when I was writing map generators, I relied on several algorithms:

1) Random seeding: place random trees, land tiles, or whatever you want a clump of around the map. Do this by either placing a certain number in random locations, or having a probability of placing one at each location.

2) Clumping: Loop through all objects placed (by testing all locations if necessary) and if a random number is less than a probability, place that object in neighboring cells as well. Repeat this loop as many times as necessary. If you are looping through all locations, double buffering of the map may be necessary or you will get an "icicle" effect where things grow downward or to one side (depending on loop direction).

3) Random changing of parameters: if you have objects like the doodads of Warcraft III, randomize their parameters such as orientation and scaling.

Those are some basic things that can help a lot.

EDIT: Note that I have looked in the past for articles and not found any. Gamasutra's article on universe creation was good though.

[Edited by - Puzzler183 on June 15, 2004 6:50:10 PM]

Share this post


Link to post
Share on other sites
You could make random maps using a sort of cellular autamata approach. Basically, take a set of tiles and set each one to something completely random. Then have a function that goes through, tile by tile, and decides what the tile should be based on it's neighbors. Say, if you want 70% of the map to be land tiles, then for each tile, if there is a land tile near it, then have a 70% chance that you'll change it to a land tile. Or else it will stay what it was before. This can get sort of clumps of tile types easily enough. You could run the function over the same map as much as you wanted until it was smooth enough or whatever you wanted. It might work.

Share this post


Link to post
Share on other sites
You can achieve all sorts using a very basic set of primitives and some simple rules...

worms, to me, has a distinctly "multiple height maps" look to it. If I had been trying to make a 2D world for worms to play in, I'd have gone for 2D perlin noise combined with a single heightmap.

What end result do you want though? Procedural height maps for landscapes are childs play. Connect randomly placed spheres with cylinders and then apply turbulence to the result, and you get a complicated maze of interconnected blobby shaped rooms. Take a set of prefabricated rooms and link them all together at random, and you get something a bit like a quake deathmatch map. You can build a top-down style dungeon using L-systems with a bit of imagination. The world is your oyster :)

Share this post


Link to post
Share on other sites
Original Diablo did generate random maps for all levels except 16. Diablo 2 does some random maps but not so much in dungeons.

I think that with a few rules, it wouldn't be all that hard to do.

There seem to be basically two types of random map generation in Diablo 1. One is the "large room subsectioned" version evident in the first few levels, the other is the "small rooms spaced and interconnected" version evident in the Caves and so forth.

For the large room subsectioned scenario, other than size boundaries all you really need is to enforce rules such as "at least one wall must contain a door or opening, and that wall must not be a boundary wall". This basically follows the rules of random maze generators, the main difference is that you don't particularly care whether or not all the rooms are the same width.

In the small rooms interconnected scenario, mostly all the small rooms need to be placed and have the rule that they have at least one door or opening, then the rest is just connecting them up.

-fel

Share this post


Link to post
Share on other sites
If I were you, I would check out the articles on www.roguelikedevelopment.org .
In addition, you could search the web for roguelikes and search thru their code. Diablo is a roguelike game with nice graphics, but many of the big roguelikes (adom in particular) has many nice dungeon generation algoritms. (adom is closed source, but angband, moria etc is opensource).

Share this post


Link to post
Share on other sites

  • Advertisement