Cataclysm-DDA
Cataclysm-DDA copied to clipboard
Rivers are still hardcoded
Is your feature request related to a problem? Please describe.
Similar to #70122 we may need to remove hardcoding for river locations. To help address water location spawns for #70215 we would need to open those locations to easier JSON mapgen extras.
I'm not sure how much this affects Lake or Ocean locations as those are different. But they may need the same treatment.
Solution you would like.
Un-hardcode River generation to help expose it to JSON mapgen extras that are not coded in C++ for example.
Describe alternatives you have considered.
No response
Additional context
No response
I have a local branch I haven't touched in a hot minute that was doing this, I'll get back to it at some point
I have a local branch I haven't touched in a hot minute that was doing this, I'll get back to it at some point
Nice. I was trying to help resolve the issue of water spawns for Erk but then realized I couldn't touch much of it without it being very awkward.
I'm not sure I'll get it done in time for stable tho. You can add unhardcoded map extras to the river still for other stuff like birds fine while the maps themselves are hardcoded (I don't see any reason they couldn't just be the monsters for now and add appropriate habitats once it is unhardcoded) and I can add whatever you want adding to mx_reeds if you can't/don't want to compile just for that (Unhardcoding mx_reeds in it's current form without unhardcoding river would be a PITA)
I'm not sure I'll get it done in time for stable tho. You can add unhardcoded map extras to the river still for other stuff like birds fine while the maps themselves are hardcoded (I don't see any reason they couldn't just be the monsters for now and add appropriate habitats once it is unhardcoded) and I can add whatever you want adding to mx_reeds if you can't/don't want to compile just for that (Unhardcoding mx_reeds in it's current form without unhardcoding river would be a PITA)
IIRC from my quick investigation yesterday, I saw that it looked like there were already a lot of shoreline spawns of wildlife just out in the open. So that part may already be unintentionally working. The problem was that they were just out in the open. So it sort of is dependent on making their spawns LOOK better for what they are.
I could look at and audit spawns but I may be re-adding them where they sort of already work now but without the actual location decor. It may make more sense to simply wait for unhardcode then do them all properly at once.
I'll take more screenshots once I get home to show current spawns more in depth.
Current "River bank" spawns from the looks of it. They sometimes look like they are right on the bank and at other times are more smack in the middle of the water. Which isn't bad but never very consistent or thematic.
Ew I don't like overmap::place_mongroups() at all I'd forgotten it existed. None of the logic for swamps/rivers/lakes looks worth it at all over using JSON overmap_terrains "spawns"/map extras(/nests* (*in the case of unhardcoded maps like the lake centre/underwater ones)
It's probably easiest to wait til rivers/lakes get unhardcoded for them tho ye
Ew I don't like overmap::place_mongroups() at all I'd forgotten it existed. None of the logic for swamps/rivers/lakes looks worth it at all over using JSON
overmap_terrains "spawns"/map extras(/nests* (*in the case of unhardcoded maps like the lake centre/underwater ones) It's probably easiest to wait til rivers/lakes get unhardcoded for them tho ye
I figured it would be better to wait until after the unhardcoding. Then from there map extras, nested mapgen etc can be be reworked from the ground up.
I'd suggest for stable, we could leave mx_reed hardcoded, and instead add some other things. A small map extra that washes logs onto the side of the riverbank, with a little eddy pool and some birds in it, for example. Our current nested mapgen code is, IIRC, more than up to the task now of making that kind of contextual information work out, but it's not beginner level mapgen either. I or someone else can probably help out on discord.
Some ideas:
- a washed up log
- a tree and cluster of shrubs growing right on the bank with pooling water behind it
- a jut of boulders and rocky ground protruding into the water
- a short half-formed trail leading down to the shore, surrounded by tall plants and a few trees - sort of place animals go to get a drink
- Just some handcrafted map design for the beach to break up the monotony of random noise
Some ideas:
I can make the mapgen extras no problem. My issue was placing them "gracefully" without easier access to the hardcoded terrain. I'll do some and provide them in a PR and we can go from there I guess.
I think the best way is gonna be to use the context dependent update mapgen features, like search for shallow water and turn it into bushes etc.
I think the best way is gonna be to use the context dependent update mapgen features, like search for shallow water and turn it into bushes etc.
I'm not terribly familiar with that. Is there a current example I can copy from? If not I can just make them 90% of the way and update them after.
This one is probably better discussed on discord because I'm gonna have to look it up and remember in realtime, but if you're not around I'll try to find some help for you over here when I have a sec
This one is probably better discussed on discord because I'm gonna have to look it up and remember in realtime, but if you're not around I'll try to find some help for you over here when I have a sec
I'll catch you on Discord at some point if you don't find the example first.
There's a few different ways to go about it but one of the ones I was considering for beaches was to use this function: https://github.com/CleverRaven/Cataclysm-DDA/pull/22131
so in this case I'd check to see if there was a river shore map north and a river shore map south, and a river water tile west, eg; if there is, that means we're looking at a straight north-south river and we're on the east bank, so we can place a nested map that is 24x24, has river on the left, and grass/land on the right, and then you can just map the whole thing out however you want. That's one relatively easy way to make some very nice maps. You'd have a single map extra, and that map extra would place a single nest map, with the nest map selected from a bunch of conditional options based on the location of river shore and river water tiles.
There are other bits you can play with, that was a big one though
I mean when I unhardcode rivers I'm not planning on keeping the same shape/look so anything like that would need adjusting at the very least, and once done all the nest logic could just be embedded in the map's own nest logic. I don't have a problem if you want to work on it still I'm just saying it's likely going to take longer for both of us if you do it now.
Related:
- #59433
- #38894 (mentioned in issue right above)
Those aren't related to unhardcoding the maps nor monster spawns on them at all but thanks anyway c; (I'd love better overmap river gen but there's not even anyway to hack that with JSON rn it'd entirely be C++)
If bodies of water are no longer hard coded, it would be a fun mod idea to create a 'waterworld' style overhaul mod with cool new places that spawn on water. :D
Mods can already do that using existing region settings Edit: There even is one https://github.com/MNG-cataclysm/CDDA-Waterworld
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.