Random zone generation

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Post Reply
Message
Author
Susramanian
Spiderkin
Posts: 454
Joined: Sat May 15, 2010 3:09 am

Random zone generation

#1 Post by Susramanian »

This post is sort of an outline for the beginnings of a random zone generator. We start with some new zone layouts to be used when generating perpendicular dungeons:

a) Castle: stacked arrangement, all depths. Almost all space used, rooms weighted towards alignment with each other, hallways always straight, doors generated between room and hallway.

b) Tight tunnels
: Stacked or adjacent arrangement, subterranean only. Width-one tunnels that tightly curl and have occasional organically-shaped rooms. Going for a giant ant nest feel.

c) Lost city: adjacent arrangement, all depths. layout as I describe in the vault submission thread.

d) Forest city: adjacent arrangement, ground level only. Think Lothlorien from T2. Buildings among trees, streams, foresty stuff.

e) Tower: stacked arrangement, always ascending, all depths. Circular cross-section. Area of floor n is less than or equal to area of floor n-1, but most often equal, resulting in a big cylinder. Almost all space used, as with castles. Lots of radial walls.

f) Pyramid, inverted pyramid
: basically towers as above, only with square cross-sections. For inverted pyramids, the area of a floor n is strictly greater than the area of floor n-1. The difference in size should be uniform between levels.

g) Graveyard: Adjacent arrangement, all depths. Lots of open space and crypts that have their own down stairs which lead to a basement level. Multiple crypt stairs all lead to the same basement level, which looks like a bunch of disconnected vaults.

h) Cliffs: stacked or adjacent arrangement, ground level and above only. Movable terrain is just a path along the cliff face with some wide spots and caves leading into the rock. Empty space on the other side of the path. In a stacked arrangement, the player ascends or descends in a switchback pattern. In an adjacent arrangement, it's one long traverse. Lots of visible but inaccessible spots along the cliff only accessible through teleportation.


Now a list of themes that get (somewhat) randomly applied to zones in the generator:

1) settlement: npcs fairly homogenous and structured. For example, a castle full of humans with maybe some trained wolves, lots of guards and peons, a few commanders and magic users, one lord.
2) flooded: aquatic enemies, terrain modified as ruined below, needs water breathing. Subterranean only.
3) ruined: lots of rubble, missing walls, broken doors, randomized inhabitants.
4) claimed by bandits: thief-type enemies. Force generaton of some stone rooms with doors when layout doesn't otherwise have them. Additional traps.
5) cursed: lots of undead and demons, often ruined as above.
6) Gigantic: all dimensions doubled.
7) dragon-infested: Lots of dragons. Often ruined as above.
8) cult stronghold: Lots of magic-users of a particular flavor. Force generaton of some stone rooms with doors when layout doesn't otherwise have them.
9) disgusting: Often ruined. Lots of slimes and jellies and grossness.
10) horrific: Often ruined. Lots of horrors.
11) illusory: Lots of insubstantial solid-looking terrain and enemies that screw with your mind.
12) vaulttastic: Heavily weight rooms towards vaults. Remember that 'all rooms are special' option in T2?
13) Manastorming: magic has gone haywire. Huge boost to mana regen, but spells act unpredictably X% of the time (wrong target, fizzling, wrong spell, etc.)

You could come up with a theme for any subset of monsters X: 'infested by X'. This isn't all that interesting, so I quit after the couple like that I did above. If anybody has ones to add, please do so! Just make them more interesting than a monster theme. A monster theme with some appropriate accompanying gameplay elements is good.

Here's a table that lists layouts appropriate for zones perpendicular to the given zone.

Code: Select all

Zone                  Layout

Daikara               abcefgh
Eruan                 adefg
Old forest            adefg
Trollshaws            adefg
Ancient Elven Ruins   abcefg
Ardhungol             abcefgh
Flooded cave          abcefg
Grushnak              abcefgh
High Peak             abcdefgh
Reknor                abcefg
Kor Pul               abcefg
Sandworm lair         abcefg
Tol Falas             abcefg
Valley Moon Caverns   abcefgh
Vor Armory            abcefgh
Most themes can go with most layouts, but some don't make sense. Here's a table listing what's NOT allowed as a theme for the listed layout.

Code: Select all

Layout   Themes NOT allowed
a        none
b        3
c        none
d        2
e        none
f        none
g        none
h        2, 3, 6
Here's an outline of the algorithm that generates a random zone. I'll go into more detail on the various steps later.

Randomly generated dungeons will use several layouts.
1) Check orientation and elevation of current zone A.
2) Pick elevation-appropriate perpendicular layout B.
3) Generate appropriate intersection between A and B.
4) Generate 2-4 levels of layout B after intersection
5) Pick elevation-appropriate layout C perpendicular to B
6) Generate appropriate intersection between B and C
7) Generate 2-4 levels of layout C after intersection
8) Generate random unique appropriate to theme in special room on final level of layout C.

What we're going for here is the feel of a custom-designed zone. For example, a random zone might be generated that branches off the Old Forest. It has the 'forest city' layout with the 'ruined' theme. The player discovers it when exploring the Old Forest and finds the edge of a ruin intruding on an Old Forest level, complete with a tempting >. Investigating, the player fights his way through three ruined forest city levels, and on the third, finds the edge of a massive castle partially covering the level. There's yet another tempting >. The player enters the castle, which turns out to have the 'cult stronghold' theme. On the fourth floor of the castle, the player fights some gnarly cultist-type unique and gets a nice random artifact.

Fighting your way through a ruined forest city to confront the cult holed up in the city's palace? Sounds custom-built to me, but it's just a random pick from the above tables. Try some more random picks and see how they feel.

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Random zone generation

#2 Post by Grey »

I'd personally rather these random zones were just extra dungeons on the map. They could have their locations decided at the start of the game, or they could be randomly generated during play (if the latter there should be a maximum number you can find in a game to prevent map scumming).

It's a great idea though, and I like the specificness of different themes working together. Limiting the randomness like this makes for a more cohesive feel.

Some suggestions:

Rivers
Goes with forest-type areas, underground caverns, or any ruined area. Would have a winding river 3-5 squares wide going through it. Rivers would cut open existing structures and force an available path along their length. Care must be taken when placing enemies and vault rooms.

Part-flooded
Goes with forest-type areas, underground caverns, or any ruined area. Between 30 and 70% of floor squares are water. Extra trees on overground levels, even if it's a castle or whatever.

Islanded
(stealing an idea from another thread) Lots of patches of land surrounded by water.

Swamp Forest
Part-flooded with trollshaws style of forest. Populated with Old Forest style enemies and a good few ghuls too. Also has the Old Forest dark/rain effect.

Berserker Tribe
Lots of small circular huts in a big open area (or maybe in foresty areas too, but with less trees around). Populated by human berserkers and archers. Would have a tribe leader who'd be more powerful.

Underground Cavern
Starts off with a thin, single width passageway for a few levels, sparsely populated. Last level the passageway continues halfway till it reaches a big open space, with lots more monsters in it. Monster style could vary - could be families of bears, or a necromancer with some undead, or a group or orc corruptors.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Susramanian
Spiderkin
Posts: 454
Joined: Sat May 15, 2010 3:09 am

Re: Random zone generation

#3 Post by Susramanian »

Good suggestions, Grey.

I'd be happy with putting a few random zones on the world map, but I'd like the majority of them hidden inside existing zones. Some reasons:

1) I want to avoid giving the player the feeling that the world map is just a gigantic list of in-and-out zones that they're supposed to go through like a checklist. Being confronted with an unexpected fork in the road on your adventure is more fun than just browsing through a bunch of tooltips on the world map.

2) Fixed dungeons quickly get stale with replays. Adding uncertain, random potential content to them is an easy way to spice them up. This is related to the reasons for wanting fixed bosses to drop random artifacts. You just never know what you're going to find in the Old Forest.

3) Having random dungeons branch off existing zones allows the player to sort of preview the content. This is what those intersections are all about in my post. You're cruising along in your regularly scheduled dungeon, and suddenly you find a level that's half covered by the ground floor of a huge, mysterious tower. The ground floor is explorable, and gives a taste of what's to be found inside. If it feels like a deathtrap, move on. If not, take the stairs up and see what there is to see.

Susramanian
Spiderkin
Posts: 454
Joined: Sat May 15, 2010 3:09 am

Re: Random zone generation

#4 Post by Susramanian »

To give the whole dungeon adventure a cohesive feel, particular attention should be payed to the intersection levels. You don't just want a mysterious > with a cryptic tooltip to be the player's only indication that there's something new to see. The new layout should 'intrude' to some degree on the current level. Two dungeons with adjacent level arrangements (one east-west, the other north-south) should have half of the intersecting level mapped in the new layout. A north-south zone A with a random zone B spawned to the east on level two would result in the east half of level two of zone A generated using the layout and theme of zone B.

A similar technique is used when zone A has a stacked arrangement. Zone B will have an adjacent arrangement, so devote one half of the intersecting level of zone A to the layout and theme of zone B.

When zone A has an adjacent arrangement and zone B a stacked arrangement such as a tower or castle, generate an extra large intersection level of zone A and include a mockup of a whole zone B level inside it. This does not count as one of zone B's levels. For pyramids, special attention will have to be paid to the size so everything makes sense and feels right. For stacked zone Bs without a logical footprint, such as a cave system, a simple > can be generated on the intersecting level of zone A with the surrounding area of the level given the theme of zone B.


Here's an illustration of the Old Forest / ruined forest city / cultist castle example from earlier:

Code: Select all

           #####################
           #Forest city lv. 3  #
           #  ####       ####  #
           #  #< #########  #  #
           #  #   Castle    #  #
           #  ##  tiles    ##  #
           #   #           #   #
           #   #(four more #   #
           #  ##lvls above ##  #
           #  # this!       #  #
           #  #  ####+####  #  #
           #  ####       ####  #
           #       <           #
           #####################
           #       >  #
           #          #
           #          #
           #  Forest  #
           #   city   #
           #  level   #
           #    2  <  #
           ############
           #       >  #
           #          #
           #          #
           #  Forest  #
           #   city   #
           #  level   #
           #    1  <  #
##############################################################################
#          #Forest >  #          #          #          #          #          #
#          #city tiles#          #          #          #          #          #
#          #__________#          #          #          #          #          #
#   Old   <#>  Old   <#>  Old   <#>  Old   <#>  Old   <#>  Old   <#>  Old   <#
#  Forest  #  Forest  #  Forest  #  Forest  #  Forest  #  Forest  #  Forest  #
#  level   #  level   #  level   #  level   #  level   #  level   #  level   #
#    7     #    6     #    5     #    4     #    3     #    2     #    1     #
##############################################################################
If we can get this all modular and meshing properly, we can chain random zones together to get a real feel of depth in the game. A simple jaunt into Daikara could turn into a twenty-level odyssey, complete with multiple bosses and artifacts. This would do a very great deal to make one T4 playthrough different from another. Some changes in game balance with regards to character and dungeon levels would likely need to go along with a random zone generator like this.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Random zone generation

#5 Post by darkgod »

Yeah this is what I had in mind :)
And yes there would be a need to exp caps, lest the player enters tol falas at lvl 50 :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Random zone generation

#6 Post by Grey »

We should limit the number if them severely so that they feel special. Say 2 or 3 in a game at once. Never two in the same dungeon either.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Post Reply