Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: one way doors  (Read 880 times)

Qjet

  • Bay Watcher
    • View Profile
one way doors
« on: August 14, 2009, 10:17:42 pm »

The name is to commemorate the 3 threads before me who asked for exactly this. (the ones I specifically found)

Additionally:
Quote
Bloat280, ONE-WAY/SECRET DOORS, (Future): These would be nice but raise path-finding optimization issues.
More information:
Yeah, I've considered this before, and it's got a lot of associated difficulties.  The actual algorithm would survive it with some minor changes, but the current "section 1", "section 2" numbers that I use to separate sections of the fortress for optimization wouldn't work any more, unless it kept some kind of table of which ones could go to which ones...  it would take a bit of work.  The sections could probably still be generated quickly, since it would first calculate out the sections treating one-way doors as walls and then just check all the one-way doors and see if they join any of the areas together and enter the direction into the table.  The table also might be quite large, and it needs very very speedy lookup.  All possible, but lots of little issues, and probably more on top of this.
So it would seem this has been considered. However I'm looking at the date, and this was considered in 2006. 3 years ago by I'm wondering if these same pathing problems still exist in the 3D version. I think I understand toady's optimizing system and I can understand where those hiccups come from (sort of)

but been that dwarf fortress is 3 years older, toadyone been 3 years wiser, that this topic might be reconsidered. One way doors would be useful. Moreover I get the feeling that dwarf fortress is ALREADY CAPABLE OF THIS, SIMPLY LACKING FORMAL IMPLEMENTATION

Quote from: Lazureus
This definitely helps traffic flow in my fort. two one-way halls leading to the Trade depot creates a continuous circuit that results in zero collisions.
So says the comment from that movie. So someone using this bug has implemented one way systems before, successfully? He may be lying, he may be exaggerating the circumstances. 

All I'm asking is that in one of the test builds that this be implemented haphazardly and see what the results are. Pathing optimization could very well (read: very likely) be an issue but since it would be an optional feature of the door, it would not break the game.

edit: grammar fail (probably still an truck of violations in there)
« Last Edit: August 14, 2009, 10:20:27 pm by Qjet »
Logged

Qjet

  • Bay Watcher
    • View Profile
Re: one way doors
« Reply #1 on: August 16, 2009, 08:50:09 pm »

err. No one cares about flow control?

ooo k  :-\
Logged

Tlaon

  • Bay Watcher
    • View Profile
Re: one way doors
« Reply #2 on: August 16, 2009, 08:59:24 pm »

Is a one-way door a mechanical thing, like a valve, or a dwarf behavior thing?

Qjet

  • Bay Watcher
    • View Profile
Re: one way doors
« Reply #3 on: August 16, 2009, 09:11:31 pm »

a door that only admits entry from one side. maybe from a specific set of neighboring tiles, maybe from a compass direction N, W, S, or E and the corresponding diagonals?

as a possible example: one way S
###
=D=
XXX <-can only enter from X's

or one way NE
#XX
=DX
#|#

Just a simple little addition to the way doors work. Who says it has to be implemented like this anyway? Maybe players could specify which of the 8 tiles a dwarf can enter from independently? One way doors. Been suggested like 3 years ago, didn't see any discussion about it since.

you know giving this some more thought, Ramps already behave a bit this. You can only enter the down ramp tile from a specific direction (that goes for the up ramp tile too if I'm not mistaken) so it's not like it is breaking any new ground here.
« Last Edit: August 16, 2009, 09:21:01 pm by Qjet »
Logged

Tlaon

  • Bay Watcher
    • View Profile
Re: one way doors
« Reply #4 on: August 16, 2009, 09:19:40 pm »

What I meant was, is it a mode you can turn on in the existing doors?  Like "Admit only traffic from one direction."  Or is it a mechanism that only admits traffic in one direction, like those turntable bar-grid things?

Either way it seems like a small, but useful addition.  I'm just quibbling about specifics.

Qjet

  • Bay Watcher
    • View Profile
Re: one way doors
« Reply #5 on: August 16, 2009, 09:27:24 pm »

well specifics really seems like something for the person who implements it. But hypothetically how would I do it?

I'd throw in an option for installed doors, press the hotkey and the squares next to the door that are passable blink with a green X, then you can move the cursor over them and hit enter turning them into red X and consequently, a no entry point. As toady figures, as the pathing runs up to the door from a no entry point it would consider it impassable.

As to whether or not this is a dwarf thing or a physical thing? Could go either way, I think it would be more like a dwarf thing though, with pets being able to enter from any direction? Because physically preventing it implies that was how it was installed. So swapping it around wouldn't make sense.

Of course that's how I would do it. Lots of ways to do flow control... and I think even a buggy implementation of it might be better then nothing ;)
Logged

Sunken

  • Bay Watcher
  • Wabewalker
    • View Profile
Re: one way doors
« Reply #6 on: August 19, 2009, 02:26:23 pm »

It would probably mess up connectivity information though. It could be worked around but that part of pathfinding would need to be augmented.
Logged
Alpha version? More like elf aversion!

Qjet

  • Bay Watcher
    • View Profile
Re: one way doors
« Reply #7 on: August 19, 2009, 07:24:30 pm »

are you sure about that? Realistic scenarios include locking the fortress, and one way hallways for high traffic. People would have two doors, left and right.

So each room will be accessible. it's just the path they take is different.

Of course it's hard to back up both speculations without a trial run. And it can be done haphazardly without risk of breaking the game and observing the results. 
Logged

Bricks

  • Bay Watcher
  • Because you never need one brick.
    • View Profile
Re: one way doors
« Reply #8 on: August 19, 2009, 08:09:29 pm »

I believe DF uses something similar to this to calculate pathfinding.  The math PhD programming the game probably has a good idea of how complicated properly-implemented one-way doors would work.

And a haphazard implementation probably wouldn't conclude anything.
Logged
EMPATHY - being able to feel other peoples' stuff.