Bay 12 Games Forum

Please login or register.

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

Author Topic: Secret Passages: Extremely easy to implemment and SUPER beneficial!  (Read 2961 times)

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #15 on: October 23, 2017, 06:54:45 pm »

What's the difference between a "secret passage" and a door linked to a lever?
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #16 on: October 23, 2017, 07:57:41 pm »

What's the difference between a "secret passage" and a door linked to a lever?
One requires the little used adventurer command to 'search area thoroughly'. The other is an amusing way to drop magma on people. :)
Logged

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #17 on: October 23, 2017, 08:57:59 pm »


Then you have to make NPC's that are smart enough to either go around the wall (dig through it/go over/under it etc) or find the correct lever to open the passage and proceed through, tying into smart enemies taking alternative routes.


Why would you do any of that?

Because enemies never dig into walled-in forts.
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #18 on: October 23, 2017, 10:24:40 pm »

Okay, some extra explanation on pathing and why this is infeasible.

The way DF pathing is optimized, is by splitting the map into a grid of chunks. There are two levels of pathing data -- connections between chunks, and connections within the chunks themselves. Whenever a unit wants to path to a given location, it first looks up its current chunk and the location's chunk and, using the high-level connection data, sees if there is a possible path between those two chunks. It then computes the precise details of its path by looking at the connections within the chunks in its path. Whenever a wall is built, a door is locked, or other such pathing changes are made, the game updates only the in-chunk connections of the given chunk (and perhaps the chunk's connections to adjacent chunks as well, if required), which doesn't affect any pathing that doesn't involve that chunk.

This, however, depends upon an assumption that if one creature can path from A to B, another creature can as well (usually; building destroyers are a whole 'nother story), so the game doesn't have to store multiple sets of pathing data. This assumption breaks down, however, when secret passages are implemented, since whether a given creature can path from A to B may be dependent on whether the creature knows about a secret passage. The game would have to store quite possibly hundreds of different pathing data sets for each creature, at which point it would probably be more efficient to just use basic pathing, which would still be abysmally slow.

This presents a very big problem. I am afraid secret passage won't make it into DF, at least not until Toady comes up with some absolutely genius pathing algorithm for it, which might take a very long time and might not be worth the effort.
« Last Edit: October 23, 2017, 10:26:29 pm by bloop_bleep »
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #19 on: October 23, 2017, 10:32:18 pm »

Nothing's infeasible. Toady already said he doesn't mind destroying the game and remaking it from scratch if that's what it takes (don't think it's that drastic for this idea though). Secret doors are in the dev notes, part of the treasure hunter arc, complete with a note that it requires "path-finding optimization". It may be decades before it gets implemented, but it'll turn up eventually.
Logged

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #20 on: October 23, 2017, 10:39:18 pm »

Nothing's infeasible. Toady already said he doesn't mind destroying the game and remaking it from scratch if that's what it takes (don't think it's that drastic for this idea though). Secret doors are in the dev notes, part of the treasure hunter arc, complete with a note that it requires "path-finding optimization". It may be decades before it gets implemented, but it'll turn up eventually.

Well OK, now you've got me thinking about a possible solution to this...

EDIT: OK, how about every connection between chunks is tied to a logical expression in terms of whether certain secret passages are known. The pathing algorithm would be the same as before, except that now, when the algorithm wants to check whether two chunks are connected, it would evaluate the logical expression by plugging in 1s for all known secret passages and 0s for all unknown secret passages. Still slower than a simple look up, but it could work.
« Last Edit: October 23, 2017, 11:37:46 pm by bloop_bleep »
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #21 on: October 23, 2017, 11:47:17 pm »

That seems like it'd result in standard advice of "don't make secret passages" along with "don't make pet-impassable doors" for FPS sake.

It's an improvement, though. Can maybe use some shortcuts where there's no passages on map (in which cases it returns to current fast implementation).

Five chickens

  • Bay Watcher
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #22 on: November 19, 2019, 10:58:29 pm »

I just built a 'secret' passage leading from the king's bedroom to the corridor leading to the bedrooms of two visiting female nobles.  Coincidence?  I think not!

Seriously, I think secret passages and/or doors are a cool idea.  Or as an alternative, perhaps certain doors could require the use of a key.
« Last Edit: November 19, 2019, 11:00:07 pm by Five chickens »
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Secret Passages: Extremely easy to implemment and SUPER beneficial!
« Reply #23 on: November 19, 2019, 11:26:22 pm »

I just built a 'secret' passage leading from the king's bedroom to the corridor leading to the bedrooms of two visiting female nobles.  Coincidence?  I think not!

Seriously, I think secret passages and/or doors are a cool idea.  Or as an alternative, perhaps certain doors could require the use of a key.
A key would be nice to see. No more "overseer says Lock!" instant locking doors. Would need to fix pet pathing issues first though. It seems like with hidden spider pits in kobold caves, we're a step closer to this than we were previously.

However, I played Adventurer recently and my home site was a reclaimed kobold cave. All the dorfs were happily roaming about their new home, while I kept triggering traps and falling down hidden holes. So, looks like the npc trap detection/triggering was skipped altogether there. So not really any closer to player-made fortress mode secret areas.
Logged
Pages: 1 [2]