dmazin/asteroid-tycoon

bot pathing

extrajordanary opened this issue · 4 comments

So I played again yesterday and noticed that even when a whole lot of the board is cleared, if you tell a robot to go to a tile that it can't break through it immediately gives up and performs it's default at the very top of this screen. I know this is a known thing and that a better AI pathing (getting to the next closest already cleared tile at least?) might be difficult. But if that can't be done then I think it's important to make it clear to the player somehow why the bots are seeming to disobey.

Adding a "clearer tutorial" issue in 3... 2... 1...

I think this can be solved by changing the behavior a bit: instead of starting the default action immediately, it should instead try to go to either the closest square it can to the target, or the closest cleared square and then start its default action there.

That's the behavior I expect anyhow, and it seems reasonably easy to implement.

Wouldn't that mean potentially doing A* for every tile in the grid (if, say, you're trying to drop a squirrel bot on the bottom of a gnarly asteroid)?

Hmm, good point. I don't think it would have to be A* though—since we don't care about the path itself, we could use some faster method just to see if it's accessible. We could even just keep a frontier of what's accessible to every type of bot as we go along, so we don't have to keep on recalculating it.

However, that is certainly a bit more work than I thought it would be.

You're right - figuring out the frontier of accessible tiles would be really fast.