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

Document legends export format (or: how do river paths work?) #5154

Open
Lancelotbronner opened this issue Dec 29, 2024 · 4 comments
Open

Document legends export format (or: how do river paths work?) #5154

Lancelotbronner opened this issue Dec 29, 2024 · 4 comments

Comments

@Lancelotbronner
Copy link

Rivers paths have "coordinates" with 5 components and I'm not sure what they mean?

<path>4,123,85,5,100|3,123,164,2,99|2,123,241,8,99|</path>
<end_pos>1,123</end_pos>

This test world is 129x129 so I'm not sure what the middle number means, could it be flow/size? If that's the case I'm guessing the path could be a straight line from eg. 4,123 to 5,100 but that doesn't seem to check out with the world map.

My other guess is that only the first 2 components are the coordinates and the other three are something else entirely, I'm hoping one of those can help determine the size.

I'm trying to determine the list of coordinates on which this river flows. Also is there a way to determine the size (large, medium, small, brook) of the river?

Context: I'm building another LegendsViewer equivalent but plan on using Dwarf Fortress assets to render it as close as possible to what we see in-game.

@myk002
Copy link
Member

myk002 commented Dec 29, 2024

There is some discussion on this topic here: https://discord.com/channels/793331351645323264/807444515194798090/1132838980942057532

If you're not already on the Discord server, the join link is https://dfhack.org/discord

@Lancelotbronner
Copy link
Author

Thanks! I just joined the Discord server but I don't have access to the #feature-discuss channel.

@myk002
Copy link
Member

myk002 commented Dec 29, 2024

(following up on Discord)

@lethosor
Copy link
Member

lethosor commented Dec 29, 2024

For posterity: the code is here: https://github.com/DFHack/scripts/blob/542d4089fc907a151e7b4fc0b75c95dd3dbef31c/exportlegends.lua#L206-L219

relevant bits from the Discord discussion:

so the source confirms that it is indeed x, y, flow, exit_tile, elevation

Wait so <path>6,2,0,10,99 | 7,2,75,8,99 | 7,1,141,13,99 |</path> would be a river of only 3 tiles? I don't understand

no, of three segments

More information in df-structures: https://github.com/DFHack/df-structures/blob/ffdf5771ea23e3b35f5f46624f773a555e1c450f/df.world-data.xml#L246-L272

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

No branches or pull requests

3 participants