Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upUrban development concept #21488
Comments
This comment has been minimized.
This comment has been minimized.
I'd push sewers to -2, to make them stop clashing with basements.
What exactly is needed? |
This comment has been minimized.
This comment has been minimized.
The only thing that comes to mind is that the current way that houses and shops are placed in towns has no support for wide or tall mapgens, both houses and stores. It always has to be 1x1 in floor plan, and only 1 level in height, with basements handled via separate code. This is the reason why More Locations mod handles multi-story houses by having them as overmap specials, not by adding them to the default region settings. |
This comment has been minimized.
This comment has been minimized.
|
Sorry for being vague. overmap gen is what I was looking at for generating cities focusing either on a block or main street approach, the outstanding map generation issue. As dangernoodle said, I'm current running all buildings as overmap specials which means all but the suburban houses look out of place as they are strewn all over the map. |
This comment has been minimized.
This comment has been minimized.
|
So basically, we want "in-city specials"? Good enough? Could be a better to move the discussion to the forums. We have an unwritten rule that suggestions go on forums and github is for more "concrete" stuff. |
This comment has been minimized.
This comment has been minimized.
|
Problem is generation of them. Forcing them to appear will risk the problems that have plagued overmap specials as of late. |
This comment has been minimized.
This comment has been minimized.
|
I actually have a ton of thoughts on improving cities and mapgen that are probably a little too extensive, but a quick summary is that overmap gen would track city sizes and use a distribution to determine the size of new cities, then it would apply a "theme" to each new city based on its size and the existing cities and their themes, then when it populates the city, it splits it up into districts, which it then uses along with some combination of tags on the overmap terrain entry and the mapgen entry to determine which buildings to place in this section of the city. So for example: I think this would be a good way to have finer grained control over what sort of things spawn where and make the overmap generation smart enough to create cities that feel diverse and realistic. Edit: |
This comment has been minimized.
This comment has been minimized.
ituluwituluwzev
added
the
Mapgen
label
Jul 26, 2017
This comment has been minimized.
This comment has been minimized.
|
The mapgen definitely needs a rework-the last person who understood it left the project. I think vache is the only one who has worked on it. The code is also slightly spaghettish-determining where it all starts takes a bit of work. It probably needs to be split into steps- 7 days to die recently managed to change their system which generated much like ours to a socket-based system, with cities having a industrial, residential, and commercial district, and one that supported buildings of all shapes and sizes. |
This comment has been minimized.
This comment has been minimized.
They can't be - algorithms for connecting cities with all of those are necessarily hardcoded. |
This comment has been minimized.
This comment has been minimized.
That's why it's so time-consuming to change mapgen in general-everything is hard coded and linked together. |
This comment has been minimized.
This comment has been minimized.
Many mapgen things were already moved out to json, but it is not possible to move out everything. |
This comment has been minimized.
This comment has been minimized.
|
Well the whole moving things to json is a tangent to this conversation in general, improving city/worlds is more overmap gen focused, rather than mapgen, which is focused on how to generate a specific tile. I'm not sure how you'd define how to create roads in cities through json, except for maybe through a bunch of generic parameters for city construction. I don't believe there's anything wrong with the way roads and subways and sewers are generated currently, except for the weird situations with subways, sewers, and basements. I will say that the algorithm for generating actual cities is very dense and confusing (as of the last time I looked at it at least). IMO, city generation would really benefit from a several step process (probably with the implementation pulled out of the overmap class) that tracks info relating to the generation process throughout, and makes it available whenever new cities are generated. |
This comment has been minimized.
This comment has been minimized.
I'd agree with that. Maybe add larger sewers at -3. Basements deeper than -1 could be quite interesting. You could add abandoned sewers, with a small number of them repurposed as smuggler's tunnels. |
This comment has been minimized.
This comment has been minimized.
Don't really like the "projects are filled with undead" and "Corporate drone" ideas, otherwise this looks good. |
This comment has been minimized.
This comment has been minimized.
|
Started working on this.
|
This comment has been minimized.
This comment has been minimized.
|
My thoughts were to keep everything 2x1 or 2x2 just to make everything look more organized with blocks always being an even number of spaces oriented N/S or E/W. All buildings I'm drawing have main entrances at the south, assume that there will be buildings at e/w, and a road/back entrance at the N if it is 2x2... Before rotation. If that's standardized then coding will be much easier? Having parks sounds like a good idea but we might want to keep them in the same 2x2 or 2x1 json format so we can control what actually spawns (as opposed to a normal forest with a large respawning bush food source). I'd like if suburbs could also be assumed to be gridded in similar format. I have a couple is Mcmansions that are 2x2 that assume the garage entrance is in the back of the building. As far as zoning goes, make it as simple or complex as you want. Long term it would be cool to have a block do all it's pulls from a single tag or list, so we can have "historic block" or "community college block" but it certainly isn't necessary when all we have now is R1/R3/C3. I'm 100% down if you want to tackle the actual coding of mapgen, let me know if I need to change or add something to make it easier for you. |
This comment has been minimized.
This comment has been minimized.
Yeah, but it's not necessary. It wouldn't be much more difficult to have blocks that allow mixed sizes, for example, assuming only square buildings (just for the example, not code), it could be filled with:
The 4 size building could be a big hospital or a park. The 2s here are two separate buildings.
Wait, all assume buildings at e/w? What about the ones at the extreme end?
The building at |
This comment has been minimized.
This comment has been minimized.
|
Can you include support for something like
Where W is a west end-cap, M is a middle item, and E is an east end cap? I've been tinkering with some expandable townhomes that can fill any width, and I'm close to having them ready to PR, but there's no framework to support their spawning right now. |
This comment has been minimized.
This comment has been minimized.
|
I was thinking of something more generic, like allowing any rectangular filling of the "main" square, including 1x4 blocks. |
This comment has been minimized.
This comment has been minimized.
|
Well I was thinking of something like an expandable building, so it can be 1xN and can fit any rectangle of that size. Ideally the same method could be used for larger sizes, but I can't think of a great use case for that right now. What I have mocked up right now has a left end cap, and then X middle items, and then a right end cap, but the code isn't there to support that, so I was suggesting that as something you might include. |
This comment has been minimized.
This comment has been minimized.
|
Requiring the other cap complicates things. Not that much, though. The idea is that when filling out the block, I'd generate a map of counts of possible sizes to fill in - only rectangles (at least at first) to simplify things. This would probably be brute-forced ( Variable size buildings could be then added on top of that, by including them on the list of buildings of given size. |
This comment has been minimized.
This comment has been minimized.
|
Hmmm, I see it becoming very difficult to produce enough buildings of varying sizes to prevent wasted space/repeats if we include larger buildings expanding a block along the short axis. Wouldn't it be simpler to have 3x3+ structures occupy their own block and design them assuming being surrounded by road? 2 deep blocks guarantee access for a fire exit/alt entrance in the back, keep a consistent store front along their major access, and have a well organized appearance. |
This comment has been minimized.
This comment has been minimized.
|
If we're aiming for realism, we could probably just pad in some of the blocks with parking lots and everything would still look and feel correct, and we wouldn't have to wonder why all these buildings are just hanging out with no parking. |
This comment has been minimized.
This comment has been minimized.
But then blocks of sizes like 3x4 would need to have a lot of 1x1 padding. Or could only have contents out of a very small selection.
Some repeats are mandatory. The block would not expand once placed. Rather, it would be placed first and then filled out. This is easier to implement cleanly because those two phases can be separated. |
This comment has been minimized.
This comment has been minimized.
|
Update: I went with Here's my idea of the algorithm:
Here are some results, currently with no buildings, because I want the roads working before I start working on building placement: |
This comment has been minimized.
This comment has been minimized.
|
What's it look like with the inside of blocks being between 2x4 and 2x8? Just saying, we can fill those pretty well and it'll make the streets busier for a given town size :) |
This comment has been minimized.
This comment has been minimized.
|
Those blocks seem WAY too big to me. IMO, 2 to 3 by makes sense for most city sizes, 4 by would probably only work for large cities, and smaller cities should probably use something closer to current city generation. Maybe it could be 1-4: current, 5-9: 2-3 by, 10+: 4 by. |
ZhilkinSerg
added this to To do
in Mapgen and overmapgen improvements
Apr 19, 2018
This comment has been minimized.
This comment has been minimized.
|
I think at this point this is fairly antiquated to the current way we're planning to progress in urban development - ie with land use codes and zoning. I'm going to close it, but if someone more active in the city development stuff wants to contradict me that's fine I'll reopen. |
I-am-Erk
closed this
Mar 8, 2019
Mapgen and overmapgen improvements
automation
moved this from To do
to Done
Mar 8, 2019
This comment has been minimized.
This comment has been minimized.
|
We can still scrap new overmap terrains from https://github.com/CleverRaven/Cataclysm-DDA/pull/23748/files. |


acidia commentedJul 25, 2017
Hey, I'd like to get input midway through the current project so I can correct course if needed to get the best player experience.



The attached 6 pictures are from an urban development concept I've had around for a few months. To make actual cities happen in game we need z-level support, a reworked/or patched mapgen function, and a metric ton of buildings. I'll never have the time to implement z-levels but I might be able to tackle the other two.
The suburbs
Using 2x1 map tiles for the houses gives enough working space that I can base the houses on real buildings, at least to a better degree. This acts to distinguish the transition from rural buildings to a more urban environment.
The cities



My thoughts on how cities could be implemented would either be in blocks or along main streets. The vast majority of building will either be 2x1 "Dense Urban" tiles or 2x2 major buildings. I really like how the alleys in the blocks generate even if a city is only big enough to generate a single block. Main streets would probably be more realistic but there wouldn't be tight alleys unless if the city is large enough to generate 3 main streets (2 EW 1 NS or 1 EW 2 NS)
Figured cities would be a core of major buildings/dense urban tiles, a ring of traditional commercial buildings, a ring of 50% (2x1) suburban houses 25% (1x1) traditional houses 25% commercial, finally allow mapgen to use the current function to tapper the edges till wilderness. Not great for neighborhoods but easier to implement.
I think the shortest building in the city blocks is the 2 story cafe, the tallest is the hotel tower (5 floors with penthouse?). Everything has a basement/foundation so in theory a character can easily tunnel from one building to the next or jump from roof to roof.
Block 1
Left to right, top to bottom
(2x2) Police station, movie Theater & office, house & Bank, (2x2) fire station
(2x2) Police station, house & apt & house, salon & low income apt, (2x2) fire station
Block 2
(2x2) Hotel tower, apt & diner, clothing store & subway & jewlrey store, (2x2) school
(2x2) Hotel tower, apt & Quick-e-Mart & to go food, club & house, (2x2) school
Block 3
Laundry & ouside cafe & nice clothing store, row houses, (2x2) hospital
Under construction/Ideas:
Dense Urban (2x1)
Bar
Hardware Store
Drug Store
Gym
Major Buildings (2x2)
Projects (ocean of undead)
Public library (cultists?)
Church (survivor castle?)
Ikea
Parking Garage
Subway & bus terminal
Office building (covered in bees?)
Current Goals:
35/50 z-level suburban/urban buildings as a proof of concept/justification for suburban/urban code
2.5/3 full city blocks of unique buildings
What I need:
-Urban building ideas or changes to existing ones, sorry you can't see the other z-levels.
-Suburban house blueprints or sketchs that would be cool in game
-Thoughts, current subway tiles are at z-1 but if most building have basements/foundations there is no room after sewers are accounted for. Keep sewers on z-1, push subways to z-2? Now would be the time as I'm adding subway stops.
. -Motivation to finish item and vehicle spawns on the 2nd half of the completed buildings, the worst part