Should ToME have auto-explore?
Moderator: Moderator
Re: Should ToME have auto-explore?
Hmm, so basic but slow function:
1. Go through all tiles on map. Give each one a distance from player value (straight distance, not A* distance, for ease of coding and speed of calculation).
2. Discard any that are walls, vault floors, doors or in field of view.
3. Bubble sort list by distance from player.
4. Run to square on top of list.
A slightly better function would radiate centrally from the player, and choose the first unexplored tile found, but it's a bit more of a nuisance to code, and potentially slower in some situations.
Since there's no food clock in ToME it doesn't matter if the function is inefficient in choosing destination, as long as it works.
1. Go through all tiles on map. Give each one a distance from player value (straight distance, not A* distance, for ease of coding and speed of calculation).
2. Discard any that are walls, vault floors, doors or in field of view.
3. Bubble sort list by distance from player.
4. Run to square on top of list.
A slightly better function would radiate centrally from the player, and choose the first unexplored tile found, but it's a bit more of a nuisance to code, and potentially slower in some situations.
Since there's no food clock in ToME it doesn't matter if the function is inefficient in choosing destination, as long as it works.
Re: Should ToME have auto-explore?
I think unidentified items should count as unexplored squares for this purpose since otherwise you may run past them.
Re: Should ToME have auto-explore?
The run function already stops on any item. If it's used for auto-explore (which makes sense) then this'll happen too. Shouldn't be too much of a nuisance for already known items.
Re: Should ToME have auto-explore?
Stopping is different from targeting, though. It can be really hard to see items on the ground in the Scintillating Caves, for example, and it's possible you would miss them both on initial exploration and while auto-exploring.
As far as opening doors go, I do think it is best that the player handles that, but then given no other options the algorithm should run to a door that leads to an unexplored area.
As far as opening doors go, I do think it is best that the player handles that, but then given no other options the algorithm should run to a door that leads to an unexplored area.
Sorry about all the parentheses (sometimes I like to clarify things).
Re: Should ToME have auto-explore?
It stops on items you run over them but I do not think that it stops if one only sees a new unidentified object. Which could cause unidentified objects being bypassed if the corridor is wide. So auto-explore could lead to the map being revealed but leaving many unidentifed items on it. Better would be to treat squares with unidentified objects as unexplored so that one runs onto such squares and then stops.Grey wrote:The run function already stops on any item. If it's used for auto-explore (which makes sense) then this'll happen too. Shouldn't be too much of a nuisance for already known items.
Re: Should ToME have auto-explore?
I think this is a fairly minor problem for the attentive gamer, and would cause a lot more work for implementing an auto-explore. I would suggest a simple system be put in first and tweaks like that be added later.
Re: Should ToME have auto-explore?
Indeed, and since I vastly improved the corridor running algorithm, I have an idea what pieces go where and how they work.Grey wrote:Ultimately the implementation shouldn't be that hard, since the path-finding system with interruptions is already in place for running.
I can be a bit more clever than thatGrey wrote:All that's needed is the "find the nearest unexplored square" function. In this respect I think the system should cheat a little to find the nearest unexplored floor square, to prevent it taking you halfway across the map because there's a corner wall tile you didn't fully reveal. Once it finds the square it just implements the run-to function as if you'd clicked on that square on the map or minimap.

Yeah, I was going to treat objects that the player hasn't walked over as unexplored.Mithril wrote:Better would be to treat squares with unidentified objects as unexplored so that one runs onto such squares and then stops
Alright. I wasn't sure how I should handle doors (other than don't open vaultsbricks wrote:As far as opening doors go, I do think it is best that the player handles that, but then given no other options the algorithm should run to a door that leads to an unexplored area.

So, how does the following fallback behavior sound?
(1) If no unexplored tiles or objects, then move to nearest unopened door that is unexplored behind it.
(2) If no where else to explore, then move to next level or exit.
Re: Should ToME have auto-explore?
Sounds great. Of course, on the final level there will be nowhere to go. Maybe just give a message in that case: "Everything explored!" or something similar.tiger_eye wrote: Alright. I wasn't sure how I should handle doors (other than don't open vaults ), so I guess I'll just let the player open the doors. I think the algorithm should also try to avoid traps and water, but if an alternate path isn't found, then still move through the trap or water (the algorithm will stop the first step into water or if you get hurt by the trap).
So, how does the following fallback behavior sound?
(1) If no unexplored tiles or objects, then move to nearest unopened door that is unexplored behind it.
(2) If no where else to explore, then move to next level or exit.
Re: Should ToME have auto-explore?
Auto-move to exit would be handy. And if it treats unided objects the same as unexplored tiles then it'll actually not stop when in sight of them, but instead make a beeline straight for them, which is much better.
Re: Should ToME have auto-explore?
In terms of traps... especially fire traps and the like... it should/could try to dig around them, cause really... I hate it to run walk 3 squares over a fire trap, then continue my run.
Re: Should ToME have auto-explore?
I'd prefer not to dig around traps, they can be used to destroy enemies if you use alternative methods to bypass them or just "suck it up" and trigger them
Re: Should ToME have auto-explore?
During auto-explore? Surely you believe you've killed most enemies during auto-explore? Or is the idea... Press Shift-A... Oh, and enemy... Kill it. Press Shift-A?
Re: Should ToME have auto-explore?
You may be using auto explore to find enemies too, and traps can be used as a tool for dealing with enemies if you have reliable means of bypassing it digging around them is not the best solution when you may wish to use the trap later
Re: Should ToME have auto-explore?
Auto-explore shouldn't auto-path over traps, or if it does, it should interrupt you and tell you that you are taking damage. The feature should be as consistent with running as possible.
Sorry about all the parentheses (sometimes I like to clarify things).
Re: Should ToME have auto-explore?
Or traps could eventually "wear out" by stepping on them too much.