08 October 2008

Optimizations

Today I finally finished optimizing something that I always wanted to optimize, namely the system which checks who sees who. The old system was checking if someone moved, then if it did, it will check against everyone one the map. For under 20 or so actors on a map, that was pretty fast, but when there were hundreds, even thousands actors (such as during events or invasions), then things were very slow.
For example, the server would use about 33% of one CPU with 1607 invaded monster in one map.
The new system uses sectors, so the players are only check near the nearby sectors, considerably improving the speed. Right now, with 1607 monsters in one map, the server is using only 7-8% of the CPU, so the speed improvement is ~450%. Of course, that is obvious in extreme cases like this, but it should also work better than the old system in any maps with over 10-15 players.

On a related note, tomorrow we hope to unveil one of the secret features me and Schmurk worked at. I am pretty sure that people will be very, very happy when they will see it :)

2 Comments:

Blogger rogerdv said...

If somebody else would have told me that EL wasnt using some kind of partitioning scheme to optimize neighbor entity search I wouldnt have believed it.
That sounds good, I guess server can now manage more players/NPCs, isnt it?

9/10/08 08:06  
Blogger Radu said...

Well, that is not necessary for games with a lot of maps, the old system was actually pretty fast, and it is slightly faster in amps where there are less than 20 or so players, which is most of the maps.

25/10/08 01:36  

Post a Comment

<< Home