Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
CommonCrawl, AhrefsBot, Google, DotBot, Bing

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
489
3,798
19,656
609
RoseanneSw

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » Track issue
Forum Rules | Mark all | Recent Posts

Track issue
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 16, 2023 8:31 am   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
in track.c find function find_first_step and make it look like this
int find_first_step( ROOM_INDEX_DATA * src, ROOM_INDEX_DATA * target, int maxdist )
{
   int curr_dir, count;
   EXIT_DATA *pexit;

   if( !src || !target )
   {
      bug( "%s: Illegal value passed to find_first_step (track.c)", __func__ );
      return BFS_ERROR;
   }

   if( src == target )
      return BFS_ALREADY_THERE;

   if( src->area != target->area )
      return BFS_NO_PATH;

   room_enqueue( src );
   MARK( src );

   /*
    * first, enqueue the first steps, saving which direction we're going. 
    */
   for( pexit = src->first_exit; pexit; pexit = pexit->next )
      if( valid_edge( pexit ) && pexit->to_room->area == target->area )
      {
         curr_dir = pexit->vdir;
         MARK( pexit->to_room );
         room_enqueue( pexit->to_room );
         bfs_enqueue( pexit->to_room, curr_dir );
      }

   count = 0;
   while( queue_head )
   {
      if( ++count > maxdist )
      {
         bfs_clear_queue(  );
         clean_room_queue(  );
         return BFS_NO_PATH;
      }
      if( queue_head->room == target )
      {
         curr_dir = queue_head->dir;
         bfs_clear_queue(  );
         clean_room_queue(  );
         return curr_dir;
      }
      else
      {
         for( pexit = queue_head->room->first_exit; pexit; pexit = pexit->next )
            if( valid_edge( pexit ) && pexit->to_room->area == target->area )
            {
               curr_dir = pexit->vdir;
               MARK( pexit->to_room );
               room_enqueue( pexit->to_room );
               bfs_enqueue( pexit->to_room, queue_head->dir );
            }
         bfs_dequeue(  );
      }
   }
   clean_room_queue(  );

   return BFS_NO_PATH;
}


Vladaar noticed that track sometimes would find a path that went out of the area and then would lose the target even if it had a better way that didn't require it to leave the area.

Post is unread #2 Feb 4, 2024 10:24 pm   
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts414
JoinedMar 7, 2005

 
Am I wrong or doesn't this fix then make it so that you can never track someone outside the same area? Isn't it more fun if hunters follow you through portals and the like, to make it harder to escape? :cool:

Post is unread #3 Feb 5, 2024 12:44 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,686
JoinedJan 1, 2002

 
Looks like it to me. It's not something I'd consider a bug in itself. If it's picking a longer path that leaves the area before coming back, then maybe the algorithm itself needs to be tweaked to favor remaining in the area?

Post is unread #4 Feb 10, 2024 7:35 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
well this is the fix to stop it from giving you a longer path because the second you left the area it would turn around and not allow you to track the npc. In most places it doesn't allow tracking outside of the area so it was easiest to skip it taking you out of the area first. Of course everyone can fix it as they see fit. this was the best way to fix it in his case since the other way led straight to the npc where as once he followed the path it took him down he was outside the area and it wouldn't try to track it anymore.

Post is unread #5 Feb 12, 2024 8:01 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
main reason it is a bug is because in every other part of track it checks to make sure you are in the same area already, consider this one that was missed and causing it to act out of fashion for it lol. Now I'm like yall and always figured it would be better to be any area maybe just limit based on amount of rooms but this was probably done to cut down on lag etc....

Pages:<< prev 1 next >>