My Second Pathfinding Attempt

Blitz3D Forums/Blitz3D Beginners Area/My Second Pathfinding Attempt

YellBellzDotCom(Posted 2007) [#1]
heres my second pathfinding attempt. My first attempt was ok, with Mindstorms help it was a good little diddy, but when I tried to reuse it, I got lost in the heaps and banks so I had to rewrite the whole thing so I could reunderstand it. It still doesnt use heaps and banks but I am liking the end effect. Its a download due to the checker pattern map.

Heres a download for it, if you can check it out and let me know what you think...
http://hosted.filefront.com/Xyled777/
(Changed to Filefront per Chwagas request...)

Thanks!


mindstorms(Posted 2007) [#2]
It looks like its working good! How is it on large maps (say 1000*1000)?


YellBellzDotCom(Posted 2007) [#3]
Ill make a bigger map and check it out. I think I'll be restricting player movement by keeping the camera low. The lower my camera the less pathfinding thatll be required. Ill check out the bigger map and repost a link.

Thanks for checking it out!


Whats My Face(Posted 2007) [#4]
How come I get a memory access violation when I click too fast?


YellBellzDotCom(Posted 2007) [#5]
I dont think Ive allowed for much path changing in mid stream. You may have to let it complete its path before you click and change it.


Ross C(Posted 2007) [#6]
Is the time in milliseconds?

And could you allow object placement? Just curious how it holds up to my own one :D


chwaga(Posted 2007) [#7]
my security tells me that that site has viruses on it...can you put it on filefront??


YellBellzDotCom(Posted 2007) [#8]
Sure thing Ross and Chwaga, thanks for checking it out!

Ross the time is in millisecs()

OldPFtime = Millisecs()
FindPath()
NewPFTime = Millsecs()

Text 10,20 "Time to find Path: "+(NewPFTime-OldPFTime)



Ross C(Posted 2007) [#9]
Cool stuff :o)

Found an error?



Seems to take an odd path at the end, as indicated by the blue line. Seems very quick though! Well done :o)


YellBellzDotCom(Posted 2007) [#10]
lol, that is strange. Im still working on it trying out different things and seeing where I can improve it. Its a decent start I think. Ill upload the source later on for a download so that people can help out and improve it.


YellBellzDotCom(Posted 2007) [#11]
Ok, heres the new version.
Right click on map to add a wall
Right click on wall to delete it.

I like to refer to the sphere as my little drunk buddy cause hes real easy to confuse, so be gentle with him...

http://hosted.filefront.com/Xyled777/

You can also download the source files. If you improve anything on it, please, please, please share the info. My goal is to try and make the simplist click and move pathfinding that I can.


mindstorms(Posted 2007) [#12]
I would suggest to put in (uh-oh!) binary heaps, it will increase your speed in the finding of new squares to investigate!. I would also recommend, if it is still not fast enough, and the maps are for the most part open, to check every other node, but with special checks for connections between those nodes. This is sort of like a two-tiered system, but not in the true sense of the word. I have successfully done this in other languages, and it increases pathfinding speed across a large area, but remains precise in tight areas. The only potential speed drag is the extra if statements.


YellBellzDotCom(Posted 2007) [#13]
I will definitely take your suggestions to heart. My main goal here was just to get a very basic working pathfinding system that worked 100% of the time. Once its complete, I will be looking at different things to improve it. I still remember your binary heaps from my first attempt and I will surely do my best to implement it once the basic structure is complete.

Thanks again for the input Mindstorms.


mindstorms(Posted 2007) [#14]
Half the stuff I said isn't needed for 90% of games, only for certain styles. Like you said, if you keep the camera low and only need a couple pathfinds per frame, speed is not as much of an issue as getting it to work :)