Hi everyone. Want to present you another performance optimization patch. Idea is very old, but benefits are huge.
Currently when player stands on map, he stands in map cell too. Length of cell side is 133 yards. Also player has 8 cells around him. So current algorithms for cell object search (for example AOE spells) must look for mobs in 9(!) cells. Lets say, our AOE damage affects only targets in 30 yards radius. So we have a huge save in CPU power because with so small radius we would never need to search all 9 cells, maximum 4 of them
This patch affect alot of places: chat whispering, visibility calculations, AOE target search, mob assistance, area packet sending etc...
P.S. Current cell walk algorithm in CellImpl.h was taken from Trinity 1, I don't know who author is. But next versions will include more generic calculations from mangos dev team, which will work with any cell sizes and radiuses. Have fun
Update #1: Updated cell search algorithm, cell size reduced to 66 yards. Also fixed a crash with fishing...
Update #2: Another improvements to cell search algorithm. Also packet sending improved to scale with visibility distances. New visible distance options included into server config. MAX_NUMBER_OF_CELLS set to 16 <- this is experimental value. Report any problems with it asap.
Update #3: Fixed some compilation issues with GCC. Restored possibility to use 'reload config' command to reinitialize visibility distance for each map w/o need to restart server.
Update #4: Fixed VisitCircle() algorithm. Now it is more precise.
Update #5: Updated cell coord range checking. Patch supports revs 8182+.
Update #6: Updated grid unload algorithm. Added more security checks for grid/cell coords range checking...
Update #7: Fixed a bug with visibility distance in dungeons/BG/Arenas - it was always the same as on continents until you used .reload config command...
Patch 1.14: http://filebeam.com/6cc48d245ee183b5e5df7fca8894f9cd
Patch 1.13[rev 8277+]: http://filebeam.com/0f565f9494b0869942a4ab47fd1e715c
Patch 1.13: http://filebeam.com/d34652aada593787748884a7e26b9972
Patch 1.12: http://filebeam.com/39ba2fc9a850e686fd3a907135397f15
Patch 1.10: http://filebeam.com/2c9fb21627cb9ee7c639fad863223ffd
Patch 1.09: http://filebeam.com/8b637b44f86831d3bca7669735f071c6
Patch 1.08: http://filebeam.com/c47df9de78907324e7346ce804588623
Patch 1.01: http://filebeam.com/a4e5d66735a33db959dbc9d4c8f9cac2
Patch 1.00: http://filebeam.com/e1389b2727e0e021f23d1f4a64e11563