Author Topic: Pathcalling - Can it be improved?  (Read 1093 times)

Legacy_Neverwinter Owl

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Pathcalling - Can it be improved?
« on: June 02, 2016, 08:15:14 am »


               

I've been noticing that pathcalling is crazy CPU intensive. Just one medium sized enemy who gets slightly pushed out of a fight by other enemies, can end up eating crazy amounts of CPU just trying to find his way into the fight. As soon as all enemies can get in the fight, the CPU instantly settles to 0%.


 


Is there something that can be done to minimize this? A way to make an AI "give up" if they can't pathcall within a certain time? I know to keep placeables off the grid lines.


 


Another good question would be, does CPU usage from these pathcalling failures actually cripple the performance of a server? Or is it just one of those "active 100" scenarios, where the CPU is maxed but there's not bottleneck?



               
               

               
            

Legacy_Neverwinter Owl

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Pathcalling - Can it be improved?
« Reply #1 on: June 04, 2016, 06:03:55 pm »


               

I managed to actually solve this issue (!).


 


I made a custom Hak containing nothing but a modified CEP 2.4 appearance.2da, in which I set the Creature Personal Space to 0, and normalized the hit distances and preferred attack distances.


 


Now creatures no longer have to path find around each other at all. They still pathfind with the environment normally, as I haven't changed anything to do with that (haven't had to), but now I can fight 50 dragons (unrealistic) with not a single hitch on the CPU.


 


Even though creature models are capable of overlapping if the player pulls too many, everything still works fine. This occurrence is rare anyways if a player is playing normally, and not intentionally trying to rally every creature on a map.



               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Pathcalling - Can it be improved?
« Reply #2 on: June 04, 2016, 07:22:21 pm »


               

share the 2da please



               
               

               
            

Legacy_Neverwinter Owl

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Pathcalling - Can it be improved?
« Reply #3 on: June 04, 2016, 09:00:09 pm »


               

https://drive.google...iew?usp=sharing


Here you go.


 


Just another reminder for anyone using, it's for CEP 2.4.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Pathcalling - Can it be improved?
« Reply #4 on: June 06, 2016, 11:08:54 pm »


               I did something similar by mistake, giving enemies a cutsceneghost effect. It made fights almost impossible to win, because the entire mob could attack the PC simultaneously. Just saying...
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Pathcalling - Can it be improved?
« Reply #5 on: June 07, 2016, 01:06:44 am »


               

In Thay, we use the cutscene ghost effect, but don't apply it to hostiles. It's applied to all other NPCs (those not of the Hostile faction) in their spawn script - like the nw_c2_default9, and also to all PC in the OnClientEnter.


 


Then, in an NPCs OnPerception event, if they perceive a PC to whom they are hostile, the PC's cutscene ghost effect gets removed. That way combat tactics such as creating choke points at doors to stop a creature/PC from running through another to get to a spellcaster (for example), and they can't bunch up on you like Proleric mentioned. We then have the cutscene ghost effect checked for and re-applied to PCs in the area OnEnter event (so you need an OnEnter script applied for every area in your module), and when respawning or resting.


 


It's not foolproof, but it works pretty well.