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
Lakes #30442
Lakes #30442
Conversation
Holy cow, that's just too good to be true! Good job, as always! |
I'd like to be able to adjust the size of these lakes in the world options. I'm also concerned about being stranded on an island when I spawn. Other than those concerns, this is freakin' gorgeous. Absolutely beautiful and I cannot wait to see it happen! |
I am not very concerned about being stranded on a island as starting position, as long it is not too often, we do not guarantee every run to be winnable. A stranded on an island starting scenario on the other hand might be a great challenge scenario. Name your Character Robinson Crusoe and enjoy. |
Lakes are controlled by regional settings, not world settings. They may vary across regions as we introduce actual different regions (e.g. biomes), and in general we want to keep the options menu light. The existing mechanism for customizing region settings is the region overlay and this PR includes some configurable settings which are documented here. Because of the generation mechanism, you can't just define a size you want the lakes to be, but instead are controlling the threshold for what should be considered a lake, and they'll expand and shrink accordingly. Here's an animated example of an area that is 10 overmaps wide and 10 overmaps tall, visualizing what would be considered a lake based on the settings (lake is white, non-lake is black) as the settings move in 0.01 increments from 0 (everything is a lake) to 0.59: So, while you can't set options for lakes in the world menu, you can trivially add a "big lakes", "tiny lakes", "all lakes" or "no lakes" mod and include it in your world. Observers might also note that with the single threshold as written you can't really have "lots of lakes" and "small lakes" at the same time, as the frequency and size are related here. It is entirely possible to adjust the maths to allow for that, but I'm not interested in that level of external customization for my first pass at this.
I think if this actually becomes an issue, it's better tackled primarily from the "adjust the code that picks spawn locations" angle rather than from the mapgen side of things. In practice, it's relatively rare to actually get a completely isolated island in the lake because of the mechanism used to create them, and I expect that any content that causes you to spawn on such an island (e.g. someone's "Alcatraz Island"-esque prison location) will also provide the means to leave the island, either directly or indirectly. |
So freaking cool! |
Summary
SUMMARY: Content "Lakes"
Purpose of change
Add lakes as an overmap feature.
A picture is worth a thousand words and all that...
overmap
local lake shore mapgen
Describe the solution
Lake
overmap special that just plopped a fewriver_center
terrains down on the overmap.Some additional housekeeping was required to make this clean, namely:
overmap::generate
and into methods of their ownThis PR is in draft since I'm still play-testing it. Right now it feels pretty done to me but I'm still settling the numbers and playing it looking for oddities.
Unlike normal overmap specials, you don't get a lake on every single overmap, and I think that's a good thing. In playtesting, sometimes I'd travel many overmaps before finding a lake, and other times I'd start right on the shore of a massive lake. Because the lakes are created globally, they continue in reasonable ways across overmaps. In general, the lakes are also connected to rivers, so if you've got a suitable vessel you can travel pretty far on the water (look out for those bridges!).
I'm hoping that this prompts some more aquatic content creation--sailboats, aquatic creatures, locations, and the like--and also helps provide some motivation to tackle some features and bugfixes like fish colliding with your vessel and underwater gameplay mechanisms.
Describe alternatives you've considered
I intend to have the lakes carve out some additional water column z-levels and a lake bed, giving us multi-z-level water locations, but I didn't want this PR to get any bigger and there will be some additional work to be done there anyway beyond just placing the overmap terrains.
I'd also like to place overmap specials on lakes and lake shores--think docks, marinas, and the like. I've taken some steps to ensure that those get handled appropriately--for example, there are new overmap terrain flags to indicate that an overmap terrain should be considered a lake shore or a lake, and the local mapgen checks those rather than specific overmap terrain ids when building the shore. Actually adding these specials seems a bit too much for this PR, and I'd rather leave that sort of content generation to those with experience doing it.
Right now, the lakes use the same monster/critter groups and logic for placement as rivers. There's may be some value in differentiating those, but doing it as part of this PR seemed like a bit too much.
Additional context
Screenshot time.
one overmap, with city size 16 and spacing 0
We can just see the edge of a lake that our mega-city sits on...
same location, but with an expanded view of adjacent overmaps
a sequence of lakes in a wilderness (city size 0) run, many overmaps wide
standing on the shore of one of those lakes
a lightly forested tiny island
local view of the island
a campground on the lake shore by the forest
...ignore the lab, it's totally safe...
local view of the campground on the shore
A link to a big map (17280 x 17280 pixels) that some of the above are from if you've got the horsepower to view it: https://user-images.githubusercontent.com/11464/57579311-af5ab180-7446-11e9-9f1e-6e9e8b1f1aa3.png