Problems setting up Graph Update Scene objects

Hi all,

I’m following the youtube video on the subject, and think i’m copying the workflow but my grid isn’t being affected.

What I’m doing:

  1. I’m creating a new empty GameObject.
  2. Adding a Graph Update Scene Component (I’m getting a warning saying, ‘No points and no collider or renderer attached’).
  3. I’m selecting the move tool and with shift held, i’m drawing out a poly shape.
  4. Settings, MinBoundsHeight = 0 (my game is 2D, so I have a rotation of 270 in the x in my AstarPath script), Apply on Start and Scan are on, Modify Walk is on with Walkability set to off. That’s it. I’m not doing anything runtime with this object.

Hitting Scan on the A* and nothing is being affected. When Play level, character are walking through incorrectly.

Note. If i remove all the points and add a box collider it is working correctly. But I don’t really want to populate my scene with hundreds of box colliders if possible (or is this not a problem from a performance POV).

Any help would be greatly received,
Matt.

I think the issue is with the shape (bounds) being produced not crossing the pathfinding grid; maybe due to the 2D nature of my grid with Z being up instead of Y.

Hi All,

I have the same kind off problem. I’m using a point based grid over the X and Y axes. Z is above and bellow (2D game). It is working super but I’m having problems with the grid updates. In my test level I place obstacles and call the scan funtion. This works normally, but on a large level this takes to long and freezes the game. So I try the following funtion: AstarPath.active.UpdateGraphs(bounds,1); but is does nothinh, I see the rescan after a second, but nothinh changes in the grid. If I call AstarPath.active.Scan(); I see the nodes links getting removed and working normally.

I also tried the graphudatescene script, with bounds and manually drawn with shift, but it does nothing. Also change the walkability options naturally.

I guess it has to do because we are using it in 2D and X-Y space (rotaded on X axes). Default for Unity 2D I think.

Anyone know what I can check? I think I tried all the options :slight_smile: Even converted to a grid based graph but I see the same results, full scan works, but graphupdate does not.

I also tried making the bounds larger to make sure I crossed several nodes. (nodes in 1x1 grid, bounds extended to 20x20).

Thanks!

Wouter

Hello again,

After many hours off fiddeling and testing I see that the graphupdatescene correctly works on gridgraph, so I converted my levels to gridgraphs. Seeing big performance improvements so that even a full scan is usable :slight_smile:

I opted for pointgraph so I only had 100’s off points to calculate, this took like 3000ms. I now have a gridgraph with 10000’s off nodes and it only takes 150ms. Grapgupdatescene is almost instantatious.

So I stop seeking for the problem and use gridgraph now :slight_smile:

Best regards,
Wouter

double post

Hi

Yes, it is possible that the GraphUpdateScene component assumes that everything is roughly in XZ space (not XY). I will look in to it.

@Woutch, in the free version, point graphs use a quadratic scan, so if you have, say 100 points, it will need to do 100*100=10000 operations. In the pro version there are some options you can check to enable optimizations to speed it up a lot.

@aron_granberg if you could look into a XY version of GraphUpdateScene that would be a big help to us 2D’ers. Would it be possible to post the code here?

@fallingbrickwork

Yeah, a lot of people are requesting more 2D features right now, when I implement it I will send it out as an update, I don’t have an ETA for it.