Algorithm for finding nearest entity
Posted: Thu Apr 28, 2016 12:51 pm
Hi all,
I have been struggling to achieve an efficient algorithm for finding the nearest entity of a certain type to an entity or player in the same surface. I am aware that a function already exists for finding the nearest enemy to a player in the game and that it is quite optimized, I need something equivalent to this. Does anyone have a working algorithm that fits this criteria or could perhaps point me in the right direction? Again, my appologies if this is in the wrong forum.
Kind Regards,
Simcra
I have been struggling to achieve an efficient algorithm for finding the nearest entity of a certain type to an entity or player in the same surface. I am aware that a function already exists for finding the nearest enemy to a player in the game and that it is quite optimized, I need something equivalent to this. Does anyone have a working algorithm that fits this criteria or could perhaps point me in the right direction? Again, my appologies if this is in the wrong forum.
Kind Regards,
Simcra