From aa25946dc2d6aefb8978fa7990d8d104e1e8d97c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 26 Mar 2017 00:03:51 -0500 Subject: [PATCH] [Performance] Reduced CPU footprint in cases where a client is checking for aggro excessively every 750 millseconds. This has been adjusted to 6 seconds per new rule RULE_INT(Aggro, ClientAggroCheckInterval) - When zones have many players, with many NPC's, this adds up quickly --- changelog.txt | 3 +++ common/features.h | 2 +- common/ruletypes.h | 1 + zone/client.cpp | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index ea457ed67..b2c71a440 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,9 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 03/25/2017 == Akkadius: Reduced CPU footprint in non-combat zones doing constant checks for combat related activities +Akkadius: Reduced CPU footprint in cases where a client is checking for aggro excessively every 750 millseconds. This has + been adjusted to 6 seconds per new rule RULE_INT(Aggro, ClientAggroCheckInterval) + - When zones have many players, with many NPC's, this adds up quickly == 03/12/2017 == Akkadius: diff --git a/common/features.h b/common/features.h index 4140014d8..863004666 100644 --- a/common/features.h +++ b/common/features.h @@ -157,7 +157,7 @@ enum { //timer settings, all in milliseconds AIscanarea_delay = 6000, AIfeignremember_delay = 500, AItarget_check_duration = 500, - AIClientScanarea_delay = 750, //used in REVERSE_AGGRO + // AIClientScanarea_delay = 750, //used in REVERSE_AGGRO AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help AI_check_signal_timer_delay = 500, // How often EVENT_SIGNAL checks are processed ClientProximity_interval = 150, diff --git a/common/ruletypes.h b/common/ruletypes.h index 0bac4d6df..a6653da8e 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -536,6 +536,7 @@ RULE_INT(Aggro, MaxScalingProcAggro, 400) // Set to -1 for no limit. Maxmimum am RULE_INT(Aggro, IntAggroThreshold, 75) // Int <= this will aggro regardless of level difference. RULE_BOOL(Aggro, AllowTickPulling, false) // tick pulling is an exploit in an NPC's call for help fixed sometime in 2006 on live RULE_BOOL(Aggro, UseLevelAggro, true) // Level 18+ and Undead will aggro regardless of level difference. (this will disabled Rule:IntAggroThreshold if set to true) +RULE_INT(Aggro, ClientAggroCheckInterval, 6) // Interval in which clients actually check for aggro - in seconds RULE_CATEGORY_END() RULE_CATEGORY(TaskSystem) diff --git a/zone/client.cpp b/zone/client.cpp index fa683a267..2170d8ba9 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -133,9 +133,9 @@ Client::Client(EQStreamInterface* ieqs) fishing_timer(8000), endupkeep_timer(1000), forget_timer(0), - autosave_timer(RuleI(Character, AutosaveIntervalS)*1000), + autosave_timer(RuleI(Character, AutosaveIntervalS) * 1000), #ifdef REVERSE_AGGRO - scanarea_timer(AIClientScanarea_delay), + scanarea_timer(RuleI(Aggro, ClientAggroCheckInterval) * 1000), #endif tribute_timer(Tribute_duration), proximity_timer(ClientProximity_interval),