Rivers and Streams (oh my!)

Show off your mod creations or just a work in progress.
User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Rivers and Streams (oh my!)

Post by Hazelnut »

When I originally made the BasicRoads mod with road and track paths I also created the code for rendering waterways on the terrain as well. There are 2 types - rivers (4 tiles wide, 3 water) and streams (2 tiles wide, 1 water) and that code has been sitting dormant since the mods' release. The task of pathing was quite arduous so it's taken me over a year to come back to it, but there have been several requests for rivers, so I figured I should use this code at last. I've improved the connection rendering and extended the editor to allow editing waterways, then spent many hours starting to path some and done about a third of daggerfall region. It is definitely harder work than doing roads since every terrain map pixel needs to be looked at, not just location intersections, but there's much less time pressure so I hope that over many months the task will gradually get done by croudsourcing to the DFU community even more than with roads.

The zip file attached contains new versions of Basic Roads and Travel Options with waterway integration. You only need BR to edit waterways, but the TO changes are there if you want to test them. (note that the travel map will only have new waterways once I've merged the data into the binary files)

Instructions for editing waterways and submitting the data can be found in the third post. Personally I am not bothered about getting water in game as it's for flavour only and serves no gameplay purpose, although it could potentially in future. My point is that I am providing the ability for the community to put rivers into DFU but I will not drive it like I did for roads. It may be that the people interested take a look at the examples and conclude that this ultra simple method is not good enough and looks awful, if so that's fine. I'm not going to do anything more modern and refined, and I think this approach is very daggerfall ish, but I'm sure someone will eventually. :D

The Basic Roads mod will have a setting so users can choose whether they want water enabled or not and until the whole world is finished water will be disabled by default.
Attachments
RiverRoad.png
RiverRoad.png (451.49 KiB) Viewed 6629 times
Rivers.jpg
Rivers.jpg (184.33 KiB) Viewed 6629 times
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

andromacus
Posts: 113
Joined: Sat May 23, 2020 9:07 am

Re: Rivers and Streams (oh my!)

Post by andromacus »

That looks amazing!

I suppose this won't be compatible with the "Interesting Eroded terrain mod", right? I mean, will this work only on a completely flat land or also where ground has multiple levels?

Thanks as usual!

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Rivers and Streams (oh my!)

Post by Hazelnut »

So, calling anyone who wants to draw rivers and streams for this mod - it's now time for you to have a go. Anyone who is reading this can contribute, since all you need is a PC capable of running DFU. (however a high res monitor will help) Unlike roads I am not proposing a region by region method, as doing a whole region is too time consuming. I hope that people don't end up submitting the same areas, I think it's unlikely and I will try to keep up with submissions so as long as you use the latest BasicRoads dfmod from this thread and choose a blank area it should be fine.

Please bear these things in mind:
  • Ensure you follow the instructions below by reading them very carefully!!
  • Pay attention to junctions, coastline, location tiles, and most importantly terrain gradients! I would like to avoid rivers flowing down then up visibly. (probably not a big deal if several map pixels apart)
  • Don't try to edit any existing rivers, as I will not be able to merge it. If you feel strongly enough make the edits and post a screenshot and I will manually change the data.
  • Take some time to study the existing rivers and see how they're laid out and connected.
  • Put the time in and focus on quality rather than quantity - this is much more time consuming than doing roads because of the constraints.
  • Please pay attention to terrain gradients to avoid obviously nonsense flows of water using the standard DFU terrain. (terrain mods will likely make it look silly) I did mine in Daggerfall region which was easy because it's relatively flat. Other regions will be much trickier, especially given the low resolution of the path data for this mod. (only from centre of each map pixel)
  • Post screenshots of the new waterways from the patheditor and circle your changes if not obvious so i know what I am merging.
  • Bear in mind these are to give the world flavour, it's not a simulation and players will only see these waterways flash by as they travel with TO for the most part, so looking good on the travel map is a good start since in game vision is limited
Editor instructions:
  • Install Unity 2019.4.28f1 LTS, get the latest DFU code from github and open it. You will really need to use the scene view to get an overview on how water looks with locations, paths and terrain etc.
  • Start the game using the unity editor play button and enable water editing in the BR mod settings. (will disable road and track editing) Also enable waterway rendering since it's off by default! :)
  • Load a save game and open the console to type 'patheditor'.
  • When first loaded the editor will start with a copy of the binary river and streams path data from the dfmod package. Changes you make will be written to a text files riverData.txt and streamData.txt in StreamingAssets/WorldData folder. Note that it doesn't write the file until you make a change and say yes to saving when exiting. You can delete these if you want to start again, or move them to do a different area so each can be submitted separately.
  • The editor window is a modified extension of the DFU travel map, you can select regions and zoom with right click. (1600x1000 minimal resolution recommended)
  • There are buttons top right for rivers and streams - they will toggle the display on/off and if on when clicked will highlight red to show you're now editing that type of path. (helps to not edit by accident)
  • Left click on map pixels to mark it as having a path of the type selected, and click again to unmark. An unconnected pixel with show as having all 8 directions until connected.
  • Paths connect to adjacent water, and sometimes you will need to click different combos to get the layout you want. Diagonal directions are preferred over cardinals by the connecting logic. This is opposite to how it works for roads. It wont connect diagonally if it would make a perpendicular right angle T shape, so that can be used to get the connections you want by marking some temporarily. Play around and figure it out. :)
  • Paths are drawn on terrain in this order: tracks, streams, rivers, roads. So roads will always cover the others and tracks are covered by everything else.
  • Fast travel to a location in an area you want to draw rivers, start the patheditor via console and then switch to scene tab. I recommend using a game tab resolution of 1600x1000 (exactly 5x 320x200) and reducing the console and navigation/inspector windows to the smallest you can to see as much terrain in scene view as possible. Use the lightbulb button to switch between constant lighting and in game lighting (the latter you will need to ensure it's daytime in game) and standard unity scene viewer interaction to look at the terrain.
  • Using scene tab, note locations with a lot of water tiles, or coastal coves etc and they can be used to form waterway paths. Or just fill in blank terrain, find valleys etc. Be creative. Switch to game tab to use the edtor, and switch between them as needed.
  • Initally set up scene view by double clicking on PlayerAdvanced in Hierarchy and then zoom out. Orient it so north is up (face player N in game and see the view cone in scene view) - these settings are remembered between sessions usually.
  • After switching back and forth between scene and game tabs, making some edits, exit the patheditor and say yes to save the changes. Now fast travel again to same location to regenerate the terrain and check scene view. Iterate until happy then travel to a location nearby and gradually cover the land as you go.
  • I found it useful to bump the terrain distance to 6 so I could see more land in scene view and not need to fast travel and move the player around as much. To do this edit line 55 of StreamingWorld.cs and increase the range max from 4 to 6. Then when you start DFU and load a save, find StreamingWorld and select it. Increase the slider from 4 to 6 and then fast travel. I don't recommend trying to play like this but having 169 map pixels in scene view is helpful.
  • Click on terrains in scene view to see where paths will go in patheditor can be useful. They highlight in orange and you can count over from locations this way to hit a cove etc.
  • When you exit, you can save your changes or discard them. If you discard, it's useful to clear the editor by restarting DFU (remember to change terrain dist in inspector again)
  • When you're done, post the StreamingAssets/WorldData/riverData.txt and streamData.txt along with a screenshot of the layout from the editor.
Here are some screenshots of this process and how it looks in my Unity editor.
patheditor.JPG
patheditor.JPG (327.1 KiB) Viewed 6559 times
sceneview.JPG
sceneview.JPG (251.22 KiB) Viewed 6559 times
scenezoomed.JPG
scenezoomed.JPG (216.8 KiB) Viewed 6559 times

Have fun!
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Rivers and Streams (oh my!)

Post by Hazelnut »

andromacus wrote: Fri Jan 14, 2022 12:49 pm That looks amazing!

I suppose this won't be compatible with the "Interesting Eroded terrain mod", right? I mean, will this work only on a completely flat land or also where ground has multiple levels?

Thanks as usual!
Thanks, hope you'll get involved in pathing waterways! :D

It may well look silly with terrain mods with obvious nonsense of water flowing down then uphill. But we will see how bad it is, they should work anyway.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Rivers and Streams (oh my!)

Post by Hazelnut »

Have updated the first post, and added instructions for submitting new rivers and streams. Lets see what happens.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Rivers and Streams (oh my!)

Post by Hazelnut »

Hazelnut wrote: Fri Jan 14, 2022 1:47 pm Have updated the first post, and added instructions for submitting new rivers and streams. Lets see what happens.
Well so far sweet fanny adams...
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Cliffworms
Posts: 208
Joined: Sun Dec 30, 2018 6:24 pm
Location: Québec

Re: Rivers and Streams (oh my!)

Post by Cliffworms »

As soon as I clear out one of my other projects, I'll be glad to! :)

User avatar
carademono
Posts: 210
Joined: Sat Jul 11, 2020 3:20 pm

Re: Rivers and Streams (oh my!)

Post by carademono »

I'm also excited to work on this but a bit overwhelmed at the moment. I was wondering, though, might it not be preferable to generate a full river map and adjust the terrain around it so rivers don't cross hills? Laying waterways by hand will be an even bigger project than laying the roads, and that was the biggest group project in DF Unity's storied history. Moreover, rivers laid by hand would break with different terrain mods. Adjusting the terrain would require more work upfront but vastly less after that.

User avatar
Ninelan
Posts: 187
Joined: Wed Jun 30, 2021 10:30 am
Location: Under your bed
Contact:

Re: Rivers and Streams (oh my!)

Post by Ninelan »

Rivers are a big YES from me but atm I'm swamped with other projects and I'd be stretched too thin until I finish them :?

I can help draft out realistic-ish river pathing at least. So if anyone wants to help, but feels like figuring out where water flows might be too daunting of a task.

To help make rivers with proper lengths it's good to define watersheds based on the terrain, having these greatly helps shape the rivers for you.
rivermap4.png
rivermap4.png (14.27 KiB) Viewed 6029 times
The important thing is to have the path of the main river flow.
rivermap3.png
rivermap3.png (81.36 KiB) Viewed 6029 times
After that's done all there really is to it to merely add the tributaries from the far reaches of the watershed and connect them to the river.
rivermap2.png
rivermap2.png (116.98 KiB) Viewed 6029 times
Interesting how it looks like in sahara! As an example of how they look like.
https://i.pinimg.com/originals/f6/5e/cb ... 7c01f6.png
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

User avatar
Ninelan
Posts: 187
Joined: Wed Jun 30, 2021 10:30 am
Location: Under your bed
Contact:

Re: Rivers and Streams (oh my!)

Post by Ninelan »

I went ahead just to try it out and in no time the waterways formed, taking care that they also pass through remote locations that are particularly 'watery'. Having the heightmap at hand is a must.

It did become clear that in these much longer riverine ways, that streams and rivers become a bit tiny the longer the river is. There is no Danube for Daggerfall, but it sure would be great to snake a big chonker of a river around a city! (with boats!)

This is the result so far but there is much to improve and I want to completely change the pathing there where I started working first. The later additions are much better as there was something to work off.
rivermaps.png
rivermaps.png (355.94 KiB) Viewed 5776 times
A glass of gin and a few evenings, I bet I could cover the whole map with rivers in no time. It is not actually that difficult to keep the rivers flowing 'down' with a few exceptions where the heightmap has a few weird hiccups.
But I would love a few extra widths including a massive one pretty please, if so possible! :D
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

Post Reply