The reason for this is that I found some strange bugs in certain areas when doing path-finding. The found path would sometimes lead to x0, y0, z0 which isn't something I would ever want. I checked if there were any newer versions of recast & detour and surly there was. I went through the demo project source and didn't notice any real big changes to the navigation mesh building phase but I decided to implement the new version anyway... Maybe there were bigger changes "beneath the hood". When re-implementing the library I found that there was a variable named edge max error. I had overlooked this parameter setting in my own editor. It was just a hard-coded value in the source (a rather big and bad value at that). Now I've made a GUI element where I can adjust its value and after a few preliminary tests I haven't noticed any paths leading to wrong places. So I am hoping this have fixed my problems once and for all...
I have also made some graphical changes to the game. Water and vegetation looked stiff and unnatural without any animation. Animating trees and smaller vegetation can be quite a big undertaking. To circumvent the issue I have thought about moving the vertices of the vegetation but I hadn't gotten around to it yet. Now I had a few hours to spare so I thought I would try it out. I decided it would be sufficient to move the vertices of the treetops to begin with; the trunk (which is most often another object) could be still. Also it should only be needed to move the outer most vertices of the treetop. The reason for this is to simulate that the treetop is stiffer the closer it is to the trunk. To make things easy and get results more quickly I choose to implement this in the game itself, leaving out the editor (I might go back and incorporate this later).
I searched the resource name of the graphic. If the filename contained the word "plant" or "treetop" it would animate, simple as that. Then I just needed a random wind-seed-number and move it around using cos and sin. To my astonishment it looked quite good the first time around! :-) As a matter of fact it looked so good that I decided to go ahead and implement a similar routine to make the water go slightly up and down. This was a bit trickier as a water tile has to line-up with its neighbours. The illusion of a water surface disappears if there are gaps between each tile/wave. It's hard to describe in words how mush it does for the vividness of the scene; Here's a small video showing it in action.
The animations are hard to see unless the 720p video is viewed. The water waves could still use some tweaking.
Thanks for reading!