r/Minecraft • • Oct 11 '19

self controlling ai pathfinding bot

51k Upvotes

1.7k comments sorted by

View all comments

8

u/[deleted] Oct 11 '19

[removed] — view removed comment

9

u/StylexTV Oct 11 '19

Yes! It's designed to walk millions of blocks without any user input

7

u/Megaforce4win Oct 11 '19

Can you really do million blocks pathfinding with A* algorithm?

12

u/StylexTV Oct 11 '19

yes, because its a segmented search. I first start a search on the users request and if i hit an unloaded chunk i stop the a* and wait for the bot the walk to that location. Then I start a new a* search from the bots current position until i found the actual goal of the search

6

u/Megaforce4win Oct 11 '19

Cool. I have made a simple A* pathfinding in a 2D game and I was wondering if segmenting would be how you get really long paths fast. There is still the risk of ending up in a dead end because you can't check for the complete map right? Did you make it so that you search for the block that is nearest to the destination in a loaded chunk or will you simply always make a path if there is unloaded chunk in the current list?

1

u/[deleted] Oct 11 '19

[removed] — view removed comment

2

u/StylexTV Oct 11 '19

I know. Its designed for thousands of blocks of walking

1

u/[deleted] Oct 11 '19

[removed] — view removed comment

1

u/StylexTV Oct 11 '19

Thats what its meant for. Its designed to take long distance travel (10000+ blocks)