home | products |web boards| faq | galleries | contact | about  
multimedia autorun autorun
download multimedia buy now graphics multimedia search


 

DVDlab
Home
Screenshots
Encoder
Banners

DVDlab PRO
Home
Screenshots
History

DVD-9 DL
Home

Resources
Tips & Tricks
Help

Help

Help

Help

Help

FAQ
History

DVD Tools
Timecode calc
Re-Aspect

Articles
H. Theater
DOF Machine
3D Video

Photo-Brush
Start here

Real-Draw
Start here

CompactDraw
Start here

PhotoSEAM
Start here

Multimedia Builder
Start here

Other tools
UltraSnap
Camera Tools

 

 

 

 


Simple Random "Generator" by faking it
Sometimes you like to start a random movie or start a test by random question.

A typical problems of random generators:

  • the random sequence is always the same when you start the generator. Tha means non-seeded RNG used on DVD will always produce the same sequence, which is no better than using a simple list
  • seeding random generator is a good way, but using registry counter on DVD is not reliable - not all players will work correctly
  • it is not always desirable to repeat the same number (for example in a random generator of questions we don't want the same question to repeat)

Here we will try to address these issues simple way.
Most of the real-life projects can be created without having any actuall random generator, just making it looks like there is one. For example a movie that would randomly choose a scene or a Quiz that will randomly shows question - you would think that for that we need a strong random generator. But in reality a single person would hardly watch repeatedly the same movie or take the same test many times in a row to see if the questions are truly random each time.

Here we propose a simpler way: a set of sequences that would be perceived as a random choice.

Advertisement (for our own product)

Create stunning photo from just a single image or a series of multiple exposures.
Discover the power of HDR and Pseudo HDR photography with Mediachance new Dynamic Photo HDR.

Simple Single non repeating sequence

Instead of spending our time on creating non-repeated RNG, we can simply use list. Depending on the project this can be Play List or Counter List.

Example: We have 10 questions, each question is on its own menu. We would like to shuffle the questions. (This is not about the quiz feature, but rather about a pseudo-randomness)

We will add Counter List and all 10 menus inside:

Each time a counter list is called the next item in the list will be linked. That means on every menu when user choose answer we will link back to the Counter List. At the end of all items the End link of the Counter list is executed.

Note: In reality, you will want to link through a script/scripts that will count good and/or optionally bad answers, so for example Q1 menu, all bad answers will link to a the Counter List directly, but Good answers will link first to a VM script called "GOOD" that will increase the GPRM of good answers, then link to CounterList

This situation above will play each question once (only 3 questions are displayed), go to another question and after all 10 questions are playe it will go to the end.

Obviously our Counter List is currently set to have all question sequential, but we can now manually shuffle the questions with Upa nd Down buttons.

So far we created situation that is equally good as a Skewed Random Number generator - no items will be repeated but it will always produce the same sequence of questions. So much for the "random" generator.

At this moment we can easily produce different DVD's with different sequence, by simply shuffling the Counter List. (For example each student will get one of the 5 DVD's on which the order of questions is different)

Making more choices

So far having one sequence doesn't really look like a much of a choice. We can add more choices by creating more Counter Lists. These do not take much space on the disc so we can create as many of them as we like.

However we need one more object that will control which Counter List to use. For that we use Case list. Let's say the GPRM0 indicates which sequence to use, then we simply iset a case list

if GPRM0 = 1 then Counter List 1
if GPRM0 = 2 then Counter List 2

etc..

On the image below the GPRM0 register is initially filled in the SEQUENCE? (Menu 16). So far this is just by user choosing the sequence manually A, B, C...).

To simplify the view we use only Two different Counter Lists (Each with shuffled Questions).
Note that now the questions link back to the Case List so we always work with the same list selected in GPRM0.

This arrangement is quite flexible beacause we can add many more Counter Lists and the layout will not change much. With 10 questions there is no need for too many shuffled sequences.

Seeding the generator
In the example above user has to choose the sequence in the Menu 16. Here we will create a simple way that will choose the sequence depending on how long it takes for him to press button.

We will do that in a menu with cells. We can do a still menus, where each cell is a still menu, or we can create a small movie loop and add cells on it.

We created a 10 sec. MPG animation with fast rolling dices. It doesn't really what number it shows on dice, this is just for effect. The text "When you are ready..." is also part of the movie as well as the Play "button". This is important because if you add text as menu item over the movie background, it will not be visible unless you use Render Motion that will burn the text into the movie.

Then we add this movie as a motion background to the menu and add cells, close enough so the time will be about a second.

Since our clip is 10 second, if we add 10 cells then we have a 1 sec per cell. If you have less Counter Lists than 10, you can call the same counter list on later cells.

We burned the text and the Play button to the movie, but we need to add a link into each cell. This is done using Group Hot Spot.

Note we also added a small circle in the menu next to the embedded Play button. As the cell transition occurs, the subpicture is briefly switched off. Since the PLAY text is burned in the movie, it will be always visible. However our circle (which will be visible as subpicture) will briefly dissapear during the cell change. So we will have blinking dot. That's all, just a fancy blinking dot.

The Group Hotspot will be placed over both the button and the circle. The idea is that we don't really want a button, just a hotspot. The blinking circle is our indication that cell has changed. The group Hotspot will link to the CASE list (Which Sequence?)

Each cell will need a copy of the group hotspot (and in our case the circle as well). Make sure, each group hot-spot links to the Case List (If you use Copy/Paste the links are removed)

Each cell will set different GPRM0 which is our indicator of the sequence (which Counter list will be used).

This could be done as a cell command or simply as a button command.

As a cell command:

Cell commands are executed at the end of the cells so we need GPRM0 = first value in a PRE command of the whole menu:

Then each cell will have simillar VM command for each next

That means whenever a cell transition occurs, different GPRM0 will be set in a register and this will be used when we press Play button (button is activated and we jump to CASE List)

As a button command:

We can alternatively set the GPRM 0 directly in the button, in which case we don't need cell commands. (Each cell will simply link to the next) This will minimize the "blinking" between cells.

On each cell the Group HotSpot will use "Set GPRM and Link To" option (right click on the hot spot, from menu select Link, and then this is near the bottom). Each Hot spot on each cell will set different GPRM0.

The result scenario is below:

From start user goes to the Dice animation that prompts him to start when he is ready. Which sequence (which Couter list) will be used depends when he press the play button at this screen. Obvioulsy by pressing the play button immediately will result in the same sequence.

To avoid this we can use some information in this screen that require longer reading. We can tell right away that we are shuffling the questions and user has to wait then press Play. We can also "make" a little game or create a little pre-quiz question.

This is a simple way of creating a "random" sequence type of DVD. As you can see there is nothing really random in it, but if we are creative it does work.

 
© www.MediaChance.com 2000