Wednesday, March 9, 2016

Rivers, streams and more optimizations

I found a way to optimize the noise function I'm using by reversing how I calculate it and without calling it for all the cubes in the same X and Z coordinate in one chunk, but just changing the Y calculation in the end of the noise function. This allowed me to create the heightmap 100 (or something like that) times faster.

Why I began poking around the noise function was because I'm trying to add water to the game but
adding rivers and streams is very hard (at least making it fast enough), so incidentally looking for a way to add rivers via heightmap I found the optimization, although it didn't help me much in adding the rivers. I need to add some sort of flood fill algorithm to the noisemap to add rivers (streams are harder) and modify the values accordingly, though this is quite hard as overflow of the water can happen easily...

I also received new GUI graphics from Samuli which I have to add to the game, but before that I have to reprogram the GUI framework so I can modify the GUI more easily and add more features to it as well, I'll also add support for players to modify the GUI.

Here's also a webm of the trees that I got working in the game, I'm a little worried on how much objects I can actually let the player see before it fries their GPU.
View post on imgur.com

No comments:

Post a Comment