Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Ability to specify side to build from/exit to or smarter building  (Read 1337 times)

HandOfCode

  • Bay Watcher
    • View Profile

When a builder (lets take the mason as this is a big problem with them) makes something like a wall it seems they have a preffered side to attempt to build from. (preference order is left, top as far as I have bothered to test/observe)  This gets my builders stuck a LOT.  Could builders start building single tile constructions (no other construction tiles around it) from the direction which they approach it? this way they are guaranteed to have a way back (pending someone didn't build something in the hallway behind them).

A solution for situations when there is more than one tile would be to somehow simulate building the thing to detect which one to build first so as not to trap ones self.

ex.

Wall = X
ground = G (same height as the wall's top)

G
X 1
X 2
X 3
X 4
X 5

builders can only access the top of the wall from G

You have a wall 1 tile wide and you build fortifications on it (the other tiles of the wall aren't built yet, the wall is supposed to be 3 thick).  Currently I'm not sure how the builders decide which fortification brick to build first but it seems they prefer to trap themselves. (the builder will build fortifcation 1 from below sometimes and trap themselves)  it would be ideal if the AI could quickly glance over the fortification build layout and see that it must start from atleast 5 if it wants a way out.

If it has diagonal access to 2 and thus can build one first then it should/could do that.  This isn't a request for super smart building order, just an order so they don't trap themselves.  (maybe even so other dwarves don't trap them, aka a "look ahead" where the AI scans down the tunnel (not physically by walking) and checks to make sure it's not sealing anyone off)

Edit: I'm not sure how this will affect the build system as the wiki says it's LIFO so maybe all build jobs should become singular or again use a "look ahead" to make sure completion of one job won't block access to another job first (in that case switch their order on the stack)
« Last Edit: June 14, 2009, 02:01:17 am by HandOfCode »
Logged

eerr

  • Bay Watcher
    • View Profile
Re: Ability to specify side to build from/exit to or smarter building
« Reply #1 on: June 14, 2009, 03:13:12 am »

Dwarves stand in the direction they come from.

From way too far away.

They need a check at T-2 and T-1 tiles away to figure the correct positions.
Logged

Derakon

  • Bay Watcher
    • View Profile
Re: Ability to specify side to build from/exit to or smarter building
« Reply #2 on: June 14, 2009, 11:29:07 am »

This has been suggested many times in the past. Please use the search. For example, this thread.
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

dragon0421

  • Bay Watcher
    • View Profile
Re: Ability to specify side to build from/exit to or smarter building
« Reply #3 on: June 14, 2009, 04:02:07 pm »

I'd love this to be implemented, but in the mean time there is a work-around for this problem.

Build (but don't construct) a wall just behind the wall you want built. Suspend the unwanted wall's construction. Build the wall you want. Dwarfs don't stand on suspended constructions (usually).
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Ability to specify side to build from/exit to or smarter building
« Reply #4 on: June 15, 2009, 08:02:22 am »

I'd love this to be implemented, but in the mean time there is a work-around for this problem.

Build (but don't construct) a wall just behind the wall you want built. Suspend the unwanted wall's construction. Build the wall you want. Dwarfs don't stand on suspended constructions (usually).

And another useful pointer is the First-In Last-Out job handling order.

(Though sometimes I wish I could manually shuffle some job orders (not just B-C-* ones, either) rather than cancel a whole string of not-quite-in-progress ones in order to add newly possible ones and then re-add the cancelled ones to put them back at the top of the queueueueue[1]...   And I'm sure that's been suggested before, given I recall a suggestion about (re-)rationalising the material assignments after the fact, another thing that a job cancel/re-create cycle is useful to cure...  In short, once you understand the niggles, you work round them and at least pretend you're outsmarting the system. :D)

[1] Spelling it like that because my job queueueueueues always seem to end up far longer than practicable.... :)
Logged

HandOfCode

  • Bay Watcher
    • View Profile
Re: Ability to specify side to build from/exit to or smarter building
« Reply #5 on: June 16, 2009, 01:07:04 pm »

And another useful pointer is the First-In Last-Out job handling order.

Tried that, while one dwarf was building the other dwarf started the wall directly behind him :) hence the "checking to see if you're trapping another dwarf" request :D.

Also builders do NOT build from the direction they approach the site, if this was the case building a single wall (when the stone they are looking for was gathered from a location during transit, aka it was grabbed from the correct side) they would not get trapped like they usually do for me.  (I was building a drainage duct into the chasm so that water that spilled from my trap into my main moat would drain out and I placed a flood gate for OCD aesthetic reasons and the builder trapped himself in the drain)
Logged