Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4

Author Topic: Raw-Editable Procedural Worldgen Cities  (Read 16640 times)

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Raw-Editable Procedural Worldgen Cities
« on: August 02, 2010, 08:02:33 pm »

Now on Eternal Suggestion Voting

This is one of those things that I've been kicking around for a while...

The problem is simple and obvious: All dwarven cities but the ones you build are just open fields with dwarves sitting around doing nothing but "enjoying nature" or some tripe like a bunch of elves.

The reason for this, however, is also fairly simple and obvious: Toady just hasn't gotten around to making the procedural code to make every individual type of city.  Goblin towers and human villages exist, but these are all hardcoded.  Even if we get dwarven forts, we won't have anything but dwarven forts, goblin towers, human villages, and maybe elven hippy communes. 

There are plenty of modders out there who would pounce upon the ability to make their own types of towns that could populate the world, and so this suggestion:  Make modular, procedurally generated towns where players can generate individual pieces, as well as have an influence on how they get sewn together.

The starting points are the Arena and the custom workshops, where we already have the ability to design large chunks of land as well as individual pieces of terrain.

What we need, from the top down:

The ability to designate overall methods of construction -

Dwarves, for example, could have psuedo-Roman style construction methods: You build a grid of hallways and set off modular rooms filled with whatever the town needs during that part of generation, filling out rows of hallways with modular rooms and a few special, large rooms, like grand banquet halls.  (Retro may not like modular construction, but it makes sense for the CPU.) On top of this, the entry hall is a giant special construction, preferably with barracks and traps and drawbridges.  The modular rooms could contain apartments, noble rooms, workshops and stockpiles, small farms, etc.  As cities expand in the history of the game, new rooms get added, and the Mountainhome digs deeper.

Humans, meanwhile, should probably have a more haphazard approach to building their cities.  They start building their houses as they do now - building in random open spaces where it is convenient.  After the town becomes big enough, they build a wooden wall around their town and put some guards on watch at the openings to keep some of the wildlife deaths down.  As the city expands in population, however, the town becomes more crowded, and houses get built to squeeze into the spaces between other houses, making long, jagged rows of houses with no space between them, and a complex maze of alleyways in the spaces that are left.  Humans may only build up about 3 floors, but may have a basement.  Humans in towns that smuggle goods may even have trapdoors, fake walls, and connecting attics that allow people to travel long stretches of the town within a single row of houses.

Elves, aside from the grand tree forts, I'm seeing as having plenty of rope reed tents (rope reed "walls" and a small area with a shaggy carpet "bed") and mostly gardens, but what's really needed are the big trees that might just be made of simple wood walls with some floors built off them.


This basically means we need to have several different kinds of construction methods, from dwarven precision to human haphazardness to elven wherever-it-fits-without-hurting-the-trees.  I'll probably post more on how to actually formulate this part later...

We also obviously need the ability to start digging underground in making these buildings.  Rather than "rock walls" that we get in Arena mode, we need to have the walls actually dug into the regular stone layers (although it might be best to remove all metal and gems, so that you don't just have a smoothed sapphire wall in a leather tanner's room), and possibly smoothed or engraved as necessary.

This obviously also fits into the Bustling Town Arc, which is apparently being put on the back-burner until the higher priority tasks are eliminated, but it's still worth laying this idea out beforehand.


Building the skeleton:

For the purposes of the procedural dwarven forts, we first need a set of hallways to give access to the rooms.  This would be first designated by having one or more sets of hallways (really just some open space of arbitrary width, possibly smoothed or paved), and a set grid area expands out to a certain width, and then downward.  (Unless, of course, you are building it tower-style, and have raw-designated them as aboveground builders, so that they build upwards as they need more space, which would make towers like goblins do.)

This means you need to designate, say, a grid that goes out along the Y-axis straight from the central main vertical shaft, with X-axis spokes coming off this main Y-bar. 

If possible, however, one could potentially start putting in some fancy coding, and start having really creative, curving and organic-looking tunnels and rooms that are carved to fit into the niche that they can get, (think the code that generates caverns currently), which would help expand the number of potential moddable cities for player-created races (or just the potential to make really neat procedurally-generated dungeons for adventurers).

Likewise, the crowded human village that builds its homes packed in like sardines to fit within the walls could be built around the notion of just adding more homes (potentially with workshops or stores on their lower floors, and "homes" in the upper two or three floors) that are contiguous with one another, but which must have some kind of path, no matter how tenuous, to the main road that runs through the town, or to all the gates.  This means that as buildings are haphazardly slapped in wherever they fit (and they need the ability to be "stretched" to fit by being longer if there is not enough width to make the effect a good one, although simply making slightly taller or lower-quality housing is also fine) will eventually create a tangled maze, perfect for any adventurer, and for simulating the way that many medieval towns actually did wind up looking.


How to make a custom room/house:

This is the part that I take from the custom building/workshop raws and the Arena mode map we already have - we should be able to expand this idea into being able to make grids of 8x8 rooms or the like that should have a single defined purpose that will be stored at the head of the raw entry.  For example, you could build a simple set of 6 small apartment rooms for dwarves in a 8x8 room (including the walls around them), which is populated with doors, beds, cabinets, and maybe a chest.  This would be labeled to be capable of providing the housing needs of 6 (common) dwarves.  A 16x8 "double room" might be designed to provide office, living quarters, and dining room for a noble, with slight upgrades in the quality of the furniture to distinguish one noble from another.  Individual rooms can have one or two workshops of the same type plus related stockpiles.

Using this, the game can look at what it has built already, and decide when it needs more rooms because it suddenly has more cheesemakers than it has farmer's workshops, and so adds another room for farmer's workshops into the nearest segment of the halls.


The toppings:

There also needs to be "special additions" to the mods, as well, such as every dwarf fort having some kind of defended enterance.  While this could be a single, raw-defined method of making a gatehouse and barracks with traps, we could also have more fun with this.  We could build, for example, multiple different kinds of enterances (or parts of enterances) with weights so that the game will randomly select one kind of gatehouse, and they don't wind up all looking the same, or have the same kinds of defenses. 

The same coding might be used for the "great halls", where we could have various designs for the giant feasthalls of the dwarves, and make a variety of different great halls that can be randomly selected to be that one fortress's greathall. 

While we are talking about composites and content generation: http://designfestival.com/the-cicada-principle-and-why-it-matters-to-web-designers/

Prime numbers beat fractals!


Multi-level building:

Some buildings may require fancier work.  If we want a well in our hospital, we COULD just build a hospital over a "room" made of a cistern, but it should also be something that is plausable to be filled or refilled without just bucket-brigading.  This would be even more complex, as it would require very dynamic code that would be able to understand things like where replinishable watersources can be found.  If you just want to assume that you can always get water from deep enough underground by digging to a cavern lake, you would then need to both have a pump stack, and flag those areas that you are digging down through as being untouchable for building more rooms (or teleport out the rooms that might already have been built into another safe location, since this whole construction assumes the player hasn't seen it, yet).


Dwarven cities and cavern layers:

Although dwarven cities, if they theoretically became large enough (although I doubt any would have the population to do so), may dig down to cavern level, I think most dwarven cities probably wouldn't.  At least one dwarf city of every civ, however, preferably the mountainhome, should have at least a path down to the caverns, as all dwarven crops are underground crops initially, and this only makes sense if dwarves were initially... well, cavedwarves.  The mountainhomes are where dwarves went from neanderthal cave-dwellers to masters of the world (as soon as they get rid of those pesky humans, elves, and goblins), and there should be at least a well-fortified or walled off or moated access to the caverns in all the major dwarven cities.  (Smaller communities just farm the soil layers with transplanted plump helmet spawn.)


EDIT: This from the Future of the Fortress thread:
Quote from: NW_Kohaku
Will you code in the ability to create our own raw-defined building types for worldgen?  Using the Arena Mode and Custom Workshops as a model, we already have most of the pieces to create both custom buildings and define functions for them.

I'm not eager to get into this right now, since I'm not sure what the overall specs need to be and I don't want to tie myself to a raw format early.  One of the main things is that I'm not sure I'd be satisfied with static maps of buildings, rather than buildings that are a bit more adaptable.  For instance, I'm not sure what raws would look like for the existing temples, which adapt portions of their architecture to the spheres associated to their deities.  The raw format would inevitable restrict my ability to do things like that, unless it were really complicated.  At the same time, I can see how a modder would want to be able to deviate wildly from what is currently available.  It might be most simple to allow static building maps to be used by custom races, but since I won't be using that in vanilla it's difficult to prioritize.
« Last Edit: April 08, 2011, 10:17:53 am by NW_Kohaku »
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

nbonaparte

  • Bay Watcher
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #1 on: August 02, 2010, 08:37:03 pm »

I like it. I think there's little chance of getting AI dwarves to make a proper well with cistern connected to a river or somesuch, but I like it.
Logged
A service to the forum: clowns=demons, cotton candy=adamantine, clown car=adamantine tube, circus=hell, circus tent=demonic fortress.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #2 on: August 02, 2010, 08:39:53 pm »

Well, I generally like to set a spread of goals that range from easily achievable to pipedream.

Murky pools are generally much easier to drain out, and are my preferred way of getting some easy early water, personally, but you can't count on those always being there if there are cities built in mountains or deserts.

edit: Also, it's worth saying that Toady almost certainly would have designed a method of building procedural dwarf forts at some point (he apparently was waiting to figure out how to make them "look like real ones", which is basically impossible, since people have plenty of different play styles, anyway), so I wouldn't consider that alone to be a suggestion.  What I wanted to get going was a discussion over how it could be made raw-moddable, so that people could make their own custom civilizations have custom cities.
« Last Edit: August 02, 2010, 08:43:01 pm by NW_Kohaku »
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Neonivek

  • Bay Watcher
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #3 on: August 02, 2010, 08:55:55 pm »

well due to noise the obvious factors would be that "Homes" would need to be at least 5 (I am unaware of the exact number) floors and/or spaces away from anything that creates noise such as military training and crafting.

It is to me that the floors should be divided up into as follows

Top- Military
2- Crafting
3-6- Filler of no noise
7- cheap housing (Since they get noise)
8- good housing
9- Noble/Rich housing
10- Market
11- Underground Road

it really depends on what makes noise or not.
Logged

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #4 on: August 02, 2010, 09:58:59 pm »

Does crafting make noise now?  I thought noise was mainly caused by things like arranging furniture...

And the wiki basically has nothing for this version.

We could try to make things have zoning by x/y coordinates, so that the "north end" of the fort will be the residential sector, and the south end gets whatever is noisy, though.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Acanthus117

  • Bay Watcher
  • Angry Writer
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #5 on: August 02, 2010, 10:04:08 pm »

Beau-tee-full.

That's all I have to say about this idea.
Logged
Is apparently a Lizardman. ಠ_ಠ
YOU DOUBLE PENIS
"The pessimist is either always right or pleasantly surprised; he cherishes that which is good because he knows it cannot last."

Solace

  • Bay Watcher
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #6 on: August 02, 2010, 11:21:44 pm »

That actually gave me an idea how we could get some basic elf-tree-houses down; maybe building those could be a sort of "Elf-magic" the same way elves alone can harvest wood without harming trees? You wouldn't need to work out the logistics of multi-z level 5X5 trees if they're some unique living elven design that doesn't even exist in nature.
Logged

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #7 on: August 03, 2010, 08:43:42 am »

That actually gave me an idea how we could get some basic elf-tree-houses down; maybe building those could be a sort of "Elf-magic" the same way elves alone can harvest wood without harming trees? You wouldn't need to work out the logistics of multi-z level 5X5 trees if they're some unique living elven design that doesn't even exist in nature.

Err... I'm not sure I follow, would you care to elaborate on what this would look like?
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Solace

  • Bay Watcher
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #8 on: August 03, 2010, 01:13:24 pm »

Well my points is, we want elves to have multi-z level tree houses, right? Which would include stairs, and since you need part of the house that's not-stairs, the inside would have to be a minimum of 2x2, and with the wall around it, 4x4. A several z tall 4x4 tree growing in the wild would be ridiculously huge compared to everything else, and you'd have to less chop it down than wood-mine it.
However, if elf-towns just spawned unbroken wooden houses with, I dunno, maybe some bushes (maybe trees or wooden protrusions for branches) hanging off into space for leaves, you could say they're not natural trees, and shaped that way the same way elves can somehow reach into a tree and harmlessly pull out wood from it.

EDIT: Sort-of like this: http://www.popsci.com/arbona/article/2006-11/grow-your-second-home
Just more, um, like that monkey's tree from the lion king. http://worldlywise.blogspot.com/2007/09/savanna-grasslands.html
« Last Edit: August 03, 2010, 01:18:32 pm by Solace »
Logged

Sizik

  • Bay Watcher
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #9 on: August 03, 2010, 01:48:39 pm »

It'd be nice to have generated fortresses that aren't monotonous, unnavigable mazes of corridors and empty 5x5 rooms.
Logged
Skyscrapes, the Tower-Fortress, finally complete!
Skyscrapes 2, repelling the zombie horde!

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #10 on: August 03, 2010, 02:20:40 pm »

Hah! I was thinking something more along the lines of having many elves just live in tents on the ground.

Making that actually a shaped tree would be an amusing take on it, although possibly far too clever and cool for many DF players to really like the idea of elves not being a bunch of "filthy hippies" that just wallow in their own muck.  I do, however, think the idea of making a little burrow in the sculpted roots of a strange tree would be a wonderful way to make a typical elven house...

Code: [Select]
W= Wall, D = Door, + = Floor, X = Stairs, L = Barrel
T = Table, C = Chair, B = Bed, A = cAbinet, O = cOntainer
^= An actual tree on top
First Floor:

WWWWWW
D+++XW
WO++BW
WABBAW
WWWWWW

Root Cellar:
  WWWW
  WLXW
  WL+W
  WWWW

Second Floor:
++WWWW
^+TCXW
++TC+W
++TC+W
^+WWWW

Roof:
  ^++^
  ++++
 +++^+
  ++++

As for the higher-ups of the elven court, though, the Threetoe stories (like, say, Snatcher,) definitely imply that at least the higher-ups live up in positively giant trees with semi-sentient vines serving as their "stairs".  I would actually expect this to be more something of a 4 to 10 z level straight up "column" of wood, which then makes a "plataeu" with "branches" spreading out and away from there that the house or elven throneroom or whatever is actually built upon, which may be as much as a 30 or so tile "room" placed on this plataeu.

Realistically speaking however, if a z-level is equivalent to a single story of a human-style house, we're talking about a z-level being around 10 feet tall.  Your average tree in your average forest should not be more than one tile wide, but should definitely be more than 10 feet tall, and we should be routinely seeing 3 to 5 z-level trees around in any area that isn't routinely clear-cut.


Oh, and I'm editing in a part about dwarves digging to the caverns in the OP as well.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Sizik

  • Bay Watcher
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #11 on: August 03, 2010, 04:29:31 pm »

Question: Have you played 40d adventure mode?
Logged
Skyscrapes, the Tower-Fortress, finally complete!
Skyscrapes 2, repelling the zombie horde!

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #12 on: August 03, 2010, 04:47:48 pm »

Question: Have you played 40d adventure mode?

Not really, it seemed too barren for me to get into, so I only played around in it briefly.

However, with response to what is probably the salient point of this comment, making a dwarven fort that actually looks like something dwarves are living in is exactly the point of this suggestion.  This is why I am talking about how you design fortresses off of a layout that you pick, even if it is a simple (and monotonous) grid-based layout, and that these rooms then have a purpose, and furniture and rooms and workshops that reflect that purpose.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Patchy

  • Bay Watcher
  • Mukyu
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #13 on: August 03, 2010, 07:43:26 pm »

I like the idea. I've embarked on the various civ sites to see what the towns look like, including a mountain home (using embark anywhere) back in 40d. The sites were more than jus a bit underwhelming to say the least. The whole thing really didn't do anything for my desire to play adventure mode. Oh whoopee I killed some more people, though the fact that we can go back and explore our old forts is quite fun and redeems it quite a bit.

Absolutely nothing for the elves, just standing around in the middle of nowhere. Not even a single treehouse or something for shelter. Humans had a random smattering of houses, and an inn. The goblins had some impressive if rather short (3 z-lvls if i recall) dark towers, but the interior was jus a mess of halls and alcoves without any rhyme or reason. The dwarves had essentially a hole in the ground, with a big stupidly wide entrance. While they did have rooms and stuff carved out underground, there wasn't anything in them.

So, yeah if we could get the ability to help design the civ sites a little better, so they at least make sense or something. I know it's probably not easy to get the races to build something even close to resembling a place to live in, so I haven't really cared that much about it. But if we do get something similiar to the arena for designing the civ sites, that'd be awesome.
Logged

Sizik

  • Bay Watcher
    • View Profile
Re: Raw-Editable Procedural Worldgen Cities
« Reply #14 on: August 03, 2010, 08:17:37 pm »

Here is the full layout of a 40d Dwarven Fortress. Note that I had to visit each room in order to get the screenshot.
Logged
Skyscrapes, the Tower-Fortress, finally complete!
Skyscrapes 2, repelling the zombie horde!
Pages: [1] 2 3 4