Aller au contenu

Photo

Environmental objects + Walkmesh cutter


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Jereniva

Jereniva
  • Members
  • 125 messages

This is a question just for my own information, if anyone knows the answer.

I've read a few places that making a placeable object, like a Crate for example, as Environmental, and then using a walkmesh cutter around it will improve pathing.

This makes sense, but how is it better than leaving the placeable as it was?

Also, is there a difference between walkmesh cutter and just toggling walkable at the Terrain level? Cutter trigger has more flexibility of course, but is there any advantage to one over the other?

 



#2
rjshae

rjshae
  • Members
  • 4 497 messages

For solitary placeables it usually doesn't matter. But If you have a cluster of placeables in the same location, then the area may not bake successfully. In that case, it is often better to convert the group of placeables into environmental objects and then draw a walkmesh cutter around it.

 

The reason that bakes can fail is that the system only allows a fixed number of mesh triangles (128) per grid square. (Those are the little green triangles you see when you display the mesh.) If it needs more mesh faces than that, then it just blocks out the entire square.

 

Walkmesh cutters can also be used for outlining trees, although in that case it is usually better just to make the mesh non-walkable instead.



#3
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

There's a few things.

 

1. Placeables use more memory than environmental objects because they have more properties. They also make some scripts take longer to execute because they can be found as part of many loops. For these reasons reducing placeable counts is beneficial to servers or anyone who might not be running the game with a powerful CPU. On the flip side walkmesh cutters are essentially free for server and client run time. If you wanted to be extreme you could even delete them after baking (not recommended without a backup) and it wouldn't affect the walkmesh.

 

2. Walkmeshes are easier to build when you don't have placeables. Walkmeshes are best built using only terrain and walkable placeables at first, then restricted by having cutters placed to restrict areas where PCs should not be going. Placeable walkmeshes are prone to error and often have larger meshes than what you need, especially if you have them against walls or other surfaces that are already unwalkable.


  • rjshae aime ceci

#4
Tchos

Tchos
  • Members
  • 5 063 messages

Although on the whole it's usually more beneficial to convert all non-usable placeables (and which don't have scripts on them) to environmental objects, there are some other reasons to leave them as placeables, as long as they're not causing problems.  Placeables serve to block line of sight, and environmental objects don't.  This can affect enemy behaviour, and it also means that the camera in-game may be on the wrong side of a wall, blocking your view, if your wall is an environmental object.

 

Then again, environmental objects may fade to transparent when you don't want them to, if you happen to mouse over something selectable on the other side, revealing something that was supposed to be hidden.

 

Also, sometimes I want to change something in a patch that will work in a game in progress.  Environmental objects are a little harder to deal with in that regard.  But that's a very niche thing that won't affect most modders.


  • GCoyote et rjshae aiment ceci

#5
kevL

kevL
  • Members
  • 4 070 messages

on the tech side: Think of a placeable with dynamic collisions as an object that doesn't move -- but the server or game-engine treats it as if it could (they can be scripted to 'move'), and by treating it as such needs to constantly calculate and shuffle data .. which would be more noticeable on a network.

But if it's turned Environmental, and the baked walkmesh is given primacy, then walkable and nonwalkable zones become set in stone, plus I believe they reside clientside -- hence pathing on baked walkmeshes, rather than against dynamic placeables, are dealt with much more quickly by a CPU in realtime.


that's a guess tho.


  • rjshae aime ceci

#6
Dann-J

Dann-J
  • Members
  • 3 161 messages

As a general rule I always set placeables to environmental if I have no need to interact with them, they're not something that alters the walkmesh (bridges, balconies, etc), and they don't need to block line-of-sight. It helps to minimise the MOD file sizes, which in turn seems to reduce toolset crashes when trying to open large areas. Plus you can turn off selectability and visibility of them in the toolset, while leaving those settings on for placeables (or vice versa).

 

In outdoor areas, I try to make entire walkmesh triangles non-walkable if I can get away with it (which I usually can). That way I can avoid using walkmesh cutters, which would otherwise subdivide terrain triangles. For indoor tiles, I like to turn snapping on so that my walkmesh cutters match existing walkmesh triangles exactly (again, to avoid unnecessary subdivisions). That seems to make pathfinding a lot less buggy, and avoids entire tiles becoming unwalkable.


  • GCoyote, rjshae et 4760 aiment ceci

#7
rjshae

rjshae
  • Members
  • 4 497 messages

Good info, guys.



#8
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages

Also, the path-finding AI in NWN2 isn't terribly efficient, leaving many creatures just stuck standing when confused with a complicated walkmesh.  I've found it best just to leave most object as EO's without any kind of walkmesh cutter--better to have goblins walk through chairs than linger at the door.


  • GCoyote aime ceci

#9
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

Although on the whole it's usually more beneficial to convert all non-usable placeables (and which don't have scripts on them) to environmental objects, there are some other reasons to leave them as placeables, as long as they're not causing problems.  Placeables serve to block line of sight, and environmental objects don't.  This can affect enemy behaviour, and it also means that the camera in-game may be on the wrong side of a wall, blocking your view, if your wall is an environmental object.

 

Then again, environmental objects may fade to transparent when you don't want them to, if you happen to mouse over something selectable on the other side, revealing something that was supposed to be hidden.

 

Environmental objects and placeables actually have the same fading characteristics which can be controlled in placeables.2da. IIRC if fade is off then as a placeable it will block line of sight (but completely screw with it if your PC ends up inside the placeable) and as an environmental object your camera can clip through it but it won't fade. If it's on then the object will fade regardless of whether it's a placeable or environmental object. I usually go through the 2da and turn off fade unless I've got an area where I really want it.