Adding Rivers And Lakes
- Tyler Moore
- Jul 16, 2020
- 2 min read
So after getting the basic size of the land established, I started to think about possible map mechanics. The first idea that came to mind was purchasable tiles that gives the player another 50x50 tiles to work with for more space. With the ideas I have planned for the game space will take a big role in the game, as it will be needed to place buildings and machines. One of the main features I wanted to include in this game is a electricity system to power your factory. Depending on how easy it is to implement I'm planning to have multiple electrical sources for the player to take advantage of. One source that I really wanted in the game was a steam engine machine, this is where the rivers and lakes come into the picture. After doing a little research into water powered machines, pumps extract water which is then transported to a boiler which gives the steam engine the heat it needs to generate electricity. Which to me seems simple enough, so when I add machines to the game I plan to add all three machines just mentioned as part of the machine list. The steam engine, boiler and pump.
But first I need to actually implement the water onto the map, and after a lot of thought and research. I'm happy to say procedural generation will be included in the game, for now I plan just do randomly generated water on maps. But in future updates terrain will also be different every time you play the game. Which for me is a huge feature for this game, as I want this game to be different and fun to play in the long run.
The way I went about adding variation to the water was use 2D noise projected onto the tile map which would then generate a pattern on water. Although like I mentioned before I want the map to be different every time you play the game. So, I did a setup of random number generators in the script which will get a random number within a certain range. After doing this, this was the result..

I'm super happy with the result of how the river and lakes are generating, the main problem I've noticed is the layering order of the sprites. As you can currently see the river is floating on top of the terrain, which I found quite funny! It's seems like it might be easy to fix, but that's something I need look into.
Comments