The Combination Lock

last updated: 20-Dec-2002 | introduction | download | method | xml | discussion | back to index

Donate! If you like using this guide, then please help with its development by donation!  You can do so by clicking on the button to the left.  The donation is handled securely via PayPal.  Thank you.

Introduction

The aim of this feature is to create a "lock"... a specific number that the user must enter (via the numerical keypad) to access something on the VCD.  This can be used in a number of settings:

  1. As a method of level saving on a VCD "adventure" game (e.g., converting a "choose your own adventure" type novel onto VCD).
  2. To restrict access to specific material on the VCD (e.g., adult-only content)
  3. The prevent unauthorised copying of the VCD (read the note on this further down).
  4. As an Easter egg on your VCD
  5. the limit is your imagination

With regards to "3", the VCD can still be copied, of course, but without knowledge of the specific code, the "pirate" will have to reauthor the VCD to have it work as intended.  It should be noted though that any <sequence-items> on the VCD can still be accessed on a stand-alone player by turning off the PBC.  Video content under <segment-items> it will not be accessible on a stand-alone player if you disable the PBC.  However, all material (sequence-item or segment-item) can still be accessed via the PC on a CD-ROM drive.

In both cases though, the "authored" structure of the VCD is no longer available.  This means that if the VCD had menus, chapters, etc., this user interactivity (which is the cool part of a VCD) will not be available to those without the "key".

CUE/BIN image example of the Combination Lock
There is a PAL and an NTSC CUE/BIN disc image of this project.  If you burn the image onto a CD disc and place it in a stand-alone VCD player (or a VCD compatible DVD player), you will see how this works.  For a guide on how to burn CUE/BIN images, click here.

Select NTSC (637 KB) if you live in North America or Japan
Select PAL (665 KB) if you live in Europe, Asia, Australia or New Zealand

 

The Method

The logic behind this is relatively simple.  Figure 1 shows a schematic of how it can work.  The schematic uses diagrams that I described in the simple menu article.  Furthermore, you need an understanding of how <selection> works.

combination_lock1.png (22932 bytes)
  • If you press the correct key three times (that is 1, 1 and 1), then you reach a screen that states "Correct" and pressing "next" will bring you to the rest of the VCD
  • If you press the incorrect key at any stage (numbers 2 to 9), then you are moved into the "incorrect" line of <selection>.  Once you have made one incorrect answer, it is irrelevant what your further responses are.  You will eventually (after the third response has been made) reach the "Incorrect" screen.  Pressing "next" on this screen restarts the whole process.

A few source screens will have to be made with an image editor (e.g., Jasc's Paint Shop Pro) and then encoded into mpeg still images.

 

XML example

This XML sample will have the mpeg stills images as named:

VCDs must have at least one video track, so a blank mpeg of four seconds long (minimum length) will be added to the project (but unreferenced in the PBC).

Pressing "next" once you have entered the correct number will lead to the VCD to end rather than lead to any other content in this example.

The CD-i application is also included.

The key for this example is: 2 7 5

<?xml version="1.0"?>
<!DOCTYPE videocd PUBLIC "-//GNU//DTD VideoCD//EN" "http://www.gnu.org/software/vcdimager/videocd.dtd">

<videocd xmlns="http://www.gnu.org/software/vcdimager/1.0/" class="vcd" version="2.0">

  <info>
    <album-id>COMBO_LOCK</album-id>
    <volume-count>1</volume-count>
    <volume-number>1</volume-number>
    <restriction>0</restriction>
  </info>

  <pvd>
    <volume-id>COMBO_LOCK_EXAMPLE</volume-id>
    <system-id>CD-RTOS CD-BRIDGE</system-id>
    <application-id>CDI/CDI_VCD.APP;1</application-id>
    <preparer-id/>
    <publisher-id>MICHAEL TAM - VITUALIS PRODUCTIONS</publisher-id>
  </pvd>

  <filesystem>
    <folder>
      <name>CDI</name>
      <file src="cdi_imag.rtf" format="mixed">
        <name>CDI_IMAG.RTF</name>
      </file>
      <file src="cdi_text.fnt">
        <name>CDI_TEXT.FNT</name>
      </file>
      <file src="cdi_vcd.app">
        <name>CDI_VCD.APP</name>
      </file>
    </folder>
  </filesystem>

  <segment-items>
    <segment-item src="screen1.mpg" id="seg-screen1"/>
    <segment-item src="screen2.mpg" id="seg-screen2"/>
    <segment-item src="screen3.mpg" id="seg-screen3"/>
    <segment-item src="correct.mpg" id="seg-correct"/>
    <segment-item src="incorrect.mpg" id="seg-incorrect"/>
  </segment-items>

  <sequence-items>
    <sequence-item src="blank.mpg" id="seq-blank"/>
  </sequence-items>

<pbc>
    <selection id="select-screen1">
      <bsn>1</bsn>
      <wait>-1</wait>
      <loop jump-timing="immediate">1</loop>
      <play-item ref="seg-screen1"/>
      <select ref="select-screen2_wrong"/>
      <select ref="select-screen2"/>         <!-- #2 is correct -->
      <select ref="select-screen2_wrong"/>
      <select ref="select-screen2_wrong"/>
      <select ref="select-screen2_wrong"/>
      <select ref="select-screen2_wrong"/>
      <select ref="select-screen2_wrong"/>
      <select ref="select-screen2_wrong"/>
      <select ref="select-screen2_wrong"/>
    </selection>

    <selection id="select-screen2">
      <bsn>1</bsn>
      <wait>-1</wait>
      <loop jump-timing="immediate">1</loop>
      <play-item ref="seg-screen2"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3"/>         <!-- #7 is correct -->
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
    </selection>

    <selection id="select-screen3">
      <bsn>1</bsn>
      <wait>-1</wait>
      <loop jump-timing="immediate">1</loop>
      <play-item ref="seg-screen3"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-correct"/>         <!-- #5 is correct -->
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
    </selection>

    <selection id="select-screen2_wrong">
      <bsn>1</bsn>
      <wait>-1</wait>
      <loop jump-timing="immediate">1</loop>
      <play-item ref="seg-screen2"/>         <!-- the same screen is used so that -->
      <select ref="select-screen3_wrong"/>   <!-- the user doesn't know that they've -->
      <select ref="select-screen3_wrong"/>   <!-- entered the wrong key -->
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
      <select ref="select-screen3_wrong"/>
    </selection>

    <selection id="select-screen3_wrong">
      <bsn>1</bsn>
      <wait>-1</wait>
      <loop jump-timing="immediate">1</loop>
      <play-item ref="seg-screen3"/>         <!-- the same screen is used so that -->
      <select ref="select-incorrect"/>       <!-- the user doesn't know that they've -->
      <select ref="select-incorrect"/>       <!-- entered the wrong key -->
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
      <select ref="select-incorrect"/>
    </selection>

    <selection id="select-correct">
      <next ref="end-endlist"/>
      <wait>-1</wait>
      <loop jump-timing="immediate">1</loop>
      <play-item ref="seg-correct"/>
    </selection>

    <selection id="select-incorrect">
      <next ref="select-screen1"/>
      <wait>-1</wait>
      <loop jump-timing="immediate">1</loop>
      <play-item ref="seg-incorrect"/>
    </selection>

    <endlist id="end-endlist" rejected="true"/>

</pbc>
</videocd>

Discussion

This article demonstrates a three combination lock, but there is no reason why it cannot be 4, 5, etc.  Similarly, I only used numerical key presses 1-9, but you could theorectically use any number from 1 to 99.  However, as mentioned previously, this "lock" offers no real security and should not be used as such.  It is really only a "cool" feature and may perhaps prevent casual copying.  Why you would necessarily implement such a feature as a copyright protection device is questionable, however.

 


Michael Tam <vitualis (at) michaeltam.com>
anti-spam device - replace (at) with @ to send me e-mail

(c) 20 December, 2002