Unity Assets from Kronnect

Grid Systems (Terrain, 2D, Hexasphere) => Feature Requests => Topic started by: manofspirit on August 15, 2019, 12:46:42 PM

Title: CellGetNeighbours with max number of cells limit to optimize
Post by: manofspirit on August 15, 2019, 12:46:42 PM
Hi there,

First of all, thank you very much for TGS. Even though im using it since last few months but recently looked at all those path finding operations and i got to say im impressed with how many problems you have already solved for users like us and im even more loving it.

Now coming back to the feature request:

CellGetNeighbours has maxDistance which is great so you can get neihbours cells with lets say 5 distance or 10. In my case i need to get those cells which are available in closest range.

But in most cases when user has placed a lot of building then i have to do something like this
GetNeighbours with distance 5, if no cells found or not enough cells found then GetNeighbours with 10 distance and i keep increasing until i find free cells.

So ideally another parameter maxCells will solve this problem. So what i do is call GetNeighours with distance 25 and maxCells 10 so whenever 10 available cells are collected function returns without reaching the whole 25 distance. This way i dont have to do extra traversing.

Thanks
Title: Re: CellGetNeighbours with max number of cells limit to optimize
Post by: Kronnect on August 17, 2019, 10:22:47 AM
A parameter "maxResultsCount" can be added. It doesn't matter if those results are scattered within the range? I mean they could not be adjacent to each other.
Title: Re: CellGetNeighbours with max number of cells limit to optimize
Post by: Kronnect on August 17, 2019, 10:50:51 AM
Added maxResultsCount parameter to one of the CellGetNeighbours overload.
Title: Re: CellGetNeighbours with max number of cells limit to optimize
Post by: manofspirit on August 17, 2019, 12:22:19 PM
Thanks :)