A* Pathfinding Project

Astar path script scan isn't detecting my collisions correctly


#21

What I said the brown part shouldn’t be walkable but the orange part should be. That is how I want to set it up. Sorry if i’m confusing you but i am new to this and I guess it’s hard to explain.


#22

Ah.
Well you are using a grid graph and they cannot represent anything smaller than a whole node.
If you want to be able to represent smaller things you need to increase the resolution of it.


#23

What do you mean by increase resolution? The width and depth setting?


#24

Lowering the node size => higher density of nodes.


#25

Ok I’ll try that. Just to make sure. Do you mean the script that contains the grid graph right?


#26

On the grid graph there is a setting for node size.


#27

And the higher density?

Again thanks for all the help you’ve been great!


#28

Lowering the node size means you will get a higher density of nodes.
It’s like increasing the resolution of a pixel image. More resolution means more pixels per area.


#29

Oh ok I think I understand now. If you don’t mind I’ll try a few settings and see if it works afterwards i’ll update the post here. :slight_smile:


#30

Ok i think I’ve got almost the correct settings :
settings : http://prntscr.com/qwwlyp
rendered graph : http://prntscr.com/qwwlox

EPIC! Thank for all the help.


#31

Nice!
Note that a diameter of 0.01 is tiiny. If you just want to check the center of the nodes you can use the Point collider mode instead.


#32

Does it make a difference performance wise because on the rendered graph it looks the same.


#33

I think it might be a bit faster to scan. I have not tested this particular case though.


#34

From what i can see the process took pretty much the same. maybe like 10ms difference

Point : 3672
Circle :3680


#35

One last question. Not quite sure if should start a thread but I can’t seem to find the information of what to do if the ai hit the wall and stopped moving towards the target even tho continue to exact destination is on?


#36

You mean if it is impossible to reach the destination?


#37

Yeah sort of like this : http://prntscr.com/qwyqfz
it just stays there.


#38

Could you post your movement script settings?


#39

Sure : http://prntscr.com/qwyt2i


#40

Hi

Your ‘pick next waypoint distance’ is quite high. I’m wondering if the agent cuts corners a bit too much when trying to follow the path. I would also not recommend a square collider like that on the agent as it is pretty much guaranteed to collide with one of the walls somehow and cause it to get stuck.