AI pathfinding system

Simple AI system I put together really quickly. There is no real use case for this (yet), and it probably wouldn’t bode well with an actual game.
Sorry for the bad video and recording quality.

How does it work?

This is as simple as I can explain it. First, it creates a bunch of copies of itself, and they all scatter in random directions looking for the best route. All copies that hit walls, go backwards or fail somehow are eliminated. After a few seconds, it selects the square with the best route (in this case, the one closest to the finish line that hasn’t been eliminated), and moves it onto the next test, where it creates copies of itself once again, this time the copy has the “knowledge” of the previous best performing square. Repeat this many times until you reach the end. Then all this information is put together and it creates a path!

What are its limits?

It has limits, such as if it manages to get stuck in a corner, it cannot find its way out because it is punished for going backwards (my fault, might fix later on). It can also jump (don’t have video recorded as of right now), but it’s limited on the Y-axis so it doesn’t jump super high. Another limitation is that spawning too many copies causes intense lag because the information is rapidly being stored in tables, and Roblox doesn’t do so nice with spawning 300 moving parts, therefore “training” it takes longer.

Any suggestions? I am working on a rewrite for this that should help remove some of those limitations I discussed above.

You should try using an actual NPC(rig) instead of a block because that’s when you start to see possible issues, and that’s what matters in most games.

Thanks for the suggestion, I will replace it with a rig.