coolstuff wrote:
Then, by starting on the starting point, you need only go towards the smallest number, because smaller the number, the closer you are to the goal. In this case, you would take 19, 18, 17, 16, 13, 8, 3, then the goal.
I can see why taking the smallest neighboring number gets you closer to the goal, but it's not obvious to me that taking the smallest number right here always gives you the shortest path overall. (Since you give different unique numbers to squares equally far from the goal, maybe the overall shortest path isn't the one that you found first on your way outward from the goal.) Can you prove this is optimal?
PS That's not to say that I don't appreciate the awesomeness of the project!
PPS If you and AddZero are experts at making things run faster, would you like to take a look at BYOB?
Offline
bharvey wrote:
coolstuff wrote:
Then, by starting on the starting point, you need only go towards the smallest number, because smaller the number, the closer you are to the goal. In this case, you would take 19, 18, 17, 16, 13, 8, 3, then the goal.
I can see why taking the smallest neighboring number gets you closer to the goal, but it's not obvious to me that taking the smallest number right here always gives you the shortest path overall. (Since you give different unique numbers to squares equally far from the goal, maybe the overall shortest path isn't the one that you found first on your way outward from the goal.) Can you prove this is optimal?
I can't prove it, but you'll notice from the project that it works. If you think about it, it works quite well - because you're finding the fastest way from the "you" square to the goal, it works perfectly. It's hard to explain.
And I'm sorry, but I know only how to make Scratch projects work faster.
Offline
This is a REVOLUTIONARY project! Everyone, thou shalt see it! Discover what everyone's raving about:
Keleymeister: "Wow, that works really well!"
Addzero: "This works well, nice work!" "Neat project" "Awesome job!" "Very cool!"
AnnoyingOrange: "This is a fun game! Great job at making everything!"
Paddle2See: "What a wonderfully elegant algorithm and project! Very impressive " "Wow...that's really impressive!" "Lot's of fun! The only way I could confound it was to give it an impossible situation
"
CHEZA69: "This is the work of a genius really awesome project" wow thats really impressive with an impressive script to go with it
Lucario621: "very impressive! It works great!"
imacat: "woah."
Jonathanpb: "That's brilliant, coolstuff!"
Shadow_7283: ":0... This is probably the best pathfinding AI on Scratch. I've made several attempts at a similar AI, but they have never worked even close to as well as this."
RHY3756547: "Wow - this beats lucario's by like, a thousand miles. Great job! Never got stuck in any of the thousands of dead ends I set up.
"
iCode-747: "Amazing!"
Illusionist: "Amazing!"
aweman: "INCREDIBLE! I made a simple maze for it, and it did it INSTANTLY!"
Kewlbeanz: "nice work
"
Frydad: "Geez, this is cooler EVERY SINGLE TIME. I'm just plain impressed…"
Jimothy: "awesome! this gives me a lot of good ideas!"
Offline
My brother, Mathwizz, Made one that is praticly flawless. This is the link http://scratch.mit.edu/projects/MathWizz/803671

Offline
rabbit1131 wrote:
My brother, Mathwizz, Made one that is praticly flawless. This is the link http://scratch.mit.edu/projects/MathWizz/803671
Hey, that's some pretty nice work! I still did manage to get it stuck in a few dead ends, though, which my Pathfinder won't do
Offline
I've updated it so that the loading is even faster than before. I also fixed a few bugs, but also made it so that the 1-sprite-1-scriptness was gone. The script just got too long to work with!
Any suggestions for future updates would be greatly appreciated!
Offline
nerevar wrote:
very cool! what algorithm did you use? A*?
Nah, that's too unreliable for me
I used the example algorithm on the Wikipedia article for pathfinding - I describe it in the first post of this thread.
Do you have any suggestions on how I could make it better or more advanced? I've been thinking of sorts of "detours" but the script is too well established for me to implement that.
Offline
nerevar wrote:
well i'm trying to open in scratch, but the script is so large i can hardly do anything cause scratch is lagging a lot.
Actually, the script was so large I had to split it in two because it kept giving these funky error messages. If there's one thing I hate about Scratch, it's the lag with larger scripts. I can give you an image of it, though, if you'd like.
Offline
nerevar wrote:
that'd be great if you could, not sure how much i can help, but i can try
Well, I'm not looking so much for help with the coding; that shouldn't be a problem. I'm just looking for ideas on what to add to it.
Offline
Idea then, how about difrent levels. So you can go up ramps and down ramp, so you get elevated platforms.
Offline
<say[omg im on scratch fourums( <cool< <=>true )
Offline