Driving simulators are in growing demands as they offers a safe and controlled environment for novice drivers to learn and gain experience, as well as for professional drivers to enhance their skills. A virtual reality driving simulator further enhances the immersive experience for the users. Additionally, the lightweight setup is a more cost effective and portable solution.
The goal of the simulator is to teach driving theories and road awareness in a visual way through scenarios. The simulator provides a realistic, experiential and immersive driving experience, without being physically on the road. Learners will also have the opportunity to practice defensive driving in a safe and controlled environment. This prototype is an experimentation and exploration of unity 3D.
- 18 years old and above
- Does not have a car to practice driving in real life
- Busy work-life and prefers learning during their own free time
- Wants to practice road awareness from the comfort of their own home
- Varying degrees of driving experience, including those without basic theories
The driving simulator uses Unity development game engine. Unity provides 2D and 3D platforms to create video games. Unity uses C# language for programming and is chosen because of its wide community, resources, has a free personal license and supports games that incorporate Virtual Reality (VR). To create a lifelike environment fast, Google Map Tiles API is used in conjunction with Cesium to procedurally generate the world map. Cesium is an open-source software that helps to combine its 3D geospace capability and 3D tiles with Unity. Google Map Tiles API provides high resolution photorealistic 3D tiles which are used to generate the environment.
- 3D environment (Singapore settings) built with Cesium Google Map Platform Photorealistic 3D Tiles and Blender
- Immersive driving experience with VR Headset - Oculus Quest 2
- Realistic vehicle controls with steering wheel and accelerator pedals.
- CGF car on road to simulate traffic conditions
- Simulating weather conditions
Car Controls
UserCarControls.cs
CGF Vehichle (the NPC Cars)
vehicleAIController.cs (for car movement), Waypoint.cs (to create waypoints and its attributes), carNode.cs (child of Waypoint.cs, it is specifically for vehicle node only), generateWaypoint.cs and WaypointManagerWindow.cs (to draw the route that cars will follow)
Note: To use generateWaypoint.cs and WaypointManagerWindow.cs, under Toolbar in Unity, hover for dropdown and select, it should open as a window in Unity
Traffic Light
TrafficLight.cs (this is just to change traffic light color between red, amber and green), TrafficLightController.cs (to control multiple traffic lights at once for areas like cross junction, all timing syncronisation should be done here)
- Enabling Action Map in Script to Read Input Values
- Input Controls Document
- Set up Input Actions in Unity