Update October 2017. After a long time following courses on how to build in Unreal Engine, I finally have started with building blueprints. Busy building a watersystem
Update may 2017. I have reactivated the project. Was too busy with ordinary work :-). I am following a course on Udemy (Unreal Engine 4: How to Develop Your First Two Games) to get my skills on a higher level.
The dynamic water system on land is programmed as a blueprint. BP_Watersystem contains both the logic and the assets of the water system. The backbone of the BP_Watersystem is a spline with points. The points represent a change in the water system, for example: input discharge, different structure (pipe, channel, weir..), different dimension. So each point (=Node) is connected with the database WaterSystemData. So in between 2 points (=branch) of the backbone spline, everything is the same, based on the information of the downstream point.. Spline and point represent the bedlevel of the structure.
Index 0 spline is downstream
Al the programming is done in the so called construction script. This is a cool feature of Unreal Engine. Al programmed calculations can be done in the editor. It is for example not necessary to run the game, to see what waterlevels will occur. They are already calculated in the editor.
Because the complexity of the blueprint I made a prezi with most of the code. If the blueprint code is to big to show properly in 1 picture, I used https://blueprintue.com/ to show the code. If this is the case a link is provided in the prezi. Make sure popups are allowed in your browser
The basis of the watersystem is a spline. Between 2 nodes the structure is the same. The location of the spline is the bedlevel.
A BP_Watersystem is one line with no branches and has a fixed direction of flow.
A dendritic system is possible, because the 3D world may contain different BP_Watersystems which are connected at points. When calculation a dendritic system the sequence of making calculations is important.
Strategy for calculating the water-system.We assume a stationary flow. So new calculations are only made when changes are made to the water-system. In the future calculations will be made per time-step and change in storage will also be taken into account.