Or were you annoyed by fact that you need wait long for repaired unit to go back to its commander due to fact it chosen remote repair facility?
If yes, then this topic is for you, if no, then it is also for you.
OK, so the main issue is that current behavior is to go to closest repair center, but closest as straight line between two points, it doesn't take into account that selected one could be in fact worst one to choose due to obstacles like cliffs, rivers, walls, units (enemy or own) etc. It's fine for VTOLs, but not for tanks, especially not hover ones (but maybe that part is addressed somehow). The main (and probably the only one) advantage is for sure speed of finding it.
My proposal (posted on IRC few times already, but I'm not sure if really fresh / original) is to use smarter (but also a bit slower to calculate) way:
- choose 10 closest ones using current algorithm (number could be different or depend on some other variables) or using some other heuristic (ideas?);
- calculate how far they are using path finding algorithm and how long it will take to get there using given propulsion, engine power and weight;
- select fastest path and go.
We should have clean and separated function with following signature (pseudo code):
Code: Select all
Path findPath(Point from, Point to, Droid* droid, float &length, integer &time)
