Author Topic: HB execution rate with no PCs in area  (Read 344 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
HB execution rate with no PCs in area
« on: October 15, 2012, 01:35:17 am »


                I was playing with my recently debugged Clairaudience spell to see what players could do with it, and ran into a limitation that I do not believe I can get around.

My alternate Clairaudience spell creates a "scry sensor", an invisible creature and AOE. The two of these together send information back to the PC about what the sensor "hears". This is information coming in through various events - listening for speech, creatures moving in and out of "heard" and "inaudible" states, etc.... - and going back to the PC as messages. The nice thing about this spell in Arnheim is that I have also enabled PCs to cast spells at known locations, not just seen locations. So a PC could cast clairaudience and create a scry sensor in another area.

This has a problem. If no other PCs are in the area it appears that NPCs don't do very much. While this is great for efficiency, it doesn't do much for a PC trying to ascertain whether a dragon is guarding a cave in the next area.

So I first thought "no problem" at the top of standard heartbeat and perception scripts is a check for AI level and if it is very low the script exits. I tweaked those to override the exit if at least one scry sensor was in the area. Then I added a SendMessage at the top of the heartbeat to let me know which object was executing a heartbeat.

I entered the game. Creatures spawned in teh area. Every creature in that area was executing a HB regularly. I went to another area, and suddenly these heartbeats became much less frequent. I renentered the area, and they became regular again. My scry sensor was still working as well as it was still albeit rarely) picking up on creature movements.

Has anyone else looked into this? Do you know how often these scripts run when no players are in an area?
               
               

               


                     Modifié par henesua, 15 octobre 2012 - 12:36 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #1 on: October 15, 2012, 01:50:17 am »


               Did you SetAILevel to High or Very high on your creature?
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #2 on: October 15, 2012, 01:51:46 am »


                <loafing...>

Does this help? Er, explain it, I mean :-P
'Image

<...when no one is looking>
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #3 on: October 15, 2012, 01:55:12 am »


               Lightfoot8, I did not. I suppose I could do so for creatures inside the AOE of the Scry Sensor, and then restore it upon exiting.

Rolo - that helps a great deal, thanks.
               
               

               
            

Legacy_Pattycake1

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #4 on: October 15, 2012, 02:53:17 am »


               Why dont you just tie it into the mods HB event? I know that can be dangerous if your not careful but it would be a constant HB.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #5 on: October 15, 2012, 09:01:33 am »


               Setting the AI level of creatures within the radius of the AOE is a much easier approach. More efficient too.
               
               

               
            

Legacy_Pattycake1

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #6 on: October 15, 2012, 09:52:36 am »


               I just made my suggestion because some where in the old forums I remember reading that you want to avoid setting NPC or creature AI to very high because it may cause lag on your server. Especially if you have a lot of active creatures.

LOL its been so long since I've delt with that issue, I've probably got it wrong too.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #7 on: October 15, 2012, 10:25:14 am »


               No, you are correct setting the AI on all creatures to Very High would cause much lag. I'm setting AI to normal when a creature enters the AOE, and to default when they leave it.
               
               

               
            

Legacy_Pattycake1

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #8 on: October 15, 2012, 11:47:40 am »


               Just out of curiosity,  why don't you have the player that cast the spell just possess the invisible creature or would that just give way too much info away to the player?
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #9 on: October 15, 2012, 11:52:39 am »


               That is how I handle scry. This is clairvoyance so all I need is a listener.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #10 on: October 15, 2012, 01:02:55 pm »


               

Just out of curiosity, why don't you have the player that cast the spell just possess the invisible creature or would that just give way too much info away to the player?

Because its not achievable with vanilla nwn, and when done through nwnx - it is unstable.
Possessing npc's other than familiars etc through measures such as nwnx, results in character corruption if they player logs out while possessing, and even then, the character still gets corrupted if ExportCharacter is called. As the npc essentially becomes the new Player Characters Character, overwriting any record of his old character.

At least -I am speaking for win32 players.
If there is a stable possession method out there, by all means - let me/us know.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
HB execution rate with no PCs in area
« Reply #11 on: October 15, 2012, 01:19:11 pm »


               I didn't take PattyCake's mention of possession literally. I figured it was in reference to how Mannast's scry system works: The caster is transformed and relocated to act as the scry point.