#size of one table affects speed of pathfinding, despite not being connected

1 messages · Page 1 of 1 (latest)

old grove
#

making a pathfinding thingy [yes, I know, I should just use some already made working pathfinding, sure. but I want to make and understand it myself. so please don't suggest that.]

everythings working fine, except.. the time to generate a path varies based on world size. it shouldn't as far as I can tell, but it does.
the algorithm for getting the path should be DIRECTLY accessing the information from an Array, so no strange loop there that would account for that.
it break;s where it should, to keep from checking any more tiles after it reaches the end tile, etc.

scenario A with a 100x100 world size, it starts the pathfinding, freezes for a few seconds, and continues like normal.
scenario B does the exact same [10x10 size], except it doesn't freeze.
far as I can tell the amount of items added to the lists when the pathfinding happens is always the same going from the same start pos to end pos, regardless of world size.

I'll drop a link to the current code. if anyone knowledgeable in this sort of thing has any time to give it a look over, I'd much appreciate it, thanks.

it's probably a bit messy code right now, because I've been doing a bunch of stuff to it trying to figure out where this problem is happening. thanks in advance to anyone who could give me some advice! edit out

#

posting the code on hastebin 1 sec

dusky timber
#

?

old grove
#

100x100 worldsize vs 10x10 worldsize. same result, different amounts of time.

hazy quiver
#

Have you considered running the profiler in deep mode to see what part of the script takes more time ?

old grove
#

gonna be straight up. I have no idea how to do that.

hazy quiver
old grove
#

found what appeared to be the source of the lag. changed it to fix the lag.
lag is fixed.
Script is broken
oop

#

I'm gonna just sleep on this lol

#

gn