Author Topic: Heart Beats and other curiosities~  (Read 312 times)

Legacy_Loathesome Pickle

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Heart Beats and other curiosities~
« on: June 26, 2011, 10:53:19 pm »


               I've been trying to find ways to do something semi-dynamically with a cumulative effect. . . I've been working on a module based on Shadowrun and one of the systems revolves around a security tally whilst hacking (among other things). Now when you raise the tally to a certain level,  you could trigger an alarm which makes all the security countermeasures in the system more aggressive and dangerous to the person (or people) not authorized to be in the system.

 The way I've set up my system's defenses, when the countermeasures are spawned (as in when the level loads), the NPC gets it's health points, stats and stuff like that. What I want to do is set it up so when an alarm is triggered, the NPC's will effectively 'level up' depending on the severity of the alarm. An active alarm will raise their stats and such a couple fold. 

So I guess I was thinking about doing a heartbeat for the NPC but then I hear about how bad they are for server performance and I don't know how another HB might actually be needed at some future point in time. I was thinking, perhaps I'd just do a check to get the alarm status and upgrade the countermeasures and that sort of thing.

 I suppose my question is this; what is the best way for handling something of that nature? Sorry for the relatively newbile question but I'm still learning and such. ':?'
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Heart Beats and other curiosities~
« Reply #1 on: June 26, 2011, 11:41:34 pm »


               You could just start a psuedo hb when the pc starts in on doin the deed, and have it check every 10 secs to determine if an int(indicating the alarm level is upped)  has been raised or lowered. As to leveling up the baddies, it may be better to have multiple blueprints of your npcs at differing levels/equip and you could just despawn one level critter and spawn in the higher level or lower level as needed.

The advantage I see in the psuedo hb is that it will only run when they are engaged in doin that hacking or such. Before or after that you should not even have a call to check to see if there is a hb to run.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Heart Beats and other curiosities~
« Reply #2 on: June 26, 2011, 11:43:53 pm »


               I am sure other will point out better ways.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Heart Beats and other curiosities~
« Reply #3 on: June 27, 2011, 12:16:20 am »


               There was just a fairly lengthy thread debating the merits of heartbeats. So long as this is single player, do what is easiest for you, unless we're talking a huge number of NPCs. A heartbeat each just to check a local var set on the mod, or something of the sort, should not prove too problematic.

If this IS for multiplayer, I would refer you to that thread, which will still be on the first page of this forum. Likely your best bet in that case is some kind of pseudoheartbeat.

Funky
               
               

               
            

Legacy_Loathesome Pickle

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Heart Beats and other curiosities~
« Reply #4 on: June 28, 2011, 12:32:10 am »


               Interesting indeed. I think I found what I needed. Thanks a bunch, Funky '<img'>