Rivers and Streams (oh my!)

Show off your mod creations or just a work in progress.
Post Reply
User avatar
Hazelnut
Posts: 2908
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 254 times
Rivers.jpg
Rivers.jpg (184.33 KiB) Viewed 254 times
Rivers.zip
(121.59 KiB) Downloaded 12 times
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

andromacus
Posts: 89
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: 2908
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 184 times
sceneview.JPG
sceneview.JPG (251.22 KiB) Viewed 184 times
scenezoomed.JPG
scenezoomed.JPG (216.8 KiB) Viewed 184 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: 2908
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: 2908
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

Post Reply