Author Topic: Tracking System  (Read 346 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Tracking System
« on: April 05, 2012, 05:51:32 am »


               I've been using an old tracking system from the vault with a few add ons of my own making, but have for a long time wanted to make a proper tracking system.

What I have so far:
the old tracking system - searches the area for creatures and lets the tracker know roughly in which direction each creature is.
items - every item carries information about the last person who picked it up.
death/dying - every creature which has died or is dying leaves sign of the event.
resting - resting stores information about each creature that used a "camp"
decay for tracks - a delayed decay script which wipes out a track after a period of time depending on weather and environmental affects
target a PC or special NPC for tracking - player can specifically target up to two quarries. when tracking a quarry a PC gains more information from their tracks so that they can positively ID the individual. the quarry is also marked so that they could possibly leave more tracks. BUT I have not yet made much use of this last part.

Ideas for expansion:
(1) NESS spawn points trackable
(2) Creatures leave tracks when they enter certain triggers including seamless area transitions, normal transitions, as well as environmentally oriented triggers (I have triggers for thick vegetation, marshy ground etc...)
(3) Trails: Tracks left on the ground point to Prior track as well as Next track in sequence. this is achieved by saving a pointer on the creature to the last track they left. When they leave a new track, the last track is updated to point to the recent track, and vice versa.
(4) Using AID type commands trackers can follow "trails". 
Tracker may seek origin of trail, or seek the quarry leaving the trail.  Depending on success the tracker will move part way or all the way toward the next track in the trail.

Thoughts? Anyone want to build this and share? I'm not sure when I'll bother with the code, but thought I would share the idea in case I never get around to writing the scripts.
               
               

               


                     Modifié par henesua, 05 avril 2012 - 04:56 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Tracking System
« Reply #1 on: April 06, 2012, 04:47:07 am »


               

henesua wrote...

Thoughts?

Yes, I have a few. 

 Anyone want to build this and share?

Nope, Don't have the time.

Thoughts:   Not fully though out and I am not sure about how much lag it would cause.  

If I where to write a Tracking system,  I think I would add  it to the Creature HB/ module HB for PC's, for the leaving of the tracks.  Well The tracks at that point would be just a waypoint.   The way point would be droped with the orientation the creature is facing to give the direction the tracks should be pointing when panted.   The tag of the waypoint would be the Object ID(ObjectToString) of the creature + a Track number.   Vars placed on the waypoint could include a TimeStamp,   Decay rate,  Track Type, ect...,    As for the delayed commands to clean up the tracks, I would not waste my time with  them.  That could all be handled in the area onEnter/OnExit scripts.   Check the time stamp with there decay time and take the actions required.  Finding the tracks before and after in a current set  would be a simple GetObjectByTag now know to be slightly faster then GetLocalObject.   tracks that where made by encounter creatures would be placed into a data base with a randon percent to be repainted on module load, To give the world a more random living feel.   Persistant creature tracks would be stored into the DB and repainted after module load with the New ID Given to the creature in question in this itteration of the server.      It could take a few resets of the server but sooner or latter the number of Tracks a ranger could fined would start to grow.     

I would also try to come up with a system where the tracks of Non PC/non-transient NPC   only decayed while PC's where in the area.   This would keep the appearance of the area being lived in, even if there had not been a creature painted in the area for days.   

Yes I know that there is a lot there to still work out,   Weather/ Tertain Type/  Feats / Spells / Blood trails for the wonded/ ect....   

Just a few thought on how I tink I would start it.   I can already see a few problems with the the creature Id as the tag for the Waypoints,  The ID will always change after server resets.  Not that big of a problem for NPC's, A big problem for tracking PC's over resets. 

Hope you find this somewhat usefull, 
L8.  
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Tracking System
« Reply #2 on: April 06, 2012, 06:25:03 am »


               Thanks for the comment. Without addressing everything however I want to point out that none of the ideas I have presented require a HB, and I intend to avoid heartbeats entirely. So tracks are only dropped when the PC/NPC enters a trigger, drops an item, picks up an item, dies, is dying, rests... etc.... So I am using the module events, ai events and trigger onenter/onexit.

The only potential lag for this system is in the decay script that runs on the object itself. As those tie up resources until the track is destroyed.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Tracking System
« Reply #3 on: April 06, 2012, 03:40:55 pm »


               Yes, It is the delay scripts that bother me in your system.   They may end up being mote intensive the the HB's,   The only HB's that do not exsist already, In the above sugestion, are the ones for the PCs.  All of the other HB's being used are already in the AI.   The only purpose there is the mark the tracks with as little information as needed.   I do not see an lag from the HB's in the system I gave above.  I see its potential lag problem being in the OnAreaEnter/Exit scripts.  

To each his own though.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Tracking System
« Reply #4 on: April 06, 2012, 09:16:01 pm »


               The idea about tagging with the object ID is interesting. i hadn't considered that. Since I am not using persistent tracks it wouldn't be a problem that the ID changes with each reset.
               
               

               
            

Legacy_Melkior_King

  • Full Member
  • ***
  • Posts: 234
  • Karma: +0/-0
Tracking System
« Reply #5 on: April 08, 2012, 04:18:22 pm »


               Your idea for a tracking system sounds interesting.  Maybe some day I'll program such a system, if I ever have the need for one.  But I have written an ownership tracking system, which is part of what you wanted.

The basic idea is to use one variable to hold the account name and CD key for the first known owner and then a series of variables in a queue to keep track of a number of previous owners (within limits, to prevent long, lag-inducing loops).

The OnAcquire script checks to see that the item was picked up by a non-DM player character and also compares the latest known owner to the person picking up the item.  If it's a non-DM player and not the same as the last owner, the queue is advanced and the new latest owner is recorded.  Any script can read the information.

Making the information "decay" over time (to simulate weather and the environment causing clues about ownership to be worn off) should be possible using a module heartbeat to increment a variable matched to the owner details.  The higher the number, the older the clue until it has to be erased due to being too old (otherwise the number would eventually overflow the limits for an integer).

Anyway, I wish you all the best and hope you'll let us know if or when you do get a tracking system implemented to your satisfaction.
               
               

               


                     Modifié par Melkior_King, 08 avril 2012 - 03:20 .
                     
                  


            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Tracking System
« Reply #6 on: April 08, 2012, 09:02:09 pm »


               I will aver that this can all be done lag free; we've done it already on our PW. This is not an impossible task, but it does take careful planning for the 'hook's to all the other scripts/objects it will touch in game. As always, use as few HBs as you can.

Best wishes.

Be well. Game on.
GM_ODA