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

Rivers are still hardcoded #72951

Open
RanikOrtega opened this issue Apr 10, 2024 · 20 comments
Open

Rivers are still hardcoded #72951

RanikOrtega opened this issue Apr 10, 2024 · 20 comments
Labels
(P5 - Long-term) Long-term WIP, may stay on the list for a while. <Suggestion / Discussion> Talk it out before implementing

Comments

@RanikOrtega
Copy link
Contributor

RanikOrtega commented Apr 10, 2024

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.

image

Describe alternatives you have considered.

No response

Additional context

No response

@RanikOrtega RanikOrtega added the <Suggestion / Discussion> Talk it out before implementing label Apr 10, 2024
@Procyonae
Copy link
Contributor

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

@RanikOrtega
Copy link
Contributor Author

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.

@Procyonae
Copy link
Contributor

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)

@RanikOrtega
Copy link
Contributor Author

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.

@RanikOrtega
Copy link
Contributor Author

RanikOrtega commented Apr 10, 2024

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.
water1
water2
water3
water4
water5

@Procyonae
Copy link
Contributor

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

@RanikOrtega
Copy link
Contributor Author

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-am-Erk
Copy link
Member

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

@RanikOrtega
Copy link
Contributor Author

RanikOrtega commented Apr 11, 2024

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-am-Erk
Copy link
Member

I-am-Erk commented Apr 11, 2024

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.

@RanikOrtega
Copy link
Contributor Author

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.

@I-am-Erk
Copy link
Member

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

@RanikOrtega
Copy link
Contributor Author

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.

@I-am-Erk
Copy link
Member

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:
#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

@Procyonae
Copy link
Contributor

Procyonae commented Apr 11, 2024

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.

@NetSysFire
Copy link
Member

Related:

@Procyonae
Copy link
Contributor

Procyonae commented Apr 11, 2024

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++)

@Michael1993
Copy link
Contributor

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

@Procyonae
Copy link
Contributor

Procyonae commented Apr 13, 2024

Mods can already do that using existing region settings
Edit: There even is one https://github.com/MNG-cataclysm/CDDA-Waterworld

Copy link
Contributor

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.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label May 13, 2024
@I-am-Erk I-am-Erk added (P5 - Long-term) Long-term WIP, may stay on the list for a while. and removed stale Closed for lack of activity, but still valid. labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(P5 - Long-term) Long-term WIP, may stay on the list for a while. <Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

No branches or pull requests

5 participants