Week 2 | Developing a Prototype
The goal of my prototype was to show a simple objective system in Unreal Engine 4 and also add some basic user interaction in a scene. I looked at examples of some RPGs (Role Playing Games), as well as some VR job simulators because they showcase intuitive controls and how to effectively interact with dynamic objects.
What I want to include in my prototype:
- Objective system list using UI widgets where there is a ‘Main Objective’ that consists of ‘Sub Goals’.
- Setup 3D widgets (menus in space) that the user can interactive with, while also attracting them to certain spaces.
- Be able to interact with dynamic objects and move them with user input.
Blueprints, the visual coding language in UE4, will be used to complete the majority of the prototype. There were multiple aspects of Blueprint scripting that I needed to learn, these include:
- How to use variables such as boolean, integers, object references, floats, etc. This is integral when setting up communication between the script and menu, object or widget.
- Communicating between scripts using functions and custom events.
- Referencing objects in multiple scripts.
- Learning how to utilize conditions to trigger events.
Scripting Process
This prototype consisted of TWO primary widgets (widget are combined of both UI and data where the data is fed into the widget using variables and other inputs), the ObjectiveWidget and the SubGoal Widget. The ObjectiveWidget handles the main objective the user is trying to achieve, it describes the overall theme of what the user is trying to do. The SubGoal widget handles the specific tasks that the user must complete. For example:
- Objective: Explore the Pavilion!
- SubGoal: Turn the lights on.
To easily edit the objectives and sub goals, I had to make sure everything was a variable and easily editable in one file.
This allowed me to easily:
- Add and name Objectives.
- Add multiple Sub Goals with custom names, amounts and under which category.
- Determine how much information the user was given based on the difficulty of the task.
The next part of the prototype involved 3D Widgets and user interaction.
Get Ali Siddiqui’s stories in your inbox
Join Medium for free to get updates from this writer.
3D Widgets are user interfaces that exist in world space. The user can walk around them and interact with them if the script allows it. My idea was to have two 3D Widgets that would correlate with the SubGoals the user needed to accomplish. One was spawning a chair and the other was turning on a light. In addition, I wanted to ensure the “Lights” and “Seating” signage would always face the player.
This is the basic layout for the ‘Lights’ signage and buttons.
This script was used for configuring the On-Click event for the ‘Light Switch’ button, causing the intensity of the light to be at 2000, however if it was already at 2000 it would be set back to 0 intensity if the button was clicked again. This was achieved using True/False (Boolean) statements and object referencing.
After I configured the button, I converted the widget into a 3D object so it was place-able in the world and had coordinates on the X, Y, and Z plane.
By getting the user world location and calculating the normal, I was able to get the 3D widget to always face the player, making it easier to read and attract the user from outside the pavilion. All these steps were repeated for the ‘Seating’ SubGoal.
Lastly, the cube interaction SubGoal. This was key when showcasing how the user could change the surroundings via dynamic object interactions.
Allowing the user to physically interact with objects in a virtual environment plays a pivotal role in achieving an immersive and interesting experience. This script can definitely be applied to a more complex situation, creating a more convincing VR experience.
Using this basic system, the user is guided through areas by trying to complete each SubGoal working towards finishing the entire Objective.
I definitely feel this could be extended upon for the final product as I have learned to create an objective system and trigger events based on where the user is and what data they input.
References:
TUTORIAL SERIES: YouTube. 2017. [Eng] Complex Quest System: Creating the Project and Adding Custom Characters #01 — YouTube. [ONLINE] Available at: https://www.youtube.com/watch?v=oK-9sC4bYnk&list=PLmKKTERcjTPIkMH9iK3gTUyl976_TW1hj. [Accessed 9 March 2017].
TUTORIAL: YouTube. 2017. Unreal Engine 4 Tutorial — Pickup and Drop Objects (Physics Handle) — YouTube. [ONLINE] Available at: https://www.youtube.com/watch?v=OltZ-xFz8IQ. [Accessed 10 March 2017].
DEVELOPER DOCUMENTATION: Unreal Engine. 2015. Creating 3D Widgets. [ONLINE] Available at: https://docs.unrealengine.com/latest/INT/Engine/UMG/HowTo/Create3DWidgets/. [Accessed 11 March 2017].











