28.12.2009, 18:25
Quote:
Originally Posted by Rac3r
Same as getting highest ranked player, you have to loop many times through, whilst excluding the highest rank each time.
Although it's a lot of looping, it's only looping through an array, I wouldn't worry about it. |
why calculate the distance 10 times if you already know it from the first time?
there must be a way with only looping 1 time
the way you would do it:
- Loop trough: 500 players
- 250 closest objects
- loop trough all objects (possibly 10.000)
10.000*250*500 = 1.250.000 times ...
and that more than once/second ??
that is instant CPU death I guess