ELB Learning

Hidden Eggs, Random Variables, and Triggered Events: Remixing the Easter Egg Hunt Scenario

Written by Josh Bleggi | Mar 28, 2024 8:04:56 PM

Virtual reality is not only good for gaining muscle memory or building empathy, it can also be used to create very engaging gamified experiences. Using games and game mechanics in your training can also increase engagement and learner retention. So, really, mixing those elements into VR experiences can be a winning combination—like jelly beans and chocolate rabbits. That’s my random segue into today’s topic. 

Today I’m going to share with you how I built a simple game in CenarioVR® that can be applied to something like a hazard-spotting exercise.

However, today it’s going to be applied to righting a decades-long injustice: returning Easter eggs to their rightful owner, the mother hen who birthed them. 

I’ll spare you my rant about how it makes literally zero sense that a rabbit hides brightly colored eggs each spring. (I mean, come on, how in the world does that make any logical sense…I digress.)

Instead, let's introduce the features we will use to create our scenario today. By the way, you can find the complete scenario here. You will also be able to download the source file from the Public Scenarios in CenarioVR. 

Note: this scenario requires some working knowledge of CenarioVR to produce, and I will not specifically detail everything step by step to create it. Check out our Getting Started in CenarioVR playlist on YouTube for more specific development how-to tutorials.

In this scenario, we’re going to use two newer features in CenarioVR: Triggered Events (which will be called Events from here on out) and Randomized Variables. We are going to use these to have eggs randomly appear in the scenario so you have to keep actively looking for them. And we are also going to include a timer in the scenario. 

So here’s how I created this egg hunt scenario in CenarioVR.

First, Create a New Scenario with the AI Wizard. Since these same mechanics can be applied to various scenarios, you can type whatever you want here and select any category. In my case, I typed the prompt Front yard and used the category Storybook. 

Next, I built the main elements of the scenario using assets from the ELB Learning Asset Library and the built-in elements within CenarioVR. I will fast-forward over this part because, again, you can do this however you want. But here are some elements to include:

  • Hotspots for your eggs (or whatever object you want the user to collect) that all start out not visible
  • Some sort of tracker 
    • In my case, I reused my egg images but made them fixed objects and lowered their opacity to 10%
  • A 30-second timer
    • The timer should be set to not autoplay and should start hidden
  • Some sort of intro content/instructions with a start hotspot 
  • A fail message with a restart hotspot
  • A pass message with an exit scenario hotspot

Now let's get into the FUN NEW STUFF. Let’s create what I’m calling the Egg Randomizer in this scenario. 

This is an Event that, when fired, is going to randomly show our eggs based on different variable dependencies.

But first, what is an Event? 

An Event is a set of actions that is not directly related to a particular object, like a hotspot or a question answer. They can be used to create repeatable functionality that is not tied to a particular trigger. You can run them by using the Run Event action in the Actions Palette anywhere you can use an action. 

To create our Randomizer Event, we will start by creating a set of variables. If you’re not familiar with variables, they are simply containers for information that help you create certain conditions within a scenario. In the case of this scenario, we will create one variable called “eggcount” and then additional variables that correspond to each of the eggs. These will be named “egg1”, “egg2”, “egg3”, etc. Each of these will have an initial value of 0.

Here’s what each of these variables will be used for:

  • Eggcount - This is essentially a digital dice roll mechanism that will help determine which egg will be shown
  • egg# - This will help us keep track of which egg object has already been shown so that we don’t show eggs multiple times. If you don’t care about how often an object shows up you can forego using these. 

Now let’s actually create the Event.

Select Add Event from the Add Object dropdown menu. 

Add an Action that Shows Egg1 IF “eggcount” Is Equal to 1 AND “egg1” Is Equal To 0

Add another Action that Shows Egg2 IF “eggcount” Is Equal To 1 AND “egg1” Is Equal To 1 AND “egg2” Is Equal To 0.

Add Another Action that Shows Egg3 IF “eggcount” Is Equal To 1 AND “egg1” Is Equal To 1 AND “egg2” Is Equal to 1 AND “egg3” Is Equal To 0

By this point, you might be noticing a pattern. Basically, you need to Add a Show Action that shows a different Egg at each “eggcount” based on checking if other eggs have already been shown in the scenario. You do need to repeat this so each egg is shown at each egg count, which with six eggs was a lot. If this is your first time building it, I might suggest only having three objects to show. 

So, let’s fast-forward a bit. You’ve built the Randomizer Event; now let’s see how we use it. 

On your first Start Scenario Hotspot create the Following Actions:

  1. Modify Variable - “eggcount” =Set Variable Value %RAND(1,6)
  2. Run Event - Randomizer, Delay 1 Sec
  3. Hide Intro content
  4. Show Timer
  5. Play Timer

 

Here’s where we talk about Randomized Variables.

In most instances, you will want to either increase or decrease a variable by a specific interval or set it to a specific number. With random values, you instead set the variable to a random number within a preset range using the following syntax: %RAND(#,#). In this case, the random number I want is somewhere between 1 and 6, or the total number of objects I want the user to find. 

Now, let’s continue adding actions to the various Egg Hotspots in the scenario. I’ll explain how to do this on the first one, but you will pretty much repeat this same set of actions on each Hotspot.

On the Egg 1 Hotspot add the following Actions:

  1. Modify Variable - “egg1” =Set Variable Value to 1
  2. Modify Variable - “eggcount” =Set Variable Value %RAND(1,6)%
  3. Hide This Object
  4. Run Event - Randomizer no delay

 

If you look at the actions on this hotspot in the scenario you will notice additional actions to show the tracker and the end screens. These are somewhat optional, depending on your design.

Repeat these actions on each Egg Hotspot. The only change you will make is to make sure you are changing the correct “egg#” variable when the hotspot is selected.

Once you have this done, go ahead and test it out. Make adjustments if needed.

Obviously, there is more to this scenario, but this gives you the gist of the more essential bits of making it work. The rest is really up to your design. As I mentioned earlier, this scenario will be available in the Public Scenarios, so you can download it and further analyze it. Give it a try for yourself, and let us know how it goes. 

Watch how to build this scenario in the video below:

 

Not a CenarioVR user yet? Download a free trial now.