What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Function of PriorityScenes and IgnoreScene

litdeer

New Member
Joined
Apr 13, 2014
Messages
29
Reaction score
0
I saw the sub-tags, PriorityScenes and IgnoreScene within TrinityExploreDungeon sometime. I could not find any instructions how to use them. Anyone knows please give me some detailed guides how to use them.

Code:
<IgnoreScenes>
          <IgnoreScene sceneName="_N_" />
          <IgnoreScene sceneName="_S_" />
          <IgnoreScene sceneName="_E_" />
          <IgnoreScene sceneName="_W_" />
        </IgnoreScenes>


Thanks!
 
Priority scenes:

The bot will move directly to the center of these scenes when the scene is loaded from the game (maybe for a quest, or dungeon exit, or some other event). Not all scenes are visible at all times, but as the bot explores, scenes become visible.

Ignore Scenes:

The Demonbuddy Dungeon Explorer uses a Grid. The boxSize attribute will say how big a "grid square" will be. the boxTolerance attribute will determine whether or not a grid square should be included in the dungeon exploration.

The dungeon explorer uses a custom Traveling Salesman Problem algorithm to determine the best route for exploration. The route is made up of nodes, each node is the best navigable center of a given grid square.

If an ignore scene is defined and a dungeon explorer node happens to be inside the given IgnoreScene, then, Trinity will automatically mark that node as explored and will not travel to the dungeon explore node. This does not prevent Trinity from entering the scene or grid square for things like combat, chests, bosses, etc, but will only prevent the scene from being "explored" by the dungeon explorer.
 
Priority scenes:

The bot will move directly to the center of these scenes when the scene is loaded from the game (maybe for a quest, or dungeon exit, or some other event). Not all scenes are visible at all times, but as the bot explores, scenes become visible.

Ignore Scenes:

The Demonbuddy Dungeon Explorer uses a Grid. The boxSize attribute will say how big a "grid square" will be. the boxTolerance attribute will determine whether or not a grid square should be included in the dungeon exploration.

The dungeon explorer uses a custom Traveling Salesman Problem algorithm to determine the best route for exploration. The route is made up of nodes, each node is the best navigable center of a given grid square.

If an ignore scene is defined and a dungeon explorer node happens to be inside the given IgnoreScene, then, Trinity will automatically mark that node as explored and will not travel to the dungeon explore node. This does not prevent Trinity from entering the scene or grid square for things like combat, chests, bosses, etc, but will only prevent the scene from being "explored" by the dungeon explorer.

Thanks for your detailed explanation, but can you give some more details about sceneName? I cannot find anywhere defined names like sceneName="_N_", sceneName="_W_". I also saw <PriorityScene sceneName="Island" />, where defines the name of 'Island'?

TSP is easy for me to understand but scene names are still confusing to me. If you can give a simple example of above code to explain the behavior, that will easier for me to understand. I guess the bot will only explore 'NW' etc.? :confused: sorry to new to this.
 
Thanks for your detailed explanation, but can you give some more details about sceneName? I cannot find anywhere defined names like sceneName="_N_", sceneName="_W_". I also saw <PriorityScene sceneName="Island" />, where defines the name of 'Island'?

TSP is easy for me to understand but scene names are still confusing to me. If you can give a simple example of above code to explain the behavior, that will easier for me to understand. I guess the bot will only explore 'NW' etc.? :confused: sorry to new to this.

Stop the bot
Take the game window into focus
Press Alt-2

Some info will be dumped - including SceneName.

Also, on Info Dumping tab, there is a "Map Viewer" where it has an option to show Scene (and grid) information. This is the best way to visualize.
 
Stop the bot
Take the game window into focus
Press Alt-2

Some info will be dumped - including SceneName.

Also, on Info Dumping tab, there is a "Map Viewer" where it has an option to show Scene (and grid) information. This is the best way to visualize.

I wanted to close this question, coz I had figured out "Map Viewer" as you said, however, the forum was down.

BTW, I managed to add some code as a workaround for A5 map with portals. But I was too new to understand the whole TSP algorithm. And don't have API reference since the wiki is down either for weeks. If you can give me more instructions, I may be able to completely resolve this issue.

My workaround is very simple: If the central position can not be reached, search and use the closest portal, and then resume the navigator. However, sometime the portal is not used.

Code:
        private bool searchPortal = false;
        private Vector3 portalPosition = Vector3.Zero;
        private List<string> visitedPortals = new List<string>();

        /// <summary>
        /// Handles actual movement to the Priority Scene
        /// </summary>
        private void MoveToPriorityScene()
        {
            Logger.Log(TrinityLogLevel.Info, LogCategory.ProfileTag, "Moving to Priority Scene {0} - {1} Center {2} Distance {3:0}",
                CurrentPriorityScene.Name, CurrentPriorityScene.SceneInfo.SNOId, PrioritySceneTarget, PrioritySceneTarget.Distance2D(myPos));

            if (!searchPortal)
            {
                MoveResult moveResult = PlayerMover.NavigateTo(PrioritySceneTarget);
                if (moveResult == MoveResult.PathGenerationFailed || moveResult == MoveResult.ReachedDestination)
                {
                    Logger.Log(TrinityLogLevel.Info, LogCategory.ProfileTag, "Unable to navigate to Scene {0} - Try looking for the portal.",
                        CurrentPriorityScene.Name, CurrentPriorityScene.SceneInfo.SNOId, PrioritySceneTarget, PrioritySceneTarget.Distance2D(myPos));

                    var portalSwitch = ZetaDia.Actors.GetActorsOfType<DiaObject>(true, false)
                       .Where(o => o.ActorSNO == 328830)
                       .Where(o => o.ActorInfo.GizmoType == GizmoType.Switch)
                       .Where(o => !visitedPortals.Contains(o.Name))
                       .OrderBy(o => o.Distance).FirstOrDefault();

                    if (portalSwitch != null && portalSwitch.IsValid)
                    {
                        Logger.Log(TrinityLogLevel.Info, LogCategory.ProfileTag, "Found portal: {0}. Trying to get through.", portalSwitch.Name);
                        visitedPortals.Add(portalSwitch.Name);
                        portalPosition = portalSwitch.Position;
                        searchPortal = true;
                    }
                }
            }
            else if (portalPosition != Vector3.Zero)
            {
                if (portalPosition.Distance2D(myPos) < 15f)
                {
                    Logger.Log(TrinityLogLevel.Info, LogCategory.ProfileTag, "Reached the portal, distance: {0}", portalPosition.Distance2D(myPos));
                    ZetaDia.Me.UsePower(SNOPower.Axe_Operate_Gizmo, portalPosition);
                    searchPortal = false;
                    portalPosition = Vector3.Zero;
                }
                else
                {
                    MoveResult moveResult = PlayerMover.NavigateTo(portalPosition);
                    Logger.Log(TrinityLogLevel.Info, LogCategory.ProfileTag, "Searching portal, distance: {0}, move res: {1}", portalPosition.Distance2D(myPos), moveResult);

                    if (moveResult == MoveResult.PathGenerationFailed || moveResult == MoveResult.UnstuckAttempt || moveResult == MoveResult.ReachedDestination)
                    {
                        searchPortal = false;
                        portalPosition = Vector3.Zero;
                        PrioritySceneMoveToFinished();
                    }
                }
            }
        }
 
Back
Top