I. INTRODUCTION
As the virtual reality market grows, the quantitative demand for content increases rapidly and the demand for scalability is also faced. In order to cope with this demand, the productivity of content has become very important. However, there is a limit to improving content productivity with a development method that relies on computer programming languages such as C++ or C#.
Content productivity problems are more prominent in virtual reality simulation-based training systems. The main purpose of the training system is to maximize the educational goals by providing users with a variety of experiences. In order to ensure that all users with different training proficiency and abilities have the opportunities to explore a variety of virtual activities, virtual training scenarios that can handle numerous cases are required.
We have been developing a fire training system using virtual reality simulation and trying to solve the problems mentioned above in this system for several years. We are using behavior trees to design the behaviors of the virtual objects that make up our system. Behavior tree is very useful in designing the behavior models of the objects required by our planner. However, as we said earlier, more and more complex behavior trees are needed to handle countless experience situation.
Therefore, in order to tackle the problem, we started this research. In our research, we made some changes to behavior tree to meet our requirements. We defined four types of new behavior tree nodes, which can be dynamically changed according to the training situation at runtime and implemented an adaptive behavior tree simulation module in which these special tasks can operate. And in order to confirm whether the adaptive simulation we devised is effective, we applied it to the virtual reality simulation-based training system we were developing.
This paper is organized as follows. In Section 2, we describe of some case studies related with our research. Section 3 explains some of the problems we resolved in the process of implementing our adaptive simulation module. Section 4 introduces the four types of special behavior tree nodes and modeling methods of them. Section 5 demonstrates an example scenario that apply our approach. Finally, we will make concluding remarks in Section 6.
II. RELATED WORKS
In order to increase the productivity of contents, the virtual reality and game industries have included various standardized authoring support tools in their production pipeline. Typical examples are Unity Engine’s Mecanim and Unreal Engine’s Blueprint. Although there are tools that require some knowledge of computer programming now, it is expected to become a tool that even beginner can easily access in a near future.
Unity’s Mecanim uses a tool like the Hierarchical State Machine (HSM) to create the effect of transitioning animation according to changes in the state of an object [1]. In addition to this, Unity recently added a visual scripting tool called Bolt [2] as a standard asset. Using Bolt, it is possible to implement not only animation but also the entire game logic using only visual scripting.
Unreal’s Blueprint [3] is a visual scripting language that greatly expands data flow diagram (DFD) and is a tool that helps you program the behavior of objects. Unreal also includes Behavior Tree as a visual tool for AI of game agents [4]. The study in [5] also showed the possibility of an agent capable of reinforcement learning using Environment Query System (EQS) [6] and visual tools provided by Unreal.
As in this research, the problem of adaptively simulating objects in virtual environments is similar to planning problems in artificial intelligence. This is because adaptively simulating requires finding or replacing actions to accomplish a particular purpose. SHOP2(Simple Hierarchical Ordered Planner 2) [7] is a representative example and a system based on Hierarchical Task Network (HTN). As an example of planning [8] is a procedural scenario creation technique using HTN in lifesaving training games can generate variety of dynamic scenarios in unpredictable environments.
Because behavior trees are very natural to apply computational operations to nodes that make up themselves, they are well suited as a means for adaptive simulation. In [9], they introduce the parameterization to behavior tree and an authoring tool for AI agents. An example of applying operations to behavior tree’s nodes can be found in [10]. In this research, the genetic algorithm is used to optimize the nodes of behavior tree.
III. ADAPTIVE BEHAVIOR TREE SIMULATION MODULE
Each time we update the fire training system we have been developing, there are more and more object behaviors that we need to implement newly. In addition, it was found that the behavior tree needs to be continuously updated whenever training is performed for users. To update a behavior tree, you need to implement a custom action task to invoke some action method on an object and add the resulting task to the behavior tree. For this reason, we implemented an adaptive behavior tree simulation module that can dynamically change the action method we want without modifying behavior trees or implementing new custom tasks.
The simulation module we implemented acts as a component of a game object in the Unity engine [12]. We utilized Opsive’s Behavior Designer [11] for the basic simulation and authoring of behavior tree, which is very suitable for our research. Each adaptive task implemented in this research inherits from the base classes provided by Opsive’s Behavior Designer.
The core of this simulation module is a generic action task called “Method Invoker” that allows us to use the desired Unity GameObject’s action method as a parameter instead of implementing a new custom action task. When you put a Method Invoker task in a behavior tree, you need to set the Unity GameObject and the component that owns the method that this task will execute, the method name to execute, and the parameters required for the method. All of these processes are done in the Inspector window of Unity, and for this, we implemented “Method Finder Drawer” by customizing the Object Drawer provided by Obsive.
A Method Invoker task also works as a scene-level component of a Unity GameObject, but we have implemented serialization functionality so that it can be saved as an asset that is a project-level component. This serialized task can be referenced by a specific node in behavior trees, or it can replace a specific node at runtime. By implementing this way, we enabled adaptive simulation in which some nodes of behavior trees can change at runtime.
In addition to Method Invoker, we had to implement a few additional custom tasks for adaptive behavior tree simulation. They include Set Variable, ChangeableAction, D-Sequence, D-Selection, etc. Details of each task are postponed to the next chapter.
IV. MODELING ADAPTIVE BEHAVIOR TREE
In this chapter, we will explain the process of modeling object behavior using four types of behavior tree nodes we defined in this research, which are created using the Method Invoker task mentioned above. These four tasks allow specific nodes in behavior trees to dynamically change in their own different ways.
When you put a Method Invoker task in a behavior tree, you are prompted for the method name you want to execute and parameters the method needs. The parameters set in this task are created as shared variable objects of the corresponding game object. Therefore, this parameter value can be accessed from other nodes or other behavior trees at runtime.
For the external reference of the parameters in the Method Invoker task, we implemented a custom behavior tree node called “Set Variable” (Fig.1). The Set Variable task changes the value of a shared variable of the GameObject with a behavior tree component that want to change the value of a parameter, and the changed value is passed back to the Method Invoker task of that behavior tree component.
Substitute task can be replaced at runtime with another node that includes its subtree. Fortunately, the Opsive’s Behavior Designer provides an External Behavior Tree functionality that can store a behavior tree node including its subtree as an external asset.
By actively utilizing this External Behavior Tree, we implemented three types of substitute tasks. They are ChangeableAction task and two composite tasks, which are D-Sequence (changeable sequence) (Fig. 2) and D-Selector (changeable selector).
The Substitute tasks are replaced with predetermined external behavior trees when the conditions set in the ChangeableCondition Field of them are satisfied. In Changeable Condition, the value of a shared variable (described above) can be used as a condition and complex conditions can be set by combining multiple conditions.
There are three types of custom tasks for stochastic execution in our behavior tree. The first one is Random Selector. Random Selector task is a composite node and is used to select one of the multiple scenarios by randomly selecting and executing one of the child tasks. The second one, Random Probability task, is one of the Condition tasks and returns Success with random probability. This task is used to select whether to run the scenario of its child node. The third, Set Shared Float Random task, is an Action task that modifies a float type variable value to a random value. Of course, in this task, you have to set the maximum and minimum values.
There are two types of mutated tasks; Increase Variable and Decrease Variable. Increase Variable (Fig. 3) task makes the value of a specific variable increase at regular intervals at running time. In the inspector window for this task, you must set an incremental step and a maximum value. The Decrease Variable task does exactly the opposite.
V. SIMULATION RESULTS
We tested for evaluation by modeling 55 adaptive task nodes in 10 virtual objects, which includes an electric fan, an induction range, a refrigerator, etc. By adding 55 adaptive tasks in this way, it was possible to create training scenarios for an infinite number of cases mathematically, although the difference is not large. Fig. 4 and 5 show how the behavior tree of an induction range in the kitchen has been changed.
VI. CONCLUSION
In this paper, we introduced an adaptive training simulation module that can alleviate the productivity problem in virtual reality contents. We have added four new task types to behavior tree, which is most commonly used for modeling AI for objects in virtual reality systems. These newly added tasks implemented to change dynamically according to the user’s skill level or reaction. As a result of applying such an adaptive simulation to the virtual reality simulation-based fire training system we were developing, it was possible to operate various training scenarios without designing new behavior trees or changing some part of them.