Graph Update Scene Modifying all in Y

Hi,
I do try to update the nodes tags of a recastgraph via a graph update scene on a 3d cube.
So far it’s been working great, but here’s the problem I’ve been encountering :
The tags are only modified in the box bounds, as expected, but only in X & Z, on Y, the modification seems to be on infinite Y, meaning that if there’s two paths one above an other, they’re both affected by the graph update scene.

Here’s a quick screens, might help if I’m not very clear…(or not ><)

screen bug

I’m using paid version btw.

Yup. Any news ?

Btw, I’ve also seen that GraphUpdateScene Penalty ignores the Y-axis? and tried to see for the recast generator. In the end I assume there’s something to update in the UpdateArea (GraphUpdateObject guo) method of the recast generator, but I’m not quite sure what to do :confused:

Thanks.

Hi

Very true. I should fix that.
Here is a diff of the required changes: http://pastebin.com/gtTQWhDE
Mostly lines 79 to 91, the rest are mostly whitespace and comments.
I think this fix will work, but I have not tested it yet.

I will try to add this to the next release.

mmh missing the variables
allLeft, allRight

  • their conditions which shall be similar to this I suppose :

if (vert.z < r.yMin) allTop++;
if (vert.z > r.yMax) allBottom++;

Also missing variables vert2 & inside
Also node from the line Int3 p = node.GetVertex(v); but it was a misplace }

Hi

The diff is just a diff, it’s not the whole method, only the places that changed.
Here is the whole method: http://pastebin.com/0yJHRDrW

Thx. But, for now, not working really well :confused:
To be sure, I just tested the Example7_Door1, now the character doesn’t even care and try to go trough the door even if closed.

Right, made a typo.
This line

var ymax = ((Int3)bounds.min).y;

should read

var ymax = ((Int3)bounds.max).y;

Hello, unfortunately, there’s still a problem on that. Though I needed time to retest in good conditions : I was confused because I was forgetting to clear scans in order to get tagged graph back to normal before doing new tests. (in graph cached mode…)

So. I’ve just tried the latest beta (3.7.5 pro), the problem is still here :confused:
Though, more specifically, I think It evolved. Now, if the bounding box is between two path, one above an other (so in Y), no any node will be changed so that’s way better than before. BUT, as soon as the bounding box contains one of the paths, boths paths are being tagged even though the one below or the one above doesn’t touch the box.

So we’re still not quite finished on this topic ^^

Thx for your quick answer

Edit : anyNews ?

Sorry for the up but… Anything ?

Sorry, forgot about this thread.
I will look in to it tomorrow (late over here).

No problem, thanks. I guessed that was that with the lots of topics you already have to answer ^^
Looking forward for your ideas :wink:

Meh. Was about to check it out right now, but I have to leave unfortunately. So I will try to check it out tomorrow.

Found the bug (and now added unit tests for it).

In the NavMeshGraph class -> UpdateArea method, there is a section that looks approximately like the code below. Change it to be exactly the code below (previously it was casting to Vector3 which was not correct, that only worked for small y coordinates).

// Check y coordinate
for (int v = 0; v < 3; v++) {
	Int3 p = node.GetVertex(v);
	if (p.y < ymin) allBelow++;
	if (p.y > ymax) allAbove++;
}
1 Like

It’s working like a charm, thanks a lot :relaxed:

1 Like