The current distance calculation in HEAD uses:
As the comments say, it tends to over-estimate distance by about 1 grid for every 15 grids of actual distance. Is there any good reason not to use a better distance function, for instance:
I have an implementation together. It only requires some minor tweaks to cave.c to work. I'm going to try to do some profiling and see how much slower it is. The only problems I can imagine are:
1. adding more floating-point math to angband
2. signficantly slower calculation
3. people will hate the drastic increase in ranges
Anway, what do you all think?
Code:
max(dx, dy) + min(dx, dy) / 2
Code:
ceil(sqrt(dy ** 2 + dx ** 2))
1. adding more floating-point math to angband
2. signficantly slower calculation
3. people will hate the drastic increase in ranges
Anway, what do you all think?
Comment