From 2f1b3f48c71b62bfbc8cf5b499be8b8456190789 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 12:24:53 -0600 Subject: *Allow user to choose cell size. If there are many players, or the hardware of server is not good enough, you should comment the line "#define LARGE_CELL" in GridDefines.h otherwise you may experience high CPU usage and high lag. --HG-- branch : trunk --- src/game/GridDefines.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h index 54dd2d02920..6001e366212 100644 --- a/src/game/GridDefines.h +++ b/src/game/GridDefines.h @@ -33,6 +33,17 @@ class GameObject; class Pet; class Player; +//comment the next line if CPU usage is too high +#define LARGE_CELL + +#ifdef LARGE_CELL +#define MAX_NUMBER_OF_CELLS 4 +#define CENTER_GRID_CELL_ID 128 +#else +#define MAX_NUMBER_OF_CELLS 8 +#define CENTER_GRID_CELL_ID 256 +#endif + #define MAX_NUMBER_OF_GRIDS 64 #define SIZE_OF_GRIDS 533.33333f @@ -43,10 +54,8 @@ class Player; #define MIN_GRID_DELAY MINUTE*1000 #define MIN_MAP_UPDATE_DELAY 50 -#define MAX_NUMBER_OF_CELLS 4 #define SIZE_OF_GRID_CELL (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS) -#define CENTER_GRID_CELL_ID 128 #define CENTER_GRID_CELL_OFFSET (SIZE_OF_GRID_CELL/2) #define TOTAL_NUMBER_OF_CELLS_PER_MAP (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS) -- cgit v1.2.3