Thread: feature/monster
View Single Post
Old December 12, 2018, 16:31   #8
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,793
Derakon is on a distinguished road
One of the main reasons why kill_wall takes the same amount of time as moving through empty space is that it makes monster pathfinding considerably easier. Effectively there's two kinds of pathfinding: one that routes around walls, and one that takes a straight-line path to the player (or maybe it routes around permanent walls, I forget). But that latter only works so long as monsters have no preference between going through walls vs. not going through walls. As soon as you change that, you'll see monsters "stupidly" spending large amounts of time trying to take a straight-line path through a wall to get to the player, when they could instead take a shorter path through open air.

It's certainly possible to fix the pathfinding, but it can be surprisingly tricky to make pathfinding that scales well to handling hundreds of monsters on a grid with tens of thousands of cells. It's very easy to accidentally make something that slows even modern computers to a crawl. That said, I believe the authors of Brogue published an article or two on techniques for "smart but simple" pathfinding, which might well be worth stealing for incorporation into Angband.
Derakon is offline   Reply With Quote