Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamping map generation to reduce hard transitions, allow widescale alignment of multi-overmap features, and include more natural Z-level generation #47563

Closed
8 tasks
superninjakiwi opened this issue Feb 17, 2021 · 7 comments
Labels
<Enhancement / Feature> New features, or enhancements on existing Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Map / Mapgen Overmap, Mapgen, Map extras, Map display stale Closed for lack of activity, but still valid. <Suggestion / Discussion> Talk it out before implementing Z-levels Levels below and above ground.

Comments

@superninjakiwi
Copy link

superninjakiwi commented Feb 17, 2021

Is your feature request related to a problem? Please describe.

Map generation has been a bit disappointing for a while. Map tiles are generally generated without connecting to their surrounding tiles, leading to hard, visibly square edges. Large features that could be generated across multiple map tiles, such as hilly areas, would have a hard time aligning properly without doing most of the work to make the hills align manually. Z-levels are also not generally a part of non-manual generation, leading to one big flat world where everything that extends above or below ground level has to be specially created to be that way.

Describe the solution you'd like

I'm planning to create some world generation code to improve this, probably as an alternative to the existing generation, at least to start with.

  • "Fuzz" the boundaries of biomes, to create a less hard edge between e.g. forests and plains
  • Generate map tiles in a way that lets them connect to nearby tiles. This is slightly different from fuzzing, but related; I could use it, for example, to have a hilly area, with structures such as z-levels, cliffs, and slopes, being coordinated across multiple map tiles.
  • Allow easy generation of terrain that stretches up multiple z-levels. The primary use of this would be to make some trees that are two or three stories tall, depending on where they're generated.
  • Railroad stations have gone TOO LONG without railroads to connect them. Railroads need to be generated for once.

There are also a few things I'd like to try to make easier for the future as well, if not immediately possible:

  • Semi-realistic placement of forests, fields and swamps based on local water availability and weather. This could intersect with a desire for localized weather, if that exists.
  • The ability to "offset" JSON-based maps such as buildings. It would be nice, for example, to shift a house a few tiles away from a road to make room for a cul-de-sac's sidewalk. This would require a bit of finesse to work in a tightly packed city, but could be very nice to have.
  • JSON should be able to easily modify or create things like additional biomes, as well as large-scale, localized map features like hilly areas, that can integrate cleanly with the area's biome.
  • 'Fuzzing' support for explicitly defined JSON maps, that want to integrate nicely with the surrounding map tiles.

Describe alternatives you've considered

Leave it as is. It's really not terrible, and I have fun with the game right now, I just think it could be better.

Additional Context

Fuzzing, in this case, is an attempt to reduce the shear edges between map tiles; see https://i.gyazo.com/5484eaf96edda6f12a18b49e6937f2de.png and https://i.gyazo.com/c0bdcc8e898d59081ec075c8baca05be.png

In both images, you are able to easily tell where the fields stop, and other map tiles begin. I'd like to reduce this.

@ZhilkinSerg
Copy link
Contributor

I advice you not to do anything z-level related yet (we probably need to have some kind of sub-z-levels first) and stick to biome placement first, so lakes, ravines, swamps, forests, plains and rivers would connect properly across overmap boundaries. Lakes (#30442) are already spawned across overmaps, so they could be used for reference. Forests should also be seamless (#29755).

#38539 and #37336 could be interesting for you for biomes stuff. Maybe you can try to resurrect #38894 - it provided nice results for rivers.

Btw, fuzzy borders are already a thing (at least on overmap level, mapgen could possibly be imroved) for forests and lakes - thick forests in the middle and forests on borderline, lake shoreline is different from lake center:

image

@superninjakiwi
Copy link
Author

superninjakiwi commented Feb 17, 2021

we probably need to have some kind of sub-z-levels first

Is there an issue I can reference for progress on that, or a wishlist of some kind? I wasn't even aware that was something that was happening. I don't think it would throw too much of a wrench in my plans if that is happening; hell, I might even be able to make it easier by ensuring that the new generation can be easily extended to address those. But I'd want some kind of indication that that's something planned before focusing on it at all.

Lakes (#30442) are already spawned across overmaps, so they could be used for reference. Forests should also be seamless (#29755).

I should clarify, because while I think those changes will be very useful to look at, I want to be clear what I'm trying to do here. Rather than focusing on connecting things across overmaps, I am trying to connect individual map tiles; much like the reduction of shear edges in #29755, I'd like to reduce the shear edges between, for example, forests and plains. It's a similar problem, just on a smaller scale. While border biomes do help, they don't really fix everything. In both images I've posted, you can clearly tell where the plains stop, and where the other biomes begin. I'd like to reduce this. That is what I am calling fuzzing, here.

Thanks a ton for all the references; they're quite helpful in understanding the state of map generation right now.

@int-ua int-ua added <Suggestion / Discussion> Talk it out before implementing Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Feb 17, 2021
@actual-nh
Copy link
Contributor

Are you meaning fuzzing "just" in terms of appearance, or some alteration in functionality (e.g., a tile with both plain and forest on it having a mix of the two in plants, etc)?

@superninjakiwi
Copy link
Author

superninjakiwi commented Feb 18, 2021

I will probably keep the tiles viewed on the map the same (a forest tile will still be a forest tile), but the generated features of the map tile will extend outside of it. Right now, I'm seeing if I can create a randomly shaped blob of terrain to place, such as trees, bushes etc. that extends outside of the tile's boundaries into adjacent tiles. That might not be the way to do it in the end, but it's a place to start. This will make forest tiles that border plains generate several plains tiles instead of forest tiles, and plains that border forests generate more forest tiles such as trees. It will also make the randomly generated 'single kind of tree' map tiles extend a bit into the surrounding forest, along with shrubs and other similar features.

@actual-nh
Copy link
Contributor

See #50651 for a portion of this, namely Z-level terrain.

@actual-nh actual-nh added <Enhancement / Feature> New features, or enhancements on existing Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Z-levels Levels below and above ground. labels Aug 10, 2021
@stale
Copy link

stale bot commented Apr 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Apr 28, 2022
@Night-Pryanik
Copy link
Contributor

Closing as stale, since stalebot can't do this by itself.

@Night-Pryanik Night-Pryanik closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Enhancement / Feature> New features, or enhancements on existing Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Map / Mapgen Overmap, Mapgen, Map extras, Map display stale Closed for lack of activity, but still valid. <Suggestion / Discussion> Talk it out before implementing Z-levels Levels below and above ground.
Projects
None yet
Development

No branches or pull requests

5 participants