… how do you know how far to extend the those ends i.e how big will the star be? I
m really confused about how you build the star.
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
pathfinding (3) When you create paths towards the star`s ends
I assume with ‘star’ you mean all visited path segments, starting from the origin of the search?
If so, you simply have to ‘extend’ until the goal has been found. (But i doubt that's the question you meant.)
If you mean the size of the open and closed lists, in a world with dynamic memory allocations, you generally don't even think about it. List containers deal with that problem all by themselves.
Since the lists contain tile positions, and assuming you have at most one state for each tile, an upper limit is the number of tiles in the world. I have seen games that store path-finding data in tiles, ie your open and closed lists get distributed over all tiles. Don't remember the details though, but it's an option.