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

Hills not acting as base terrain, even when mod says they should #10976

Closed
1 task done
SpacedOutChicken opened this issue Jan 20, 2024 · 3 comments · Fixed by #11020
Closed
1 task done

Hills not acting as base terrain, even when mod says they should #10976

SpacedOutChicken opened this issue Jan 20, 2024 · 3 comments · Fixed by #11020
Labels

Comments

@SpacedOutChicken
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

4.10.0

Describe the bug

In the original DeCiv, hills were a base terrain type instead of a terrain feature, similar to how Mountains are a base terrain and not a feature on top of the terrain. I've attempted to recreate that in a mod that I'm calling DeCiv 1. I changed Hill's type from TerrainFeature to Land. In spite of this, whenever you start a game, Hills always appear on top of existing terrain, such as Tundra or Wasteland.

Steps to Reproduce

Start a game with this mod and you'll see Hills on top of every land terrain except mountains.
DeCiv1Hills.zip

Screenshots

Screenshot (163)

Link to save file

No response

Operating System

Windows

Additional Information

Here's the code for Hill terrain:
{ "name": "Hill", "type": "Land", "production": 1, "movementCost": 2, "defenceBonus": 0.1, "RGB": [105, 125, 72], "uniques": [ "Rough terrain", "[+5] Strength for cities built on this terrain", "Has an elevation of [2] for visibility calculations", "Occurs in groups around high elevations", "[+1] to Fertility for Map Generation", "A Region is formed with at least [40]% [Hill] tiles, with priority [5]", "Considered [Desirable] when determining start locations", "Considered [Production] when determining start locations", "Every [22] tiles with this terrain will receive a major deposit of a strategic resource." ] }

@SomeTroglodyte
Copy link
Collaborator

I believe "Occurs in groups around high elevations" triggers your displeasure - you're asking for the specialized generator that knows Hill is a TerrainFeature... See raiseMountainsAndHills. You'll need to remove that unique and thereby decouple it from elevation, and find a humidity/temperature niche for it or there won't be any.

Or rewrite raiseMountainsAndHills, cellularHills and possibly cellularMountainRanges too for consistency.

(raiseMountainsAndHills has a horrifying bug - it logs the found mountain terrain's name when it intends to log the hill name!)

@SpacedOutChicken
Copy link
Contributor Author

I had hoped that the unique for occurring in groups would work like the unique for occurring in chains, but I guess not. Do you think it's even feasible doing all that rewriting, to say nothing of whether or not it's desirable?

@SomeTroglodyte
Copy link
Collaborator

would work like the unique for occurring in chains

It does, in that it's hardcoded to expect a specific terrain type. Chains1 will probably fail miserably should you attach it to a TerrainFeature...

I experimented yesterday trying a generalization for both that uses dynamically built lambdas for the actual terrain modification, so both could work with both terrain types, but it got endlessy complicated very quickly. Might be better as "ElevationAgent" class hierarchy... Anyway, not much fun in coding.

Footnotes

  1. Not the 'Kill Six Billion Demons' character

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants