Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Nav, Nov and Decals

Sign in to follow this  


Yet More Navigation Fixes

Well, I keep saying it's fixed, and now I'm more sure, but I'm not yet really sure. I did re-write the navigation grid last night ( again ). This time I'm not using a 2d grid, but a std::set of navigation::nodes. This was designed to fix the over-under problem, which while not intended to be common in our game due to the mostly top-down view, it still can legitimately happen, like on the tower level.

In the process I cleaned up a couple of other aspects of it, and now I think it's actually a bit faster than before. It took me most of last night to get it back on track and making the A* work again. While looking through the code, I also cleaned up that a bit and made a couple of potential fixes.

So, now the pathfinding works again, and hopefully it will fix the tower level.


I have partially integrated the Novodex physics API into our codebase. The world is being cooked as a static collision mesh, and I put weapons in there as dynamic actors. In order to retain maximum control over character movement, I have kept our capsule collision code working for all sentient characters.
Novodex has a cool feature called Kinematic objects, which allows the characters to affect the world, but not get affected by other objects. This seems to work well so far.

I am having some tunneling problems right now on some of the smaller weapons, but I think I know what I need to do to fix them.

Decal Fix

I was seeing a very strange problem on a couple of levels where part of the level would appear to fog out. It seemed to be happening on world tile boundaries, which was very strange. Each world tile is broken up into roughly 2000 triangles, for the sake of collision, culling and lightmap atlas creation. Why I would have one tile fogged and another one not fogged baffled me completely.

Here is a shot. Note the lower left bit of floor is not fogged, but the rest of the floor is :

I suspected the decal system might be to blame, so I put in some asserts and found out that some scorch mark decals had near-infinite bounding boxes. I was able to track this down to a problem when lasers hit something. I put in code to prevent lasers from hitting the guy that shot them, at least until they are reflected by a shield or something similar. That reminds me : I should make reflective materials also reflect lasers. It would be very cool to shoot around corners.

Anyway, this change created a flow control problem where I thought I hit an entity, but it turned out to be the dude that fired me, so I skip him, but keep going, with an infinite hit distance. Then I created a bounding box, and got all the tris in the box, which turned out to be the whole world tile. Then I mapped the texcoords, and they happened to end up near the texture center, which ended up looking gray.

Once I fixed that case to abort, the problem went away. Here is a shot of some creatures mercilessly hunting me down :

Sign in to follow this  


Recommended Comments

Sim, what type of animation are you using on your sentient characters? Is it keyframed, skeleton or a combination (or other)? Also, are you doing it on the gpu or cpu?

Your screen shots look great - do you think there will be a small video of the action taking place anytime soon? Keep up the good work, I am definitely rooting for you!

Share this comment

Link to comment
Thx for the feedback.

Right now I am using gaussian-weighted keyframes. I use standard MD2 files right now, recorded at just 10 fps. I interpolate the positions & normals via a gaussian weighted function, so you can dump any # of keyframe 'events' in a queue, with a timestamp for each, and it will figure out how to weight all recent events so that the newer ones are weighted more, but it still lerps between the old and new.

10 times per second there is a new keyframe event, plus if you want to blend in another animation, or switch animations at other than 100 ms intervals, you throw in another event at the appropriate timestep, and the code interpolates between them. It looks pretty smooth, but can warp the character if he moves too much between frames.

Right now the interpolation happens on the CPU, but the normalization of the normals is in the vertex shader. Also, I cache the animations so they are only done once per frame, so for each shadow from each light, they are re-used. Still, this takes up ~5% of the cpu time with 5 or 6 enemies plus the main character.

Thankfully, we just got a talented modeller and animator on board, and he is starting on the boned models. Also, my coding collaborator is integrating the animation code, so soon we will have some real artwork in there!

I expect that the animation will be done in the vertex shader.

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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!