mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Performance] Reworked how client to NPC aggro checks are made
- Before when reverse aggro checks were done (client to NPC), checks would happen every 750 millseconds where a client would check an entire entity list with distance calcs and other checks for aggro, with many clients in a zone and many NPC's this would add a lot of unecessary overhead. A temporary adjustment on 3/25 was made and upped the check to 6 seconds. - Now, there is a new methodology to scanning. The client will build a cache list of NPC's within close range as defined in new rule: RULE_INT(Range, ClientNPCScan, 300) and will also get any NPC that has an aggro range beyond that defined range to use in the frequent checks for aggro, the result is far less overhead - Client scanning changes when moving versus not moving, the client will scan aggro every 500 milliseconds while moving, and 3000 millseconds aggro check when not moving, with a 6000ms re-fetch for close NPC's - A demo of these changes can be found here: https://youtu.be/aGroiwLSTVU
This commit is contained in:
+5
-1
@@ -221,6 +221,9 @@ public:
|
||||
Client(EQStreamInterface * ieqs);
|
||||
~Client();
|
||||
|
||||
std::unordered_map<NPC *, float> close_npcs;
|
||||
bool is_client_moving;
|
||||
|
||||
//abstract virtual function implementations required by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
|
||||
@@ -1458,7 +1461,7 @@ private:
|
||||
Timer forget_timer; // our 2 min everybody forgets you timer
|
||||
Timer autosave_timer;
|
||||
#ifdef REVERSE_AGGRO
|
||||
Timer scanarea_timer;
|
||||
Timer client_scan_npc_aggro_timer;
|
||||
#endif
|
||||
Timer tribute_timer;
|
||||
|
||||
@@ -1477,6 +1480,7 @@ private:
|
||||
Timer helm_toggle_timer;
|
||||
Timer light_update_timer;
|
||||
Timer aggro_meter_timer;
|
||||
Timer npc_close_scan_timer;
|
||||
|
||||
glm::vec3 m_Proximity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user