Jump to content
  • Advertisement

Archived

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

Leonid Shevtsov

Automatic Level Design

This topic is 5797 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

Advertisement
I can think of 2 ways.

One would be a randomized generator of different map pieces using good ol != and == == meaning that the basic rules say they can connect.

The other is making about 100 or so maps that it randomises for each type of map. The problem with this si I dont know how they get level 2 butcher and stuff like that in em with this method.

Share this post


Link to post
Share on other sites
places like the butcher´s are simply items which are only inserted in specific levels, the rest of the level is more or less built around it randomly.

Share this post


Link to post
Share on other sites
I once wrote a roguelike game that generated dungeon maps like this:

1) begin with an empty level (solid rock in this case)

2) attempt to add a room of a random size and type in a random location; if it overlaps an existing room, cancel the new one.

3) repeat stage 2 until there are the number of rooms you want (being careful that we don''t get stuck!)

4) pick a random point in a room, and try to add a passage N/S/E/W until it hits another room; if it doesn''t, or it scrapes against another passage in an undesired way, cancel it.

5) repeat stage 4 until there are the required number of passages.

The method will be different for different types of map (city, dungeon, forest, death star, whatever) and indeed in my roguelike game there were several variations for different levels. I hope this helps.

Share this post


Link to post
Share on other sites
If you can get your hands on a AD&D first edition Dungeon Master''s Guide (not sure if later versions have it), you''ll find a section detailing how to construct a random dungeon on the fly. It may not translate directly to your game, but I''m sure you could get some inspiration from it.

Share this post


Link to post
Share on other sites
Yes, g''s method is pretty good. My generator (which I wrote using the great ADOM as an inspiration) could combine random rooms with predefined rooms. It just made sure that the exits from the predefined room connected with the rest of the level.

The same principle of being able to balance between how much random you want and how much control you want can be applied to monster generation and item generation.

What I did was that, beside the usual attributes (value, damage, material etc.), each item could have some descriptive qualities that didn''t affect gameplay (classes preferring the object, magical object, ancient item, etc.) . So when defining a room, I could make an request for a random item as general as "costs less than 10 gold coins" or as specific as "golden ancient artifact, being a weapon or a defensive equipment preffered by knights with a value of more than 500 gold coins". Then the game would randomly generate objects until one of them fit the description.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
To look real, you need to have recognizable architecture. In Diablo and various roguelikes, the scheme is pretty simple. Rooms are recognizable. They have four walls, and door that connect to passages. Often, rooms are designated storage, in which case they are small and saturated with barrels. Or rooms just have items randomly strewn throughout. Humans tend to stockpile things to make organization and transportation easier, so just make sure that everything in the room is contiguous. Lights tend to be distributed evenly along walls for aesthetic reasons. If a room is large, lights tend to be present in the center, which is usually either a transport to the edges, or, if very large, the center of attention(as a dance floor or sports field). Either way, lights there are necessary. Entrances to large rooms tend to be large(factory pickup) or numerous(stadium) themselves to facilitate whatever activity for which the room is intended to be used.(numerous considered in Diablo, probably by accident, but not large)

Think about how humans would use it, then just link (an arbitrary) cause(room is big) and effect(so it must have large or numerous entrances). Developing a decent algorithm once you have that is pretty easy.

It would take some careful consideration to think of a logical reason to have 15+ basement levels to any facility, but that''s beside the point.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
g, how did you make it so only one doorway would lead to 1 room? Didn''t you ever experience like 6 doors on 1 wall to the next room?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
g, how did you make it so only one doorway would lead to 1 room? Didn''t you ever experience like 6 doors on 1 wall to the next room?


I didn''t, no. This might have been something to do with the (large) size of my levels, or other complexities (my tunnels would join and bend and so forth).

If you want to prevent that, give each room a unique ID as you generate it; then store a table of which rooms are connected (bearing in mind that a tunnel from A to B connects B to A also). For a small level, the table shouldn''t be unmanagable, and of course you don''t need it once the level is finished (though it might help quite a lot for the AI).

The only danger here is that your passage adding routine could jam if it runs out of rooms to connect when the number of passages still hasn''t reached the quota. Rather like that guy in ''Wargames'', your computer needs to know when to give up.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I see... interesting.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!