Rotating Sequencer

One of the things I love doing is programming and occasionally I come across a small programming challenge that takes my fancy. This particular one was initiated from a SLED listserv request for a stack of 8 randomly rotated blocks that could then be individually rotated by a user to line up in a particular sequence. Confirmation was to be given upon the correct sequence being achieved. The outer faces of the blocks would hold textures relating to whatever the context of the sequence would be.  The base sequencer has coloured faces to demonstrate its use. These faces would be changed to white once the textures have been applied.

How It Works   

When rezzed the sequencer appears as a stack of multi-coloured blocks with a small sphere at the top. The blocks have each been given a random rotation relative to the root prim (the sphere) by the on_rez event. If at this stage a user clicks on a block they are IM’d that they must click on the sphere to start. The sphere also has floating text to this affect.

When the sphere is clicked on (by any user other than the owner) the floating text changes to indicate that the sequencer is in use and gives instructions for rotating the blocks and accessing the User Menu. At this point only the user can interact with the sequencer. The user can then click on each block to rotate it counter-clockwise 90 degrees eventually achieving the correct sequence. The user has 10 minutes from first clicking on the sphere to achieve the correct sequence after which the sequencer will time out and reset itself ready for a new user.

When the correct sequence is achieved the floating text will indicate so and an IM will be sent with the same indication. The sphere will also light up. There will be a 10 second delay then the sequencer will reset itself ready for the next user.

When in use the user can click on the sphere to access the User Menu which has two options; Restart and Abandon. Restart resets the blocks with new random rotations and the user can continue to attempt finding the correct sequence. The timer for timing out does not reset. Abandon resets the sequencer for a new user.

The Owner Menu is displayed when the owner of the sequencer clicks on the sphere in start mode. The Owner Menu has six options; Randomise, Setup, Play, Help, GNU GPL and Isa’s Blog. Randomise will apply a random rotation to the blocks (relative to the root prim) and is usually used after the sequencer has been set up. Setup will align all the blocks into the correct sequence to make it easy to apply the appropriate textures and colours for the sequence context. Play will allow the owner to test the sequencer as a user. Help and GNU GPL will load the Sequencer README and the GNU General Public License to Inventory respectively. Isa’s Blog links out to this blog.

Adapting The Sequencer

Any number of blocks can be used in the sequencer; it does not need to be 8. Add or remove blocks by unlinking all prims, adding (by copying current blocks) or removing the required number of blocks, then linking all prims back together ensuring that the sphere is the root prim. The blocks do not need to be stacked one on top of the other. All that is required is when the correct sequence is achieved the rotation of each block matches the rotation of the sphere. This is the test the sequencer makes to find out if the sequence is correct. The sequencer itself can be set at any rotation as the blocks rotate relative to the root prim not the grid. It is suggested that complex arrangements are made with blank blocks, i.e. blocks without the sequencerBlock script in, and once all blocks are aligned with the root prim the scripts are added to the blocks.

A couple of options for the sequencer layout are shown below.

To get a copy of the sequencer or the scripts used to run one, IM Isa Goodman in Second Life or request contact through commenting on this post. The scripts are supplied under the GNU General Public License. You can play with the sequencer at my workshop in Second Life. To achieve the sequence in the test version the blocks must face their green side away from the back wall. This play version has been set up so that it acts as though the user were the owner to enable you to experience both menus.


8 thoughts on “Rotating Sequencer

  1. What a fabulous idea–thanks for sharing! My only suggestion is to develop a way for users not only to rotate the blocks, but to move the blocks themselves around, as well. That would add complexity to the exercise for users, especially if there’s more than one way to create an acceptable sequence/organization, and would engage users in some creative thinking.

  2. Thanks Eric

    And yes I must agree. Adding that next level of complexity would really move it up a gear. Will have to consider a little on the how of that one but will certainly look at tackling it when I have another spot of free time. Busy putting the finishing touches on an air paramedics training simulation at the moment; doing this one for the Occupational and Aviation Medicine Dept of Otago University; but am sure this suggestion will be ruminating in the back of my mind during it.

  3. Adding with Tim’s permission a transcript of our emails; some discussion on the sequencer for all to share in.

    Tim Allen:
    I am wondering if it would also be possible to put all the blocks of the sequencer in a larger square or rectangular shape and then put a texture on to the surface of this larger shape. This way I could put a message or a question for my students onto it and they would have to keep clicking on the boxes until they got them into the correct orientation and could read the message. I teach English as a foreign language and some of my students may appreciate it.

    The sequencer is fully customisable in terms of positioning the blocks so yes this would work well. I have worked in the area of literacy previously and am currently doing some background work for a game based literacy project. A similar idea to yours came to mind when building the sequencer, for use in that project.

    The blocks could be set into the face of the larger rectangle so that just the showing face was seen. The rotation wouldn’t even really be visible when the blocks are clicked. It would just appear as though clicking changes the current word. As the script is customisable the text on the sphere can be adapted to say something like “Click on a word to change it” or somesuch. The User menu likewise. I’d also use one texture for each block and use offsetting so a quarter shows on each face. That way the textures for all faces of the blocks will be in cache from the beginning and you won’t get blurry rezzing happening when a new face is shown.

    Tim Allen:
    If I understand this correctly then you will need to upload a lot of textures. For a 4 X 4 grid of blocks that would be 16 textures to form the answer face and since each block will have 4 such surfaces that could be rotated that will end up being 16 X 4 (or 64) textures to up uploaded and then attached to the correct surfaces? That’s a lot of time spent on one puzzle. You wouldn’t want to change it very often. Is there an easier way to do it?

    It really depends on the way you want the puzzle to run and the clarity of the image required. You could create one image, lessen repeats and offset it on each block so you are basically using sections of the one image for each block’s image. Better in terms of one texture to download for the user, though the clarity requirements will come into play there because the image may need to be large in file size to achieve the clarity you need. But then there’s work in terms of setting up the offsets etc. on the blocks. Though once it’s been done the offsetting of the blocks wouldn’t have to be repeated for a new puzzle because you would have a template for it. A set of blocks all offset to a template type and a Photoshop file (or whatever image editor you use) with guides for dividing the one image into block size. You could automate most of it from the root prim if you do that. But more work again.

    Really for this puzzle type use of the sequencer though I’d almost be inclined to script something different, as in almost a rebuild, as the requirement is not really a sequence in terms of aligning the rotation of a block. Its more specific to changing the image on the face shown to the user, so it would be better to develop it from that point of view and script it all to a change of the image when the block is touched using prim face texture offsets not rotation.

    The first one always takes the time. The sequencer has quite a few hours in it and I was tackling just the code : ) Building the images to more automate production has got a few hours in it too but it does make sense to get around to doing at some stage in the future.

    Tim Allen:
    You are right, I hadn’t realized that you could upload one texture, apply them to the faces and then offset them until you get just the right settings. Then I guess after that you could upload other pictures and not have to worry about resetting the “offsets” (I guess). I will have to think about what you said more carefully and reply later.

    Also you said you enjoy trying to figure out how to make games and puzzles like this. As I said I have been a language teacher for some time and have developed a series of games to get people talking or practicing vocabulary that seem to work pretty well in RL. I have been modifying them for my own purposes and use them fairly often and I have been trying to encourage students to get onto SL to practice their English with the whole global village. Unfortunately I do not know enough about scripting to turn them into SL games. If I wrote up step-by-step instructions on how to play a game or two and where the problems might be in creating a script for them, would you be interested in tackling such a problem? I don’t want to take up too much of your time, but I don’t think there is enough time left in the universe for me to figure it out myself. I am also not sure if it will be very profitable but if it helps students have a little more fun it might be worth it in the end.

  4. With the textures, yes Tim. The blocks would have to be numbered in some way to fully automate it or linked in a specific sequence when the prims are linked together with the root prim. They then have to be positioned in a correct order in the sentence background.

    Re scripting a game or two feel free to post one up here and lets see what can be made of it. Part of the fun of it for me *smiles

  5. Pingback: Rotating Sequencer – OpenSim Version « F/Xual Education Services

  6. Have been trying to get this working in OpenSim, it all works except for the confirmation message. I plan to use this for a learning activity where various types of medical codes are displayed on each cube face. The object is that the learner must align all valid ICD-9 Codes in a row. Do you have the scripts for OpenSim? Would be greatly appreciated.

    • Ric

      I can’t understand why the confirmation message isn’t working but yes I do have an OpenSim version that works. There were a few little bugs that needed sorting after the initial release, especially in the area of defining the rotation (see here) but as far as I have just tested everything now works fine.

      I’m just setting up a vendor on my sim Goodstar on JokaydiaGrid where you can grab the scripts from. I’ll do the same over on my parcel in SL as soon as I’m finished there.


    • Ric

      If you still have problems with the confirmation message after trying the new scripts please let me know. I am happy to come along and test it with you if you wish.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s