Apr 11, 2010

Omptimizing Areas

Everyone has a thing or two that bothers them. For me, one of the worst is when people start sounding off on something they don't actually know. I am thoroughly convinced that 99% of the internet is based on this kind of content. So I want to clarify the issue of how to handle walkable/non walkable areas and objects in NWN2 toolset.

First of all... if you convert everything u can to environment objects and use walk-mesh cutters, you have obviously read on some optimizations and good for you.

I've heard in the past a pseudo expert tell people to cut down their walk-mesh cutter use because it slows down the game. Well imagine that, something that was designed to reduce hit detection calculations and "speed things up" slows down the game. Well it doesn't. This is what happens with a walk mesh cutter:

It is calculated during baking (which does add BAKE time) and then made into the overall mesh of "walk/don't walk" on the map. It is never calculated again in-game, it simple becomes a simple walkable/not walkable check just like the rest of the non walkable area in the map.

When to use walk-meshes:
-INTERIOR: when an object does not need to be used or hold scripts, but should still block movement, after converting it to an environment object.
-EXTERIOR: Never

I've opened many prefabs, and I'm startled to see the great, far beyond my talents, span of artwork, that is just full of 50+ walk mesh cutters in an exterior area.
While this is fine in-game, when baking these mammoth exteriors, the walk-mesh cutter calculations take longer than the final "tile" part at the end.

Using the walk-mesh cutter outside is not a good idea. They were designed for use in the interior, where you cannot alter the walk-mesh in any way, as it's all tiles.

In terrain editing, in the terrain painter tab we have two options to do this: walk and non walk. And you can paint them right down to a triangular sliver this way.

Some may say they are using walk-meshes to fit the "Exact" shape of a rather detailed object. This isn't a valid reason as objects that are more precise than a triangle on the surface-mesh, are too small for the player to walk into anyway. That is, you are being more precise than the engine recognizes.

Lastly some shadow commentary: Most of you probably know to turn off casts shadows to gains some efficiency. But in the spirit of gaining as much "loss-less" shadow reduction as possible, always turn these options off for smaller items that are already in the shadow of a larger item. Example, some rocks that are directly beneath a tree. Their shadow won't be seen anyway, so by shutting these types of shadows off, you may not have to shut off any visible ones. And thus you preserve the realism.

Generally you will keep "receive shadows on" and remove the casts shadows, and there should be no difference in the visuals. Turning receives shadows off can be dicy, as to the trained eye certain objects will look completely phony.

Once again I'd just like to say these prefabs are extreeemely artistically great and will be used well in my campaign.


Campaign Update

Well I am basically down to two areas, which are done except the two boss fights. So I guess that means I am two (major) battles from being a finished alpha test, where someone can play it to the end. After that, I just want to redo the writing because I rushed it all and am not at all satisfied with it, and add some voice acting.

4 comments:

  1. Interesting comments on the walk-mesh cutter thing. I never did fully appreciate when to use or not to use, and have not yet (to date) used it as a performance improvement as my areas don't appear to suffer from it. That's also probably a sign that they are a bit basic. ;)

    Anyway, good to know.

    Lance.

    ReplyDelete
  2. Bare in mind, Bard of Althea, that your computer isn't the benchmark of what "suffers" from lack of optimization. Apparently (and I could not believe this when I first heard it) a huge reason the nwn1 community remains larger is because a lot of people have not updated their video cards to even the minimum nwn2 specs (or CPUs in this case). So for those it could be just a game breaker.

    You also have to consider someone like myself who enjoys the game at max settings, but may have to back off a few to enjoy your module. Optimization is never wasted :)

    ReplyDelete
  3. I suppose I was hoping that if someone had NWN2, then they will at least have a computer spec that would work reasonably well ... but I take your point and may have to reconsider.

    Lance.

    ReplyDelete
  4. That was one example, but no matter what power you have, it decreases with demand. I take it you have not learned the walk mesh cutter process?

    If you had a desk with items on top that is not to be anything but static, simply select the whole set, right click and convert placeables to environment objects. Then draw a single walkmesh cutter in the shape of a box around the set as tightly as you can. done :)

    ReplyDelete