Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4

Author Topic: Dwarves planning their pathing before they build  (Read 6850 times)

Nil Eyeglazed

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #30 on: August 12, 2011, 06:03:23 pm »

That's a good point, Starver-- I have intentionally sealed my dwarves off more than once.  Occasionally, yes, just to kill them off, but for other reasons as well-- last-ditch defense against horrors from the deep, miners that I knew could dig their way out again afterward, stuff like that, justifiable reasons.
Logged
He he he.  Yeah, it almost looks done...  alas...  those who are in your teens, hold on until your twenties...  those in your twenties, your thirties...  others, cling to life as you are able...<P>It should be pretty fun though.

Draco18s

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #31 on: August 12, 2011, 06:16:46 pm »


Except that it still adds 1 keypress ("Yes, do that, [ENTER]").

you are misunderstanding me, it would work EXACTALY like a bridge, do you have to designate a side if you just want a retracting bridge? nope, its the default.

Would you have to press a key to set a wall as "no build direction"? nope, its the default, it would literally add no extra keypresses unless you wanted to specify a direction.

Count keypresses:

b-C-w-[enter:location]-[enter:material], done.

b-b-[enter:location]-[enter:direction]-[enter-material], done.

It's the same number, except one thing: the walls are under a sub-group.  By making them "exactly like bridges" you add 1 keypress: "press enter for no direction."

Quote
Quote
This is a Straw Man.  This issue has not come up previously.

Im misunderstanding your point then, as i thought that is what you were getting at.

No.  My point was that for any given "will this construction be blocked by that one" you have to know if there is no longer any possible path to reach the wall.  This requires pathing.

Quote
Quote
Actually, your suggestion is none of these things.  You keep presenting your system in a closed environment and going "see, see?  it works!" and it does, but only in a narrowly defined set of circumstances (constructed walls only being blocked by other constructed walls, and only if you specified a build direction!)

The only reason to ever put something into the hands of the player (especially for something like this) is only if they request it.  I have nothing against being able to view a designated wall and telling it a build direction, what I am against is the game asking (on EVERY designated wall*) what direction to build from.  "Do you want to specify?  No.  Do you want to specify?  No.  Do you want to specify?  No."

Please give me an example that breaks my system. And yes, build direction gets included in it, as that is part of my system.

As to the 'no' spam, ive addressed that, and im not touching your comment on giving a player a decision as that's a subjective topic, I dont like playing games that play themselves, but at the same time, I dont like tedious micromanagement, like when i tried to build a 60x60 labyrinth in an empty field.. that was.. trying on my patience.

Ok.  Here's one:

www
W.w
www


Here's the direction map:

>>v
W v
^<<

Quote
Quote
You haven't actually built a system that's lighter weight than mine, actually.  Mine doesn't require 2 additional bits of map data per construction.  Or a lengthy (relatively speaking) loopthrough check-recheck algorithm.

Here's mine:

Dwarf.pathToDestination.length--;

*How do you handle the case where a planer designates a 10x10 block of walls?  Individually loop through each one and ask the player "What direction for THIS wall?" or do you take one direction for the whole group?

b C w uuuuuuuuu kkkkkkkkk d enter

Build
Construction
Wall
create the 10x10 block
select direction
place

So yes, one direction for the whole group.

That's a less than ideal solution, because it's not guaranteed that the selected direction will be open for all walls:

#####
#www#
.www#
.www#
#www#
#####


direction map:

#####
#<<<#
.<<<#
.<<<#
#<<<#
#####


Note the left most walls: two of them can't be built from that direction.

Quote
Pathing is way more expensive than a limited flood fill, very limited at that to the point is barely a fill, as its only 'filling' tiles that you designated as construction. I really think your mistaken if you believe that ANY pathing algorithm is lighter than a pseudo flood fill that only scans through designated constructions. Either that, or i havent relayed my idea correctly.

AH!  But see, that's my point.  You can't be sure that you need only test the constructions.

Quote
While yes, you can visually display your system in a line, explain the function behind that line and you;ll quickly grasp how expensive a calc pathing is.

I don't have to, because regardless of my method or yours, that pathing function will still be called and be just as expensive for both of us. ;)
Logged

Farmerbob

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #32 on: August 12, 2011, 09:55:05 pm »

  Having worked in construction and heavy industry before, and seen what happens in real life on construction jobs, I can tell you that while the dwarves do it more regularly than real humans, humans make some pretty absurd pathing errors too - sometimes leading to death.

  If you watch your dwarves carefully, every fort has a "center" and dwarves that build in certain directions from that center, will, if they have a choice, always build on a specific side.  I believe that center is normally where the wagon starts.

  In order to control dwarven behavior, I typically build something in the way whan I know a dwarf will try to block themselves in due to their side-preferences.  One of the first things I build in any fort after I get a few immigrants is a few extra doors for use in controlling where dwarves build by building walls & doors then forbid the doors.  Basically creating airlocks for cisterns, trap areas, secure passages, etc.
Logged
How did I miss the existence of this thread?
(Don't attempt to answer that.  Down that path lies ... well I was going to say madness but you all run towards madness as if it was made from chocolate and puppies.  Just forget I said anything.)

Draco18s

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #33 on: August 13, 2011, 01:28:43 am »

  If you watch your dwarves carefully, every fort has a "center" and dwarves that build in certain directions from that center, will, if they have a choice, always build on a specific side.  I believe that center is normally where the wagon starts.

It has jack to do with the wagon.

Quote
Avoiding Entrapment

When building walls to close off portions of caves or mines, masons have a habit of standing on the wrong side and trapping themselves within.  To avoid this happening in the first place, know that masons have a preference on which side of their work target they will stand, in the following priority order:

    west, east, north, south, northwest, southwest, northeast, southeast.

Note that last line.  That priority order is the same for ALL TASKS from mining to building constructions.
Logged

Farmerbob

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #34 on: August 13, 2011, 02:01:53 am »

  If you watch your dwarves carefully, every fort has a "center" and dwarves that build in certain directions from that center, will, if they have a choice, always build on a specific side.  I believe that center is normally where the wagon starts.

It has jack to do with the wagon.

Quote
Avoiding Entrapment

When building walls to close off portions of caves or mines, masons have a habit of standing on the wrong side and trapping themselves within.  To avoid this happening in the first place, know that masons have a preference on which side of their work target they will stand, in the following priority order:

    west, east, north, south, northwest, southwest, northeast, southeast.

Note that last line.  That priority order is the same for ALL TASKS from mining to building constructions.

I'll have to run some tests then, but I've seen my dwarves build on opposite sides of walls that were on opposite sides of the wagons, with no obstructions at all to interfere with their position choice.
Logged
How did I miss the existence of this thread?
(Don't attempt to answer that.  Down that path lies ... well I was going to say madness but you all run towards madness as if it was made from chocolate and puppies.  Just forget I said anything.)

Draco18s

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #35 on: August 13, 2011, 02:44:21 am »

I'll have to run some tests then, but I've seen my dwarves build on opposite sides of walls that were on opposite sides of the wagons, with no obstructions at all to interfere with their position choice.

By all means, go ahead.  And if the wiki is wrong, change it.

I was one of the first (if not the first) people to have noticed and tested the W/N/E/S phenomenon, and it got tested pretty well.
Logged

Maklak

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #36 on: August 13, 2011, 02:52:09 am »

I have another idea, that would:
- be optional
- still force the player to do something when used, but not as annoying as suspending walls one by one
- CPU friendly.

You could put something like similar to high traffic zone, like "stand here when building". When a Dwarf goes to build a wall, he checks all four sides of wall. He will stand on the side of wall with this designation. He will avoid standing on any other designated wall. Otherwise he'll pick a side. If this flag is the same as hight traffic, no additional memory is needed, and you only get a few simple checks. Of course player still has to remember to un-designate high traffic.

Alternatively you could designate a 'do not stand here when building' zone.

Optionally choosing a direction to build from would work as well.
b -> C -> u/m/k/h to resize -> arrows to position -> (optional w/s/a/d/<some_other_key> to choose direction, by default none, so no extra key-presses) -> <enter>
« Last Edit: August 13, 2011, 03:25:11 am by Maklak »
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral

Farmerbob

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #37 on: August 13, 2011, 04:01:16 am »

I'll have to run some tests then, but I've seen my dwarves build on opposite sides of walls that were on opposite sides of the wagons, with no obstructions at all to interfere with their position choice.

By all means, go ahead.  And if the wiki is wrong, change it.

I was one of the first (if not the first) people to have noticed and tested the W/N/E/S phenomenon, and it got tested pretty well.

I can definitely see this pattern during deconstruction, but for construction I'm seeing a LOT of noise.  I'm currently doing some more testing, building underground so there isn't any interference from bushed or trees, etc.

Most definitely, deconstruction uses far more strict/simple code than construction.

Building on stone, underground, with everything being made of uniform stone types (all Dolomite) and all cavern natural walls and floors being of the same type rock.

The source of stone for the walls being to the east of the test chamber.

N/S walls, to the east of the wagon, centered on the wagon, are built mostly from the East side.  But deconstructed exclusively from the west.

The same behavior from the West side walls running N/S, centered on the wagon.  They are built mostly from the East and deconstructed exclusively from the West,

The E/W walls centered on the wagon, are built from the East for the first (Eastmost) segment, then from the North for the rest of their length.  They are deconstructed in the same way, except the Westmost wall section is deconstructed from the west.


I believe what is happening here is that the source of the stone is influencing the direction that the dwarves build from, but when they are deconstructing they do use a strict preference as mentioned above.

Since I nearly always build my main depot immediately under my wagon on embark, and rarely move it much, this explains why I was thinking dwarf construction patterns were based on wagon position.

Why some dwarves will make the extra two steps to build on the opposite side of the N/S walls, I'm not sure.  Perhaps some of the mental stats affect how dwarves choose to build?  Logical/lazy ones will path shorter than creative/absentminded ones, etc?
« Last Edit: August 13, 2011, 05:18:38 am by Farmerbob »
Logged
How did I miss the existence of this thread?
(Don't attempt to answer that.  Down that path lies ... well I was going to say madness but you all run towards madness as if it was made from chocolate and puppies.  Just forget I said anything.)

Draco18s

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #38 on: August 13, 2011, 11:28:58 am »

Is it possible that there was another dwarf in the way?

I'll take a peek myself.

Edit:
Ah ha.

So for construction it appears as if they're already following my proposal (this must have changed fairly recently): they build from the side nearest the stone they picked up (I dug out rock in the east of the cart, they built the walls from the east side, ditto west, south, and north).

Deconstruction is exclusively West (except when unavailable) is because the wall is a solid tile and cannot be pathed to, so the game needs to itterate through pathable tiles to find one the dwarf can standb on and reach.
« Last Edit: August 13, 2011, 11:39:37 am by Draco18s »
Logged

Farmerbob

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #39 on: August 13, 2011, 11:35:37 am »

Not really likely that there were many dwarf collision issues.  I created a noob fort and it's only gotten one wave of immigrants.  It's on my machine at work, I'll put it on the DFFD tonight if it's not too absurdly crazy busy at work.
Logged
How did I miss the existence of this thread?
(Don't attempt to answer that.  Down that path lies ... well I was going to say madness but you all run towards madness as if it was made from chocolate and puppies.  Just forget I said anything.)

Draco18s

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #40 on: August 13, 2011, 11:49:52 am »

AH HA.

I figured it out:


o



#w#
#.#
###


The wall will be built from the north.


o



###
#.#
#w#


This wall will also be built from the north.


###
#.#
#w#



o


This wall is built from the south.

It's all dependent on which side of the wall is nearest the stone with a dirty check: is stone most north?  if yes: build from north.
Logged

Farmerbob

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #41 on: August 13, 2011, 11:56:01 am »

There seems to be some sort of laziness or cleverness factor involved as well though.  Even with rocks coming from the east side of the wall, my dwarves were building on both east and west sides of the wall, with no obstructions.  This seems to indicate that some dwarves path more intelligently than others, somehow?
Logged
How did I miss the existence of this thread?
(Don't attempt to answer that.  Down that path lies ... well I was going to say madness but you all run towards madness as if it was made from chocolate and puppies.  Just forget I said anything.)

Draco18s

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #42 on: August 13, 2011, 12:00:17 pm »

There seems to be some sort of laziness or cleverness factor involved as well though.  Even with rocks coming from the east side of the wall, my dwarves were building on both east and west sides of the wall, with no obstructions.  This seems to indicate that some dwarves path more intelligently than others, somehow?

I doubt it.  Keep testing to see if you can figure out what's causing it.
My fort is about to starve to death, so....
Logged

JasonMel

  • Bay Watcher
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #43 on: August 13, 2011, 12:20:39 pm »

Someone make a good observation that I hadn't considered. There's really two separate "trapping" problems being considered in this thread:

- One, trapping the builder, due to standing on the wrong side of a wall while building it;
- two, trapping unconstructed wall tiles, due to building wall tiles in the wrong order.

My previous suggestion was aimed only at the former problem. I still like it, despite Draco's objections, and I think it would work most of the time if tweaked enough. (If you're in the situation of *trying* to trap a dwarf in an emergency, you should not be relying on the AI to read your mind anyway.)

Here's my suggestion for the second case, avoiding the annoyance of trapping unconstructed "build wall" designations such that construction of some tiles cannot proceed until other tiles are deconstructed:

Each wall tile designated to be built will be surrounded by differing numbers of existing unwalkable tiles, and it's these unwalkable surrounding tiles *already* present which are the real culprit in occasionally blocking part of your construction order. Therefore, within the wall-construction job category as a whole, each build-a-wall tile must carry a construction priority, with hard-to-reach tiles constructed first. This necessarily breaks the last-in-first-out (LIFO) order, which must be abandoned.

Any time a batch of wall tiles is placed, each tile in that batch must be assigned a priority level before any more wall construction jobs can be accpted by dwarves. Thus, individual tiles in the current batch may or may not be higher priority than tiles in previously-designated batches.

How are the priority levels assigned?

We first group each tile according to how many sides were unwalkable when the construction was ordered. Group 0 are walkable on all four sides; Group 1 are up against a wall; Group 2 are in a corner; Group 3 are in an "alcove." Group 3 tiles clearly must have the highest priority, then group 2 tiles, and so on. Within a given priority, the order of construction will not matter; LIFO can be used. The lowest priority of all, call it Group -1, are tiles with two non-walkable tiles on opposite sides. These will be built last, because doing so will seal off a corridor. Within this group, order clearly matters, but deciding on the first to be built is non-trivial.

Here's the kicker, though: Any time any tile's construction is completed, the priorities of all neighboring tiles (if any) must be recalculated, as though those tiles had just been placed.

There are cases which this method will miss, such as any tiles built in the middle of a corridor. But I think these cases are exceptional, and should be handled with care by the player in any case. There are also cases, particularly emergencies, where LIFO order is advantageous. In this system, emergency constructions would have to be handled with mass suspension of existing build orders.

As far as I know, the solutions to both problems can work at the same time, on the same job.
Logged

Sscral

  • Bay Watcher
  • привет
    • View Profile
Re: Dwarves planning their pathing before they build
« Reply #44 on: August 13, 2011, 12:33:58 pm »


Count keypresses:

b-C-w-[enter:location]-[enter:material], done.

b-b-[enter:location]-[enter:direction]-[enter-material], done.

It's the same number, except one thing: the walls are under a sub-group.  By making them "exactly like bridges" you add 1 keypress: "press enter for no direction."

Wouldn't it be 'b-C-w[enter:location / press wadxs etc. for changing direction/don't press anything at all to use current system]-[enter material]'?

Why would it require another menu before material selection? Don't bridges ask for a direction in the same menu that you size/place them with, and still require only one keypress for a retracting bridge?

So, if it just defaulted to no specified direction unless you pressed one of the other keys, it would be the same as bridges requiring two menus, one to place/size/optionally choose direction, the other to pick material.
Logged
A three year old just made an artifact doll from the skull of his dead kitten. I can only assume the mind control lasted past death.
"Look, mommy!  Now I can play with Mister Fluffles forever!"
Pages: 1 2 [3] 4