Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Slightly smarter channeling  (Read 608 times)

Orborde

  • Escaped Lunatic
    • View Profile
Slightly smarter channeling
« on: July 18, 2008, 02:38:08 am »

I want to be able to simply designate a large rectangular channel area to be dug, and have my dwarves do it without any babysitting.

I think a pretty good solution to this would be easy to implement: For each channel-designated tile, use pathfinding to compute how many tiles it is from the designated tile to a passable non-channel-designated tile. Once you know the distance-to-a-floor of each designated tile, have the dwarves simply mine out the ones with the highest distance first.

This allows you to dig pits with minimal user control in many situations, including where there is only one access tile to the room with the pit in it (the door). You would simply designate, and then your dwarves will figure it out themselves.

You would probably have to rerun the distance-finding every time a new channeling designation is made or modified by the user, but it's a one-time cost, and not a big one.

The distance finding should be easy to implement and minimally taxing, CPU-wise. You could use a sort of flood fill where each tile which touches a floor is set to a distance of 1, and then its non-filled neighbors are set to 2 on the next pass, and so on. If the distance-finding only takes into account north/south/east/west moves, then this algorithm will have the nice side effect of keeping the miners from causing a cavein of isolated sections of designated floor.

This could also be applied to construction of walls/fortifications: the dwarves should build the innermost tiles first. It would also work very well for removing constructed floors.

One thing this will not solve, however, is dwarves being on the wrong side of, say, a moat. However, it would make digging large pits, even multilevel ones, much easier. I would very much like to see this in DF, as it would make digging my gigantic Moria-esque halls much, much easier.
Logged

Joseph Miles

  • Bay Watcher
  • DF isn't a game, its a way of life!
    • View Profile
    • http://bugger92.proboards91.com/
Re: Slightly smarter channeling
« Reply #1 on: July 18, 2008, 03:05:53 am »

I have this problem a lot when mining channels, and it would help new players making towers. Seconded.
Logged
Cog - He's the new Urist.
Yes they are a bunch of drunken unstable retards, but they're MY drunken unstable retards, and I will take care of them.
It could be worse, that cat could be alive.

Hanuman

  • Bay Watcher
    • View Profile
Re: Slightly smarter channeling
« Reply #2 on: July 18, 2008, 04:33:43 am »

I really love this request. Up until recently I didn't really understand how channeling worked exactly but am starting to get the hang of it. It would definitely be nice if channeling worked a little smoother without having to keep an eye on the dwarfs. I find that to be one of my main gripes about how it is implemented at the moment.

SwiftSpear

  • Bay Watcher
    • View Profile
Re: Slightly smarter channeling
« Reply #3 on: July 18, 2008, 06:35:49 am »

I'd like this to apply to other things too... like building floodgates.  Dwarfs CONSTANTLY get themselfs stuck in flood rooms and other assorted stupid acts.  Is it feasible to make the pathfinder compute methods of not getting stuck?  It would only really need to be levied when dwarfs are doing risky tasks (rewalling, channeling, floorbuilding, floodgate building), so in theory it need not massively tax the general pathfinder...  It might also be a good idea if areas where risky work is being done can be set off limits to other dwarfs... although, even if that can be manually done, and the unstuck stuff is done automatically, it would make things ALOT easier then having to manually set hundreds of channel commands each time waiting for some simple task to finish just because the dwarfs are too stupid to figure out that if they did channels in every square around them they can't get out.
Logged
laceholder Signature