Return to Unfiction unforum
 a.r.g.b.b 
FAQ FAQ   Search Search 
 
Welcome!
New users, PLEASE read these forum guidelines. New posters, SEARCH before posting and read these rules before posting your killer new campaign. New players may also wish to peruse the ARG Player Tutorial.

All users must abide by the Terms of Service.
Website Restoration Project
This archiving project is a collaboration between Unfiction and Sean Stacey (SpaceBass), Brian Enigma (BrianEnigma), and Laura E. Hall (lehall) with
the Center for Immersive Arts.
Announcements
This is a static snapshot of the
Unfiction forums, as of
July 23, 2017.
This site is intended as an archive to chronicle the history of Alternate Reality Games.
 
The time now is Tue Nov 12, 2024 8:20 pm
All times are UTC - 4 (DST in action)
View posts in this forum since last visit
View unanswered posts in this forum
Calendar
 Forum index » Diversions » Perplex City Puzzle Cards » PXC: Silver Puzzle Cards
Silver #231 Cast Adrift 2
Moderators: AnthraX101, bagsbee, BrianEnigma, cassandra, Giskard, lhall, Mikeyj, myf, poozle, RobMagus, xnbomb
View previous topicView next topic
Page 2 of 7 [100 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
chimera245
Decorated

Joined: 09 Mar 2006
Posts: 209

Hmmm,

I wonder if the program would work better if you considered it to be a ray plane collision type thing.

You could use simple vector calculations to solve it then.

You'd still have the same number of permutations, but you wouldn't have to iterate through ship movements.

Essentially each block is a model in it's own Model Space coordinates. For each combination apply the appropriate Transformations (for the position of the block in the sequence) and Rotations (to apply North). This gives you the arrangement of islands and ships in world space.

Then project rays from the ships positions to see which islands they intersect with. You don't have to 'move' the ships. If the ray doesn't interset with an island - the model is invalid. If all the ships first rays intersect, record the islands, and repeat with next direction. Stop when a ray does not intersect. Rinse Repeat.

The reason why I suggest this approach is there is a whole bunch of accelerated mathematical functions and tricks to do this, and a whole bunch of programmers used to writing this stuff.

This is how graphics are displayed in 3D games. I have a little experience in it myself, but there will be others out there with a lot more . . .

PostPosted: Tue Apr 11, 2006 10:50 pm
 View user's profile Visit poster's website
 Back to top 
UKver2.0
Decorated

Joined: 09 Feb 2006
Posts: 270

Um, will the final layout be in the same pattern as it is in on the card? i.e.
XX
XXXX
XXXX
XXXX
XX

or is it completely up in the air?

XX
XXXX
XXX
XXXX
XXX

or does it have to be square/rectangle?

XXXX
XXXX
XXXX
XXXX

Sorry for the DQ, but I just started looking at this one. Oh and, are we making any assumptions about what end is up? Seeing as the in the original there was no question as to NESW?

PostPosted: Tue Apr 11, 2006 11:16 pm
 View user's profile
 Back to top 
chimera245
Decorated

Joined: 09 Mar 2006
Posts: 209

OK - braindumping here what I mean.

Each square of the puzzle can be considered to be a little area of space, with it's own local coordinates. Let us assume that the two varying coordinates are in the X and Y directions.

We put the origin in the middle of the centre square, and the centres of each of the other squares are 1 unit +/- in the X or Y direction from them.

Looking like this:

-1,1 0,1 1,1
-1,0 0,0 1,0
-1,-1 0,-1 1,-1

Also in these little local areas, there may be a box (an island), centred in one of the box centers, e.g. at 1,1.

So you have 16 little local models arranged like this.

Now for computing the solve. Each combination involves moving these local spaces to a different place in World Space. This involves the application of a Translation Matrix to move it to the appropriate place, and a Rotation Matrix to orient it North.

Apply all these transformations to your set of worlds and you have a transformed set of coordinates for all the islands and the ship's original positions.

The matrices to do these moves BTW can be pre stored so they don't need to be calculated on the fly.

Once you have mapped all the squares to their positions, you start with each ship.

Let us say the North arbitrarily represents going positively in the Y direction. So - if the ship is due to move North, it can be considered to be moving in a Vector of [0,1] from it's position in World Space. You can quickly test to see if that Vector intersects with the transformed coordinates of an island. If it does, transform the coordinate of the ship to the new island (recording what you have done), and repeat for all the other ships. If the Vector does not intersect - then the combination is not valid.

A client could be written that did this fairly quickly. You could leverage built in Matrix functions of graphics languages such as OpenGL for that maths, the Vector collision stuff is much simpler than you usually using because of the simplistic nature of the coordinate systems.

Am I completely off base here?

PostPosted: Wed Apr 12, 2006 4:59 am
 View user's profile Visit poster's website
 Back to top 
SteveC
Unfettered


Joined: 05 May 2005
Posts: 381

Aren't you suggesting storing 16! (permutations) * 12^2 (island/sea positions) + 4 (boat positions) bytes before starting to analyse here?

Or at least 16! * 16 + 4 referencing the cards..?

Or does it not matter if you make them on the fly, if so, is the core of your argument that there are some funky matrix maths tricks you can do to gain speed?

PostPosted: Wed Apr 12, 2006 1:06 pm
 View user's profile
 Back to top 
chimera245
Decorated

Joined: 09 Mar 2006
Posts: 209

What you need to store for this algorithm is:

1) You store 1 transformation for each final position (not combination), i.e. if assume a symetrical 4 x 4 grid you have 16 transformation matrices
2) Assuming you have to rotate to north you have 4 rotational matrices
3) You store the 16 world maps

That store is a trivial amount of information.

Regardless of how you are solving this, you cannot store the 16 * 4 * 16! pieces of information you need to represent the combinations permanently (it is a ridiculous amount of data no matter how you look at it) but you can store where you are at.

If you assume that if each permutation is represented by 16 bytes (1 byte for each map piece representing it's translation/rotation combination) and that the permutations increase in a known sequence you can store a 'bieing done' or 'last done' value which is monotonically increasing as combinations are rejected.

I *think* the advantages of this method are:

A) that the application of the permutations is simply matrix multiplication with standard stored matrices, using functions which have been designed to do this fast (graphics accelerator functions)
B) the testing of the paths is limited to simple ray tracing checks

Can anyone see any flaws in my arguments?

PostPosted: Wed Apr 12, 2006 7:23 pm
 View user's profile Visit poster's website
 Back to top 
Stratman
Veteran

Joined: 03 Feb 2006
Posts: 81
Location: Kettering UK

I can see from the link that Cast Adrift 1 was a 3x3 grid.
Can anyone explain why in this case people seem to be assuming this is to be a 4x4 grid? I just can't see any reason to change it - surely the grid is as laid out on the card?
If you are going to change it...why a 4x4 square? Why not a cross? A pyramid? Whatever shape you can make? If the assumption is based on Cast Adrift 1 being 3x3 - then we have exactly that here - a 3x3 grid but with extra squares added to make it more difficult.
About the only thing from Cast Adrift 1 that seems of real relevance is the fact the north was the obvious direction and none of the tiles were rotated. (Looking at the link thread that appears to be the case...I wasn't there so correct me if I am wrong).
_________________
There Ain't Half Been Some Clever Bastards...Ian Dury and the Blockheads (1978)

PostPosted: Thu Apr 13, 2006 4:35 am
 View user's profile
 Back to top 
SteveC
Unfettered


Joined: 05 May 2005
Posts: 381

Stratman, 4x4 grid because there are 16 "blocks" - that's 4x4.

Square because we're being optimistic.

Smile

PostPosted: Thu Apr 13, 2006 5:18 am
 View user's profile
 Back to top 
xorsyst
Guest


Hmm, this seems tricky

Well, I've managed to code a solver that can run in 88 days on 1 computer (and I've got 24 computers to run it on).

However, using a 4x4 grid gave me 4 answers withing the first 4 hours. So I recoded it to use the arrangement on the card, and that had a similar result.

I didn't get to do the original cast adrift puzzle. Are there any extra restrictions? Like boats not crossing each other, visiting the same island twice, etc?

PostPosted: Thu Apr 13, 2006 7:05 am
 Back to top 
UKver2.0
Decorated

Joined: 09 Feb 2006
Posts: 270

Re: Hmm, this seems tricky

xorsyst wrote:
Are there any extra restrictions?

Did you rotate the squares? Maybe north is always up in relation to the card layout given. It was for the first Cast Adrift. Could you post one of your layouts for us to look at?

PostPosted: Thu Apr 13, 2006 7:21 am
 View user's profile
 Back to top 
xorsyst
Guest


No, I assumed north was always up (just 20,000,000,000 combinations). Allowing rotations would give even more answers Sad

X

PostPosted: Thu Apr 13, 2006 9:11 am
 Back to top 
Curlytek
Veteran


Joined: 30 Jul 2005
Posts: 112
Location: Melbourne, Australia

Re: Hmm, this seems tricky

xorsyst wrote:
Well, I've managed to code a solver that can run in 88 days on 1 computer (and I've got 24 computers to run it on).

However, using a 4x4 grid gave me 4 answers withing the first 4 hours. So I recoded it to use the arrangement on the card, and that had a similar result.

I didn't get to do the original cast adrift puzzle. Are there any extra restrictions? Like boats not crossing each other, visiting the same island twice, etc?


So, are you saying that you have 4 correct answers, where all of the 4 boats hit an island on EACH leg of their journeys without falling off the 4X4 grid?

PostPosted: Thu Apr 13, 2006 10:38 am
 View user's profile
 Back to top 
c1023
Boot

Joined: 21 Oct 2005
Posts: 58
Location: Hampshire, UK

Re: Hmm, this seems tricky

xorsyst:
Have you tried running your solver with the original Cast Adrift puzzle, to check that you only get the two possible answers. (two pieces are interchangable).

I have also written a solver, but it seems to be about an order of magentude slower than xorsyst's

Checking all posibilities for the first Cast Adrift takes about 2 seconds, so doing the same for Cast Adrift 2 will probably take about 3.5 pc years.

The program assumes that:
The tiles form a square.
All tiles face north (up on the card).

The zip contains a windows executable, requiring .Net 1.1, and the C# source code.

Instructions:
Run the .exe
Use the Data menu to select between Cast Adrift 1 & 2 (default)
You can specify which are the first few tiles by entering a comma separated list in the 'starts with' box. (The first tile is Zero, and read left to right, top to bottom on the card)
Click Start

Note: It is not possible to resume, apart from specifying starts with, but it will only check cobination that start with those tiles

Feel free to use the program and code as you like.
CastAdrift.zip
Description  Cast Adrift solver for windows + source code. Requires .Net 1.1
zip

 Download 
Filename  CastAdrift.zip 
Filesize  41.48KB 
Downloaded  183 Time(s) 

PostPosted: Thu Apr 13, 2006 1:28 pm
 View user's profile
 Back to top 
SteveC
Unfettered


Joined: 05 May 2005
Posts: 381

At a guess, xorsyst is running a solver that just looks at the solve ship, not the others...?

To clarify for everyone, the solution is a board where every ship can complete their journey - the answer is the list of islands that one of them visits...

If anyone can help with a small issue I have, I'm trying to work out a way to create all the permutations of {0,1,2,3...12,13,14,15} in such a way that I can predictably know a range to ignore because of the "impossible" locations for each tile (first row, last row, first column etc..)

I can create one that's pretty non-sequential, but that is a bit crap for knowing which to exclude easily (have to search each combo to exclude them). It also seems pretty wasteful as can have to do up to 7 swaps per permutation.

PostPosted: Thu Apr 13, 2006 1:57 pm
 View user's profile
 Back to top 
Gibbet
Veteran


Joined: 07 Aug 2005
Posts: 121

Here for the purposes of completeness is my effort at a solver.

Slower and more random it may be, but it is nice and colourful and provides details about the best solutions as it processes.

Should be able to find solutions close to the solve that might just require swapping a couple of tiles as well.

The best I have achieved after a couple of hours is 2 ships correctly plotted and 34/42 of the required island transisitions accounted for.

However it is a random process at the moment so if anyone does actually fancy letting it run; there is no guarentee it will EVER find the solution.

But you could get lucky and find it before some of the more systematic solvers Smile

If such a miracle occurs, each ship will be x/x, and "Best So Far" will read 42.

Clicking Show/Hide overlays the best map found so far.

If nothing the pretty ships may induce a heightend state of being/(migrane) that will allow you to solve some other cards.
Cast Adrift 2 V2.1.zip
Description 
zip

 Download 
Filename  Cast Adrift 2 V2.1.zip 
Filesize  25.18KB 
Downloaded  214 Time(s) 
_________________
"And I would have got away with it if it wasn't for those pesky cards!"

The OK13DTFC is but one of the things i'm ashamed of being associated with!


PostPosted: Thu Apr 13, 2006 7:12 pm
 View user's profile MSN Messenger
 Back to top 
SteveC
Unfettered


Joined: 05 May 2005
Posts: 381

Check for me?

Hi,

I've run an as yet un-optimised version of my code for a little while (actually 12 hours, then found a bug, so actually 1 hour)...

Two things..

1/ Can someone test to see how good the following board is:

0:4:10:12:8:2:1:11:5:7:3:6:9:13:14:15:

where the numbers are the tiles starting with 0 from the top left on the card, reading left to right, top to bottom down to 15. Making a 4x4 square (optimistically).

I'm currently running at 1/2 million boards per second - That's 1.3 years for the search space. I should improve that by a factor of about four - might be able to hand out a limited number of clients to search individual spaces.

PostPosted: Fri Apr 14, 2006 6:10 am
 View user's profile
 Back to top 
Display posts from previous:   Sort by:   
Page 2 of 7 [100 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
View previous topicView next topic
 Forum index » Diversions » Perplex City Puzzle Cards » PXC: Silver Puzzle Cards
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
You cannot post calendar events in this forum



Powered by phpBB © 2001, 2005 phpBB Group