IntroductionAs you may have read in my Natural Diversity topic, I have recently discovered that it is possible to have parts of meshes appear with the same properties as the water in the game. I did this by adapting the existing material that is used for the water in river and lakes, and applying it to my mesh. In this brief tutorial, I will explain how to use this water appearance for your own meshes. While I used it in combination with a terrain alteration to create a naturally looking pond, it may be used for a great many other things, like fountains, canals or pools.

Disclaimer:As I expect mainly experienced modders to be interested in utilizing this, I’m not going to explain the basics of how to create a mesh and have it show up in the game. There are other excellent tutorials that explain this in great detail.

Copyright InformationI am freely distributing the files I created to make this work, so that everyone can benefit from them. You are free to use these in your mods, just put an acknowledgement somewhere in the mod description .

Necessary FilesJust like any mesh, the Rivers and Lakes in banished get their look from referencing a specific Material file. Though the toolkit provides us with the Material files that are used for this, namely 'Material\River\RiverMaterial.rsc’ and ‘Material\Lake\LakeMaterial.rsc’ (which both use the ‘Material\River\RiverMaterial.srsl’ as a basis), using these original materials for some reason does not work for normal meshes. I have created an adaptation of these original files, so that the water Materials can be used to fit our needs. These files can be found in the attachment.

Unpack the zip and include everything in your *mymod* folder, so that the structure looks like this:

*mymod*\Material\Bartender\WaterMaterial.srsl*mymod*\Material\Bartender\RiverMaterial.rsc*mymod*\Material\Bartender\LakeMaterial.rsc*mymod*\Material\Constants.srsl*mymod*\Material\Lighting.srslMake sure that this structure doesn’t change, the files need to reference each other so if anything changes it will produce an error.

The meshCreating the mesh is probably the easiest modeling you’re ever going to do for Banished. All it needs is a horizontal plane, placed where you want the water to show up in the mesh. If your mesh has other parts that you don’t want turned into water, then make sure that this plane has its own unique material assigned to it. In my case, it is the only part of the mesh, so I’m using one material. For this example, I simply named the material ‘pond’.

For the UV maps, only the first channel matters for the water. I used to simple unwrap to create a map that is exactly square, just like the mesh. The UV mapping influences the movement of the water, so the best effect is achieved if the x/y proportions are the same as those of your mesh. The scale of the UV map influences the size and speed of the movement in your water. A big scale will result in very little movement, a tiny scale will result in huge waves. Depending on the size of your plane, you will need to play around with this in order to achieve the same size and speed as the natural water. The rotation of the UV map determines the direction of the movement.

How to add water to your meshes (advanced)

That’s it for the modeling. There’s no need for textures associated with the water, as it uses the ones already supplied by the game. It also completely ignores any AO’s you might use for other parts of the mesh.

The Material fileTo get the mesh to show up as water in the game, we need to direct it to the right material. This is done as with any material, with a properly named .rsc file in the MaterialInstance folder. In my example, this is the Pond.rsc file, placed in *mymod*\Buildings\Pond\MaterialInstance. It looks like this:

]}Since my pond is an isolated body of water, it uses the LakeMaterial.rsc, which creates calm and still water. If you wish to use the RiverMaterial.rsc, which creates water moving in a specific direction, change the file in the places described in the comments.

That’s all there is to it! Now if you place it in the game, this part of your mesh will show up as water.

There are a few final things I want to note:- The colour and sky reflection of the water in rivers and lakes are largely created by an interaction with the underlying lowered terrain. Without this the water will look transparent, though the movement is still visible, and it still reflects nearby objects. In these cases some realism can be created by changing the colouring of the textures underneath the water, for example by making them slightly darker than the rest of the mesh.- The first time you load the mod in the toolkit with the new material files, it may give an error upon closing the application. This does no harm whatsoever, and doesn’t happen anymore once the mod is packaged.- It is possible to change other properties of the water by altering the WaterMaterial.srsl file, such as the speed of the movement. If you decide to make changes to this, please change the name of the folder from ‘Bartender’ to something else, to prevent your changes from affecting any other mods that use these files.- For an explanation of how to use this technique to make water go around a corner, see http://worldofbanished.com/index.php?topic=1671.msg32379#msg32379

If you have any questions or comments regarding this tutorial, please post them below.

You can scale down the square on the UV map to make it flow faster and have bigger ripples at the same time . If you do that it basically draws a smaller part of the texture instead of the whole, resulting in a more 'zoomed in' image.

It does work if you move the plane into vertical position, though then you also get the issue that it is just transparent. I guess with the right flowing speed and the right background, it would be possible to make a realistically looking waterfall though . The only thing I noticed is that the reflections are a bit weird in that case; it just reflects stuff as if it was horizontal no matter what the actual orientation is. Now if I get really bold I could try to improve it so that it would take the orientation into account, but I'm really not sure if that's possible.