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

Modifying BasicExplorer

Infinite Monkeys

Community Developer
Joined
Jul 7, 2012
Messages
224
Reaction score
16
How do I modify BasicExplorer? I found GridExplorer.cs in the Help folder, which seems to have the actual methods I want to change, but modifying the file does nothing. I want to try to prevent backtracking in linear maps from small unexplored sections, which wastes a huge amount of time on some layouts.
 
No idea how to modify BasicExplorer, but if its in the help folder, that generally means its hardcoded to the bot (ie how the old player mover couldnt be modified easily when it was in help folder). You could send messages to change the values tho for the player mover from another plugin.

As far as not backtracking in linear maps, you can simply set the explore % to something really low, like 10% and it wont backtrack anymore. (Set per map, not globally).
 
If I have the explore % low, and the enemies remaining set to 30 or whatever, will it keep exploring until the enemies are killed then do the boss?
 
For those type of maps (pure linear) i dont use a monster remaining check myself. Dont see a reason to do so. Just a low explore %, and it will complete that check really quickly then just head to the boss, kill, new map. Shouldnt be many mobs left since its a linear map, so no reason to check. And even if it did manage to miss a cubby of mobs, its definitely not worth running back for them vs just doing another map.
 
To answer your question, you write a new IExplorer, and then replace the instances of the "GridExplorer" type with your explorer in the Default code. IExplorer doesn't support easy type switching like PlayerMover or Routines, because there's no reason to change it. It's for one very specific, basic purpose, and if you want it to do anything other than that, you don't need it in the first place, as you'd not be using the explorer related task but rather your own task and explorer instance to run logic instead.

One of the plugins I wanted to make for a while is an explore visualization tool to help people understand what GridExplorer actually does, and why you don't need to modify it or even think about replacing it to solve issues such as backtracking or optimal map grinding. I think it'd be easier to understand that way than me trying to write a massive reply explaining why things don't work the way you think they do.

But, consider this, it's possible to fully explore and clear a map without GridExplorer ever running once to tell the bot where to go. That's the inherent problem with the idea of trying to change GridExplorer to avoid backtracking. Any back tracking issues caused by GridExplorer are unavoidable because inherently to the current design of things:
1. GridExplorer doesn't care about the layout of an area; it's a virtual grid aligned to the tile size of the game.
2. Exploration logic does not drive the bot; it simply gives the bot a new location to go when it has nothing else to do.
3. GridExplorer is a self-propelled design that avoids the significant overhead of trying to pre-process an entire area to determine an exploration path, and works under any situation no matter how complex the terrain is with sub-areas (because it's self-propelled).
4. There's only 1 case where modifying the logic of how GridExplorer finds the next location to explore to would matter when avoiding backtracking, but that case is infeasible: if the area had no monsters, no chests, no items, nothing to interact with, and you literally just wanted to explore the entire map as fast as possible. In that case, you could probably write area-specific logic improvements that would help, but what's the point if this isn't a PoE specific case?

Basically, any time you would try to spend messing with GridExplorer won't lead you to anything meaningful, because it's not the root cause of backtracking. You can write your own exploration task or other bot driving tasks that runs before the bot's GridExplorer task if you think you have an algorithm or way to make map exploration better for certain areas, but you don't need to touch GridExplorer to do that. It is possible to write something better using more terrain data and processing pathfinding data, but it's just not worth it for random terrain and the way this game works. I include the source in the Help folder to try and help people realize why they don't understand how things are setup, and what the bot is actually doing compared to what they think it is doing.

As _Grumpy_ mentioned, tweaking settings is probably the better way to avoid the issues you want, but you'll always have backtracking in a game like this unless you're willing to ignore a lot of objects and write logic that skips most of an area.
 
The specific issue I noticed was that, because of the pathing ordering by distance then by how many unexplored tiles are around/en route to the destination as a fraction of the total, it seems to prioritise running to a completely unexplored area over one where a single map tile is unexplored. That often leaves small side paths unexplored which are then revisited by backtracking. I wanted to modify it to prioritise the opposite, or perhaps make a more complicated change, in the hopes that areas would be more thoroughly explored before progressing. I could be totally misunderstanding GridExplorer though. If not, I guess for testing I could create a plugin that's just a modified GridExplorer and hook it in right before the original?

e: I've also just noticed that it seems to prioritise based on euclidean distance rather than pathing distance, which can cause backtracking with certain layouts. Using pathing distance might be too slow to calculate, but it could be worth a try.
 
Last edited:
Back
Top