From 63051dda9c438290dce276e75caa5a64d9761e05 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 2 Nov 2015 22:12:41 -0600 Subject: [PATCH] Performance boost (exponential) - Adjusted default idle cast check timers in rules - NPC:NPCToNPCAggroTimerMin 500 (Now 6000) 6 seconds - NPC:NPCToNPCAggroTimerMax 2000 (Now 60000) 60 seconds - Database version 9089 will take care of this update automatically only if you used the default values - The CPU cost of NPC's checking the entire entity list to cast beneficial spells (Heals/Buffs) becomes extremely high when higher NPC count zones exist (Based off of process profiling) - Distance checks for every single NPC to every single other NPC who are casting beneficial spells occur every .5 - 2 seconds unless npc_spells dictates other values, which most of the time it does not - Zones that once fluctuated from 1-8% CPU with no activity (Idle but players present) now idle at .5% based on my testings due to this change in conjunction with the past few performance commits, these are zones that have 600-800 NPC's in them - These values normally are overidden by the spells table (npc_spells), fields (idle_no_sp_recast_min, idle_no_sp_recast_max) --- changelog.txt | 13 +++++++++++++ common/ruletypes.h | 4 ++-- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + ...1_02_ai_idle_no_spell_recast_default_changes.sql | 2 ++ 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 utils/sql/git/required/2015_11_02_ai_idle_no_spell_recast_default_changes.sql diff --git a/changelog.txt b/changelog.txt index 7aa6ee7e1..1b1e9630a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,18 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 11/2/2015 == +Akkadius: Performance boost (exponential) - Adjusted default idle cast check timers in rules + - NPC:NPCToNPCAggroTimerMin 500 (Now 6000) 6 seconds + - NPC:NPCToNPCAggroTimerMax 2000 (Now 60000) 60 seconds + - Database version 9089 will take care of this update automatically only if you used the default values + - The CPU cost of NPC's checking the entire entity list to cast beneficial spells (Heals/Buffs) becomes extremely high when + higher NPC count zones exist (Based off of process profiling) + - Distance checks for every single NPC to every single other NPC who are casting beneficial spells occur every .5 - 2 seconds unless + npc_spells dictates other values, which most of the time it does not + - Zones that once fluctuated from 1-8% CPU with no activity (Idle but players present) now idle at .5% based on my testings due + to this change in conjunction with the past few performance commits, these are zones that have 600-800 NPC's in them + - These values normally are overidden by the spells table (npc_spells), fields (idle_no_sp_recast_min, idle_no_sp_recast_max) + == 11/1/2015 == Akkadius: Made many performance optimizing oriented code changes in the source - Added Rate limit the rate in which signals are processed for NPC's (.5 seconds instead of .01 seconds) diff --git a/common/ruletypes.h b/common/ruletypes.h index 456c9f378..411489ca1 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -347,8 +347,8 @@ RULE_INT(Spells, AI_EngagedDetrimentalChance, 20) // Chance during third AI Cast RULE_INT(Spells, AI_PursueNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while chasing target. (min time in random) RULE_INT(Spells, AI_PursueNoSpellMaxRecast, 2000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random) RULE_INT(Spells, AI_PursueDetrimentalChance, 90) // Chance while chasing target to cast a detrimental spell. -RULE_INT(Spells, AI_IdleNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while idle. (min time in random) -RULE_INT(Spells, AI_IdleNoSpellMaxRecast, 2000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random) +RULE_INT(Spells, AI_IdleNoSpellMinRecast, 6000) // AI spell recast time(MS) check when no spell is cast while idle. (min time in random) +RULE_INT(Spells, AI_IdleNoSpellMaxRecast, 60000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random) RULE_INT(Spells, AI_IdleBeneficialChance, 100) // Chance while idle to do a beneficial spell on self or others. RULE_BOOL(Spells, SHDProcIDOffByOne, true) // pre June 2009 SHD spell procs were off by 1, they stopped doing this in June 2009 (so UF+ spell files need this false) RULE_BOOL(Spells, Jun182014HundredHandsRevamp, false) // this should be true for if you import a spell file newer than June 18, 2014 diff --git a/common/version.h b/common/version.h index 3a3969ec1..4f39b595c 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9088 +#define CURRENT_BINARY_DATABASE_VERSION 9089 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9000 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 2ffc2f452..aa1e46be9 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -342,6 +342,7 @@ 9086|2015_07_02_aa_rework.sql|SHOW TABLES LIKE 'aa_ranks'|empty| 9087|2015_09_25_inventory_snapshots.sql|SHOW TABLES LIKE 'inventory_snapshots'|empty| 9088|2015_11_01_perl_event_export_settings.sql|SHOW TABLES LIKE 'perl_event_export_settings'|empty| +9089|2015_11_02_ai_idle_no_spell_recast_default_changes.sql|SELECT * FROM `rule_values` WHERE `rule_name` LIKE '%Spells:AI_IdleNoSpellMinRecast%' AND `rule_value` = '500'|not_empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2015_11_02_ai_idle_no_spell_recast_default_changes.sql b/utils/sql/git/required/2015_11_02_ai_idle_no_spell_recast_default_changes.sql new file mode 100644 index 000000000..fe09523c7 --- /dev/null +++ b/utils/sql/git/required/2015_11_02_ai_idle_no_spell_recast_default_changes.sql @@ -0,0 +1,2 @@ +UPDATE `rule_values` SET `rule_value` = '6000' WHERE `rule_value` = '500' AND `rule_name` = 'Spells:AI_IdleNoSpellMinRecast'; +UPDATE `rule_values` SET `rule_value` = '60000' WHERE `rule_value` = '2000' AND `rule_name` = 'Spells:AI_IdleNoSpellMaxRecast'; \ No newline at end of file