3.3.5beta : slow graphupdates recastmesh

Hi,

for some reason graph updates with GraphupdateObject dont work reliable with AStar 3.3.5beta anymore.

A call to updategraphs lasts several seconds and in the console there are a lots of warnings like:

“Some meshes where statically batched. These meshes can not be used for nav…”

The bounds for the guo should enclose only one node. Want to change its penalty.

My code works without delays in pre 3.3.5 versions.

Unity 4.2

Regards,

Josef

Hi

This is because

  1. The default option for GraphUpdateObject.updatePhysics is true.
  2. 3.3.5 beta has support for updating a recast graph completely at runtime, not just updating already existing nodes.
  3. GraphUpdateObject.updatePhysics didn’t affect anything previously, now it triggers a complete update.

You should be able to get the previous behaviour by setting myGUO.updatePhysics to false.
However, there is a small bug in the current beta. It will do some processing for updatePhysics=false even though it doesn’t need to.
To avoid that, add
if (!o.updatePhysics) { return; }
To RecastGenerator.cs -> UpdateAreaInit, right at the start of the method.

Basically what the code did was to completely recalculate the recast graph. If you use tiles, only the affected tiles will be updated.

Ok. Great. That made it work again.

Thx.

Will this bugfixes be in the next beta?

Yes, this bugfix will be in the next beta.

Bugfix released in beta 3.3.6