• entries
    154
  • comments
    388
  • views
    163208

Fixes and features

Sign in to follow this  
O-san

1209 views

The last few days I have been working on updating the navigation mesh tool in the editor. This will then be a matter of copy and paste to get into the game.

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.

[media]
[/media]

The animations are hard to see unless the 720p video is viewed. The water waves could still use some tweaking.

Thanks for reading!
Sign in to follow this  


7 Comments


Recommended Comments

The effect looks absolutely beautiful on the trees/vegetation. I think it is not subtle enough on the water, though - maybe consider slowing down the animation a bit?

Share this comment


Link to comment
Thanks everyone!

Black-Rock, you are too kind :-)

I agree, the water animation was a bit too violent. I have added the functionality to the editor so now it's possible to tweak it until satisfaction ;-) both the speed and the height of the waves.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now