Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 4, No. 3, 2023 56 Training Scene Construction and Motion Realization of Unmanned Craft based on Unreal Engine Jiaxin Gao, Yuelu Chen *, Baolong Cao, Yiming Chen and Chuanqi Li Research and Development Center, Aerospace Internet of Things Technology Co Ltd, Beijing, China Abstract: Aiming at the problems of the traditional training system, such as the unrealistic simulation of 3D animation effects and the inability to meet the demand of real-time manipulation response of simulation training based on the original mechanical calculation, this paper puts forward a method of unmanned craft training scene construction and motion realization based on Unreal Engine. The method makes full use of Unreal Engine's powerful graphic rendering ability and physics engine function, and combines 3D MAX to realize the rapid construction of unmanned craft training scene, environment simulation, and unmanned craft motion simulation and control. The developed unmanned craft training software has the characteristics of smooth and clear picture, realistic and delicate scene, strong training immersion, and real manipulation experience, which can effectively improve the training efficiency and training safety, reduce the training cost, and have significant economic benefits. Keywords: Training Simulation; Unreal Engine; Unmanned Craft. 1. Introduction The degree of informatization of modern war is increasing, and the intelligent characteristics are becoming more and more obvious, science and technology not only change and reshape the winning mechanism, winning elements, winning probability of the war game, but also fundamentally change the form, means and methods of military training. Despite the fact that live training is the closest to the actual combat scenario and has irreplaceable advantages in terms of authenticity and training effect, it is inevitably subject to a variety of constraints, such as high requirements for venues, high training consumption, and difficulties in organizing training, etc. [1]. In recent years, with the rapid development of intelligent equipment, computer technology and simulation technology, a new generation of simulation training system, supported by powerful hardware and software capabilities, can realize richer functions, build a more realistic scene, and use diversified means of interaction. The system can form a more complete equipment simulation capability, create great benefits in training, and become an important way to train the operation and use skills of new complex equipment systems. Although some domestic universities and related research institutes have been actively carrying out research in this field, but by the limitations of the traditional simulation technology, the model training system has always existed in the three- dimensional animation effect simulation is not realistic, based on the principle of mechanics settlement cannot meet the real- time manipulation of the simulation training response needs and other issues [2]. In order to solve the above problems, this paper proposes a method of the unmanned craft training scene construction and simulation motion implementation based on unreal engine. This method makes full use of the powerful graphic rendering ability and physics engine function of unreal engine, and combines with 3D max to complete the rapid construction of unmanned craft training scene, motion simulation and control. The test results show that the training scene constructed based on the unreal engine is realistic, and the motion simulation and manipulation of the unmanned craft are real and have a strong sense of training immersion. In order to solve the above problems, this paper proposes the unmanned craft training scene construction and motion realization method based on Unreal Engine. This method makes full use of the powerful graphic rendering ability and physics engine function of Unreal Engine, and combines with 3D MAX to complete the rapid construction of unmanned craft training scene, motion simulation and manipulation. The test results show that the training scene constructed based on the Unreal Engine is realistic, and the motion and manipulation experience of the unmanned craft is real. The whole training process has a strong sense of immersion. 2. Development Environment Unreal Engine is a world-renowned open-source game engine developed by EPIC, many of the world's best-known 3D games are developed using the engine. Unreal Engine holds 80% of the global market share of commercial game engines. It is a complete set of development tools, which provides a large internal suite of development tools, such as VR plug-ins, GPU-level particle systems, powerful material editor, lighting and physics rendering systems, etc. It can be used by any user of the engine to carry out design work [3]. Unreal Engine has a built-in Niagara visual effects editor, which allows you to create cinematic-quality real-time VFX effects with a fully customizable particle system to represent effects such as flames, smoke, dust and flowing water. Unreal Engine's material editor uses physical material-based coloring technology. Through real-time rendering, Unreal Engine can make the light and shadow, reflection, dust, sea surface and other effects in the scene more detailed and realistic, so that the developed scene screen effect reaches the level of 3A game screen. At the same time, the built-in physics engine of Unreal Engine is very perfect. It can support the simulation of various physical movements of the unmanned craft, so that the unmanned craft driver can observe the various movement states of the craft in time, increase the immersion and realism of the unmanned craft simulation training, and improve the training efficiency. 57 3. Construction of Training Scene 3.1. Construction of Base Terrain Due to the limitation of the operation range of the unmanned craft, its operation scene mainly involves the offshore water terrain, this paper obtains the satellite elevation data of a certain coast through Google Maps, and imports it into the Unreal Engine through the terrain editor for material mapping and rendering, the obtained beach scene is closer to the real mission scene of the unmanned craft. When training in this scene, it can increase the sense of immersion for the unmanned craft driver and enhance the training effect. The effect of basic terrain modelling is shown in Fig 1. Fig 1. Basic terrain construction 3.2. Construction of Offshore Waters Offshore waters are mainly constructed and simulated using Unreal Engine's Fluid Flux. The Fluid Flux is a powerful water system based on 2D shallow-water fluid simulations. Fluid Flux has been set up with Fluid Flux has been set up with features such as buoyancy and undersea effects to create rivers, lakes, and oceans based on spline in Unreal Engine. The surface of the water body supports physical interactions and dynamic fluid simulations, and is able to interact organically with various land terrains, ships, and other marine structures, such as waves along the shore or the wake of a ship moving through the water. Fig 2. Offshore waters construction Add the water body generated by Fluid Flux in the constructed basic terrain, adjust the material and size of the water body, the speed and direction of the water flow, the size of the waves and other related parameters, and finally generate the offshore scene as shown in the figure 2. This rapid modelling method of real terrain based on satellite elevation data is much faster than the conventional terrain modelling method, and the established terrain model is similar to the real terrain, its modelling accuracy can meet the demand of training use. After clarifying the mission area of unmanned craft navigation, the real terrain rapid modelling method can be used to construct the mission area terrain and sea area for simulation training, so as to improve the quality and efficiency of mission completion. 4. Conclusion Realization of Motion Simulation The physics engine is a computer program that uses variables such as gravity, speed, friction and air resistance to simulate a Newtonian mechanics model. In the previous simulation training scene, the equipment is usually set to ignore the laws of physics and only perform predefined prescribed actions, which cannot truly reflect the motion of the unmanned craft. In order to make the unmanned craft simulation training closer to the real mission scenario, this paper uses the PhysX physics engine in Unreal Engine to perform physical simulation calculations on the motion state of the unmanned craft, and applies the motion model of the unmanned craft and its force and moment conditions to the physics engine. After adding the physics engine, the motion and collision of all the objects in the training scene must follow the laws of physics, so as to present a similar motion state to the objects in the real scene, which makes the handling feeling and motion trajectory of the unmanned craft closer to the actual equipment, which can further improve the training efficiency. 4.1. Establishment of the Coordinate System In this paper, an unmanned craft is taken as the object of research and modelling to establish a mathematical model of the motion of an unmanned craft in a real water environment, which requires the use of two coordinate systems about the geodetic coordinate system and the carrier coordinate system [4]. As shown in the Fig.3, 0 0 0 0o x y z stands for the geodetic coordinate system, the earth is used as the reference system, the origin 0o is any point on the earth's surface, the direction of 0x is north, the direction of 0y is east, and the direction of 0z is perpendicular to the ground downwards. b b b bo x y z represents the carrier coordinate system, which is fixedly connected to the unmanned craft, and moves together with it, the origin bo is the unmanned craft's center of gravity, the direction of bx is the direction of the unmanned craft's forward motion, the direction of by is the direction of the unmanned craft's starboard side, and the direction is perpendicular to the direction of bx , the direction of bz is perpendicular to the plane of b b bo x y downwards, pointing to the bottom of the craft. 58 0o 0x 0y 0z bo bx by bz Fig 3. The coordinate system of unmanned craft 4.2. Kinematics Equations for Unmanned Craft The real motion of the unmanned craft in a marine environment is very complex and generally needs to be described using six degrees of freedom. According to the standard of the International Towing Tank Conference (ITTC), the physical quantities of an unmanned Craft can be expressed in Table 1, where , , denote the longitudinal, transverse and vertical displacements respectively; , , denote the transverse rocking angle, longitudinal rocking angle, and bow angle of the hull respectively. , , denote the longitudinal, transverse, and lifting and sinking speeds respectively, and , , denote the transverse rocking, longitudinal rocking, and bow rocking angular velocities respectively. , , denote the force applied to the unmanned craft in the direction of each coordinate axis; , , denote the moment applied to the unmanned craft in the direction of each coordinate axis [5]. Table 1. The representation of craft’s variable Degree of freedom name Description Position and angle Forces and moments Velocity and angular velocity surge translation along the x- axis x X u sway translation along the y- axis y Y v heave translation along the z- axis z Z w roll rotation along the x- axis φ K p pitch rotation along the y- axis θ M q yaw rotation along the z- axis ψ N r The parameters of the unmanned craft in the geodetic coordinate system and in the carrier coordinate system have the following transformation relationship: cos cos sin sin cos sin cos sin sin sin cos cos sin cos cos cos sin sin sin sin cos sin cos sin sin sin cos cos cos x u y v z w                                                                1 sin tan tan cos 0 cos sin 0 sin sec cos sec p q r                                             The six-degree-of-freedom kinematic equations for the unmanned craft can be known as: cos cos (sin sin cos cos sin ) (cos sin cos sin sin ) cos sin (sin sin sin cos cos ) (cos sin sin sin cos ) sin sin cos cos cos sin tan cos tan cos sin sin s x u v w y u v w z u c w p q r q r q                                                                 ec cos secr            4.3. Force Analysis and Dynamic Equations of Unmanned Craft According to Newton's law of motion and the principle of the MMG separation model, the unmanned craft can be divided into a number of modules to be analyzed individually when the dynamics of the unmanned craft is studied [6]. As a result, the unmanned craft dynamics equations in the carrier coordinate system can be expressed as: 2 / ( / ( / ( / ( / ( / ( ) x y z xx xx yy yy zz zz G u X m m v Y m m w Z m m p K I J q M I J r N I J x m                         ) ) ) ) ) Where xm , ym and zm are additional masses in the vertical, horizontal and vertical axes, xxI , yyI and zzI are moments of inertia around the x, y and z axes, xxJ , yyJ and zzJ are the additional moments of inertia around the x, y and z axes. X, Y, Z and K, M, N can be obtained from the following equation. 2( ) ( ) ( ) y G B P R D x G B P R D B P R D B P R D B P R D G B P R D X m m vr x mr X X X X Y m m ur x mr Y Y Y Y Z Z Z Z Z K K K K K M M M M M N x m v ur N N N N                                           Where the variables with subscripts B, P, R and D represent the hull, propeller, rudder, and other disturbing forces and moments respectively. In general, the unmanned craft is subject to several forms of forces during navigation, including the craft's own gravity, the thrust of its propellers, inertial viscous hydrodynamic forces, and the resistance and influence of sea winds, waves, and currents. When using the Unreal Engine for unmanned craft simulation training software development, the water- related forces and moments such as the craft's gravity, inertial viscous hydrodynamic forces, and the resistance of waves and 59 currents can be calculated by the physics engine. Therefore, this paper mainly analyzes the force of propeller and steering and the interference force caused by sea wind, which affect the operation process of unmanned craft. A. Propeller force and moment modelling Propeller is one of the important elements of unmanned craft motion modeling, and it is the fundamental driving force for the unmanned craft to advance. During the navigation of unmanned craft, it is mainly responsible for generating thrust to overcome the resistance of water and maintain the maneuvering motion of the craft. It has the advantages of high efficiency, simple structure and operation. In the carrier coordinate system, the force and moment generated by the propeller are: cos sin 0 sin ( ) cos ( ) sin P P P P P G P P G P G X T Y T Z K T z z M T z z N T x                     Where is the thrust force generated by the propeller. It is generally obtained by fitting the experimental results. Therefore, in the design of the simulation system, in order to reduce the difficulty of software development, the throttle control quantity and the propeller thrust are usually mapped according to the experimental fitting results. is the actual thrust angle, and the leeward direction is positive. is the longitudinal position of the center of gravity forward of the stern, is the vertical height of the center of gravity above the baseline, and is the vertical height of the propellers above the baseline. B. Rudder force and moment modelling The unmanned craft studied in this paper uses a single propeller and a single rudder. The rudder is installed at the stern and placed behind the propeller to increase the rudder effect by using the propeller tail, which makes the calculation of the rudder force quite complicated. The forces and moments on its three axes can be obtained by empirical formulas [7], as follows (1 ) sin (1 ) cos 0 ( ) cos 0 ( ) cos R R N R H N R R R H H N R R R H H N X t F Y a F Z K z a z F M N x a x F                     Where is the actual rudder angle. In the design of the simulation system, the rudder control quantity and the rudder angle are usually mapped according to the experimental fitting results. is the positive pressure on the rudder under the interference of the propeller, is the derating factor of the rudder force, is the correction factor for the rudder- induced transverse force on the hull, is the longitudinal distance from the center of action of the rudder-induced transverse force on the hull to the center of gravity of the craft, and is the longitudinal distance from the center of action of the rudder force to the center of gravity of the craft. C. Disturbance Modelling of sea breeze Because of the large structural scale of the unmanned craft, the corresponding wind area becomes larger. So, the sea breeze will change the attitude of the craft, such as roll, yaw and other adverse effects. In addition, the sea breeze is the main cause of sea waves, which will disturb crafts or other marine structures and cause offsets, it threatens the safety of crafts. Due to the random variation of wind direction and wind speed, it is impossible to form a good wind spectrum. Therefore, when designing the simulation training system, the wind direction change and the slow change part of the wind load are usually ignored and only treated as a constant [8]. The specific expression is as follows: 0.5 ( ) 0.5 ( ) 0.5 ( ) wind a f R wx R wind a s R wy R wind a s oa R wn R X A U C Y AU C N A L U C            Where is air density, is relative wind speed, is the total length of the unmanned craft, is wind chord angle which is the angle between wind direction and bow direction, 、 are the frontal and lateral projected areas of the hull on the waterline respectively, is the longitudinal wind pressure coefficient for unmanned craft, is the coefficient of lateral wind pressure on the unmanned craft, is the bow moment coefficient. 4.4. Collision Design Unreal Engine provides an object collision detection system, the workflow is as follows: first, set up the collision properties of each object. And then the game engine will detect the collision at regular intervals. When the collision occurs, it will send the collision event to the outside. The system will respond to the collision event according to the predefined settings after monitoring the collision event. Each object in Unreal Engine has a collision attribute and a unique channel type, which is used to decide whether the object will collide with other objects and the trajectory response after the collision. If a collision event occurs in the object with the collision attribute set up, the Unreal Engine collision detection system will call the collision response to return the collision position, collision type and other information, and through the computation of the returned data, the object's motion state after the collision is derived. Collision Settings Collision  Detection Collision  Monitoring and  Response BoxComponent CapsuleComponent SphereComponent Unreal Engine NotifyActorBeginOverlap NotifyActorEndOverlap ...... Fig 4. Workflow diagram of object collision detection system 60 In the training software development, the collision channel type of "moving" objects such as unmanned crafts and birds is selected as the World Dynamic, and the collision channel type of World static objects such as earth, rocks and trees is selected as World Static. Take rock as an example, its channel type is set to World static, the collision preset is Block All (collision with all objects), and the unmanned craft under the collision response list is selected, then the unmanned craft will collide with the rock and change the motion state of the unmanned craft according to the collision response, and then return the result of the collision. 4.5. Testing and Results Analysis All of the software functions described in this article were developed in Unreal Engine 5. In order to test the actual effect and usability of the unmanned craft simulation training environment, the complete set of software built in UE5 is packaged and exported after completing the software development work. The test is run on another computer, which is configured as shown in the table below. Table 2. The representation of craft’s variable NO. Name Parameters 1 CPU Intel CORE i5-13400 2 Memory 16GB DDR4 3200MHz 3 Hard Disk 512GB NVMe PCIe 4.0 4 Graphics card GeForce GTX 1660S 6GB 5 System Windows 10 Fig 5. Simulation training process of unmanned craft The test results demonstrate that the developed unmanned craft simulation training software has a clear and smooth scene picture, and the scene terrain model is close to the real terrain with a high degree of model fidelity. During the operation of the software, the unmanned craft can float in the water normally, and be affected by different degrees of sea winds, waves or currents and produce phenomena such as offset, pendulum swing, horizontal rocking and so on. When the operator uses the keyboard to simulate the throttle and rudder of the remote control to send out control commands, the unmanned craft model in the software is able to present the corresponding action response, such as acceleration, deceleration, turning and so on. When the operator controls the UAV to collide with the rocks, the change of traveling direction of the UAV due to the interaction force generated by the collision can be clearly observed. When the unmanned craft washes up on the beach, the unmanned craft can be clearly observed to run aground on the shore. Fig 5 shows a screenshot of the simulation training process of the unmanned craft. 5. Conclusion This paper introduces an Unreal Engine-based unmanned craft training scene construction and simulation movement realization method. The method uses the powerful graphic rendering ability of Unreal engine to realize the rapid modeling of real terrain and environment simulation, which can meet the needs of unmanned craft training on terrain and navigation environment, and does not need to occupy the relevant site or wait for special weather. At the same time, the force and motion of the unmanned craft are analyzed, and the physics engine is used to realize the motion simulation and control of the unmanned craft. The developed unmanned craft simulation training software has the characteristics of smooth and clear picture, realistic and detailed scene items, strong training immersion, and real manipulation experience, which can provide a realistic training environment for the trainees to practice operation repeatedly and can effectively improve the training efficiency and training safety, reduce the training cost, and have significant economic benefits. References [1] Li E. C., Wang Y.B., Gao J.X., etc., “System Design of Battle Simulation Training Apparatus for One Ground-to-Air Missile”, Ship Electronic Engineering, 2011, Vol. 31(3), p126- 129. [2] Jiang C.J., Han H.L., Zhai Y.C.. “Training platform design of bulldozer simulator based on Unity 3D”, Chinese Journal of Construction Machinery, 2017, Vol 15(06), p517-521. [3] Zhang Y.K.. “Construction and data acquisition of unmanned aerial vehicle training scene based on 3DSMax and Unreal Engine”, Beijing University of Posts and Telecommunications, 2018. [4] Xiao S.L.. “Research on multi-mode control system and autonomous cruise method of unmanned surface vessels”, University of Science and Technology of China, 2022. [5] Wang D.. “Unmanned catamaran motion modeling and autonomous navigation control design”, Southwest Jiaotong University, 2016. [6] Sun Q.M., Ren F., Yue J., etc. “SVM inverse model-based heading control of unmanned surface vehicle”, Information Computing and Telecommunications. IEEE, 2011. 61 [7] Sun Q.M.. “Study on Unmanned Surface Vehicle Modeling and Logic Networks Adaptive Control Method”, Dalian Maritime University, 2013. [8] U S.J., Zhu K.Q., Zhao J.P.. “Research on mathematical model of ship maneuvering in wind and flow environment”, Ship Science and Technology, 2013, Vol 35(1), p27-30.