Advertisement

Solving puzzles

Started by August 22, 2007 05:34 PM
3 comments, last by Insolence 17 years, 3 months ago
In Bioshock there's a puzzle you have to solve to "hack" bots and security cameras, I was wondering if there's already a way to do this that I could google? The puzzle looks like this:

Start -> [  ] [  ] [  ] [  ] [  ] [  ] [  ]
         [  ] [  ] [  ] [  ] [  ] [  ] [  ]
         [  ] [  ] [  ] [  ] [  ] [  ] [  ]
         [  ] [  ] [  ] [  ] [  ] [  ] [  ]
         [  ] [  ] [  ] [  ] [  ] [  ] [  ]
         [  ] [  ] [  ] [  ] [  ] [  ] [  ]
         [  ] [  ] [  ] [  ] [  ] [  ] [  ] <- End
         [  ] [  ] [  ] [  ] [  ] [  ] [  ] 
With each tile holding a specific piece of pipe, the pipes look like this:

-- == horizontal pipe

-/ == right + up pipe

-\ == right + down pipe

|_ == down + right pipe

|  == vertical pipe
A solved puzzle would look like this:

Start -> [-\] [  ] [  ] [  ] [  ] [  ] [  ]
         [| ] [  ] [  ] [  ] [  ] [  ] [  ]
         [| ] [  ] [  ] [  ] [  ] [  ] [  ]
         [| ] [  ] [  ] [  ] [  ] [  ] [  ]
         [|_] [--] [--] [--] [--] [-\] [  ]
         [  ] [  ] [  ] [  ] [  ] [| ] [  ]
         [  ] [  ] [  ] [  ] [  ] [|_] [--] <- End
         [  ] [  ] [  ] [  ] [  ] [  ] [  ] 
There can be empty tiles blocking the way and such, also.
In those particular puzzles you just need to get down and across or up and across. so in the simple case it's just the correct number of horizontal pipes & number of vertical pipes plus a connector or two. there are many solutions to each puzzle because of this.

the other way to get down and across or up and across is using the curved connectors.

So all you need to do is inventory your pipes and form them into down and across components.

Should be a pretty straight forward algorithm for the trivial no blocking points cases. The blocking cases just adjust the order in which you throw your things down.

You won't get it to solve the actual in-game puzzles though without a TON of non-AI work: how do you control the game, see the screen, click the buttons, etc.

-me
Advertisement
Quote: Original post by Palidine
In those particular puzzles you just need to get down and across or up and across. so in the simple case it's just the correct number of horizontal pipes & number of vertical pipes plus a connector or two. there are many solutions to each puzzle because of this.

the other way to get down and across or up and across is using the curved connectors.

So all you need to do is inventory your pipes and form them into down and across components.

Should be a pretty straight forward algorithm for the trivial no blocking points cases. The blocking cases just adjust the order in which you throw your things down.

You won't get it to solve the actual in-game puzzles though without a TON of non-AI work: how do you control the game, see the screen, click the buttons, etc.

-me
Identifying pipes/blocked pipes and moving them is the easy part (or the part I already know how to do).

Thanks for all the advice, but I'm still not sure exactly how to solve a path; just about everything about the pathing is confusing me (I've never done A* or anything either, so that doesn't help :)).
Well you are probably overthinking it.

Start (x,y)End   (x,y)DistanceToGo = End - Start


Now distance to go is the delta X and the delta Y you need to cover

So inventory your pieces. If you have deltaX worth of horizontal pipes and deltaY worth of vertical pipes just lay out all the horizontal pipes end to end, throw in a connector, do all the vertical pipes end to end, throw a connector and you're done.

(I think the connector actually covers both an X and a Y so probably adjust your deltaX and deltaY accordingly)

So that's the "naive" strategy.

Now for obstacles, you just place each piece and then make checks:

place a "vertical or horizontal depending on which mode we're in"check blockedif blocked, replace current piece with down curve.check blockedif blocked replace current piece with up curvecheck blockedif blocked remove previous piece (it needs to be something different)


throw that in a loop with a mode to indicate if you're currently trying to traverse horizontally or vertically and that's probably close to the solution.

That assumes more or less infinite inventory choices.

If you have too few horizontal or vertical pipes you'll need to cover ground by going curve to curve to curve. I haven't seen any puzzles in the game that require that.

I'm also just throwing out stuff off the top of my head. Haven't thought it through too much but it should be a good place to start.

-me
Thank you very much, that makes sense--I'll try that out.

This topic is closed to new replies.

Advertisement