Originally posted by alukach
View Post
Originally posted by 猫狗乱舞
View Post
For your pathfinding you need to create a new pathfinding type based on Big, where tiles are still added to LocalOpenListChildTiles even if there is a unit on the tile. Your small units still need to use the regular Big pathfinding type to prevent them from entering one of the spaces of the big unit.
With this in place, both uA, uB and uC should appear in ReachableUnits, provided they are in move range. You should not have to restrict the pathfinding by using "run pathfinding until index found". All that does is to cancel pathfinding when an index is found. If you know beforehand what your target is going to be then using it might save you a tiny bit of processing time, but it has no other benefits.
I just remembered that you need to be aware of one more thing. Normally when you are using big units you want your small units to have a size of 1 and not a size of 0. What this does is to modify the big tile sizes so that big units are not allowed to move onto adjacent tiles where they would overlap the unit. The big size map is not modified when units end their movement if their size is 0. Since you want your big units to move onto the spaces of small units, small units in your special case should have Size set to 0.
Comment