Unity-based Simulation Scenarios to Study Driving Performance
David González-Ortega, Francisco J. Díaz-Pernas,
Mario Martínez-Zarzuela and Míriam Antón-Rodríguez
Department of Signal Theory and Communications and Telematics Engineering,
Telecommunications Engineering School, University of Valladolid, Valladolid, Spain
Keywords: Driving Simulation, Unity, Driving Learning, Driving Efficiency.
Abstract: In this paper, we present two 3D driving simulation scenarios and a vehicle model developed to analyze
driving efficiency and safety. The scenarios include different roads, traffic, and events so that drivers can
acquire driving competences and their performance can be tested. They were developed with Unity game
engine, which allows to create 2D and 3D games and applications and to export them to many different
platforms. The first scenario is urban with varied roads, crossroads controlled by traffic lights, and
roundabouts. The second scenario is interurban with different road sections connected by roundabouts. The
vehicle engine has been modeled setting the dependency between engine torque and rpm and the
dependency of each gear and speed on fuel consumption. Automatic or manual gear shifting can be selected.
During a simulation, the speed, rpm, gear, consumption, and traffic offences are showed in real time and
stored in files for further processing. Seven people drove in the scenarios and their stored data enabled us to
analyze differences in driving performance between them. The simulator was ranked positively by all the
participants regarding ease of interaction, similarity to real driving, and usefulness for driving learning.
1 INTRODUCTION
Event simulation is being increasingly used in many
fields. With the advance of technology, it is more
feasible to create very realistic environments that let
users an easy immersion in the simulators, achieving
best results in their use. These simulators can speed
up the process of acquisition of basic skills and are
configured as tools of great learning potential in
many fields.
Particularly, driving simulators achieve driver
learning and reeducation of drivers through the
inclusion of varied routes and situations where
safety can be compromised depending on the driver
behavior. Many companies such as Renault are
investing large amounts of money in driving
simulators (Munir et al, 2017). Simulation can let
future drivers get used to many situations that take
place rarely but that can result in traffic accidents,
such as landslides, animals in the middle of the road,
or a previous accident. The development of
simulation environments is important not only for
their utility to drivers but also because it allows to
recover data that can be analyzed to study different
aspects that have influence on traffic safety. This
data can also be used to discover shortages in the
education and abilities of drivers that can lead to
dangerous situations. Simulators can help to
maintain the decreasing trend in the rate of traffic
casualties present in the last years in the European
Union. 26 out of the 28 EU countries have decreased
the number of traffic casualties with respect to 2010
(Mobility Transport. European Comission, 2018).
In this work, two driving simulation scenarios
with different road sections and events and a vehicle
model to analyze the driving efficiency and safety
are presented. The scenarios and the vehicle model
have been developed with the Unity game engine
(Unity, 2018). Unity is one of the most used engines
in low budget projects and allows to develop 2D and
3D games and graphical applications. Besides, it is
possible to export the applications to 27 different
platforms including PC, mobile, and console ones.
An important feature of the last version of Unity is
its integration with virtual reality platforms such as
Oculus Rift.
The driving simulator that integrates the two
scenarios shows in real time and stores in files for
further processing, not only information about the
driver vehicle (position, speed, rpm (revolutions per
González-Ortega, D., Díaz-Pernas, F., Martínez-Zarzuela, M. and Antón-Rodríguez, M.
Unity-based Simulation Scenarios to Study Driving Performance.
DOI: 10.5220/0006914601830189
In Proceedings of 8th Inter national Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH 2018), pages 183-189
ISBN: 978-989-758-323-0
Copyright © 2018 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
183
minute), gear, and fuel consumption), but also the
traffic offences committed during simulation. This
information can be used to analyze the different
simulations fulfilled by the drivers so that conclusions
can be drawn about their driving competence.
The rest of the paper is organized as follows.
Section 2 presents the state of the art on driving
simulators. Afterwards, Section 3 explains the
developed driving simulation scenarios and user’s
vehicle. Section 4 details the obtained experimental
results and, finally, Section 5 draws the main
conclusions about the presented work.
2 DRIVING SIMULATORS
A simulator is a hardware and software configure-tion
in which, through calculation algorithms, the behavior
of a particular process or physical system is replicat-
ed. In this process, the real situations are substituted
by other artificially created that can serve to acquire
competences that will be transferred later to a real life
situation in an effective way. In the education field,
simulators are means not only for concepts formation
and knowledge building but also for the application of
them to new contexts that people, for several reasons,
cannot have access to from the methodological
context where their learning is developed. Simulators
have educational advantages such as the providing of
open learning environments based on real models and
that users adopt an active role, turning themselves into
the builders of learning from their own experience. To
name some examples, simulation has been applied to
fields so different as power engineering (Zimmerman
et al., 2011) and spine surgery (Ryu et al., 2017)
education with satisfactory results.
All the formerly mentioned is clearly applicable
to driving simulators. Although there are driving
simulators aimed to the learning of future drivers
(DriveSim, 2018) from which the user can learn to
drive from scratch, most of these simulators aim to
entertain leaving aside the development of
competences towards responsible driving. A large
number of users, including race drivers, highlight
that these types of simulators usually provide a very
realistic experience and very detailed circuits that
lets them know and adapt to new competitions, in a
way that the routes are known before doing them for
real (iRacing, 2018). Simulators such as iRacing,
Project Cars, Gran Turismo, or Forza Motosport are
recognized worldwide for their fidelity in the
representation of racing vehicles’ behavior.
Concerning these kind of simulators, (Stinchcombe
et al., 2017) found a statistically significant
association between video game experience and
risk-taking behaviors (large values of speed and
crashes) when the participants had to drive in a
scenario developed specifically to assess a particular
skill such as handling. As a consequence, simulators
for learning and assessing safe and efficient driving
should be carefully designed to reinforce proper
driving behaviors through the provision of feedback.
In the last years, driving simulators have been
used in many research studies for a wide variety of
purposes. With them, drivers’ reaction to different
situations, which cannot be replicated in a real road,
can be evaluated (Bham et al., 2010). Their
suitability to assess the behavior of drivers and as a
means to learn safe and efficient driving skills has
been shown. (Sullman et al., 2015) showed the
potential of the training in efficient driving skills
with a simulator for bus drivers. (Jamson et al.,
2015) studied with a simulator the tradeoff between
driving efficiency and safety using systems
embedded in the vehicle to advise the driver about
the use of the throttle pedal. They showed that
efficiency can be improved using these systems.
Simulators were also used to compare younger and
older driver performance (Stinchcombe et al., 2010)
and to correlate driver cognitive measures and driving
performance (Yamin et al., 2016). (Hooft van
Huysduynen et al., 2018) used the Multidimensional
Driving Style Inventory (MDSI) to study the relation
between self-reported driving style and the driving
behavior in a simulator, concluding that there is a
modest correlation between them.
In driving simulators, scenarios to analyze the
level of driving efficiency and safety, the relation
between them, and the results produced as a function
of them can be included. When a person sees itself
in a real driving environment such as a city with
heavy traffic or a complex junction, he may think
that he will be unable to face that challenge.
Particularly, there are people suffering from
amaxophobia, characterized by the fear of vehicles
or travelling in a vehicle (Gossling, 2017). Driving
simulators enable users to face many of these
problems in a virtual environment without
endangering the user or other drivers. Simulators
enable the users to face problems and to obtain
driving skills to overcome these problems, in such a
way that these skills can be applied when they face
similar situations in a real environment. The users
can also get used to the vehicle controls through
simulations, manipulating them with the steering
wheel, pedals, and gear lever similarly to in a real
vehicle. For that purpose, different types of
peripherals can be used, from controls to complete
SIMULTECH 2018 - 8th International Conference on Simulation and Modeling Methodologies, Technologies and Applications
184
driving cabin, including devices such as Logitech
G27. Obviously, simulators enable users to repeat
simulations in a scenario and to face certain events
many times. Besides, it is possible to simulate real
situations that would be practically impossible to do
voluntarily in a real environment. Situations such as
a vehicle stopped in the middle of a road or a
pedestrian crossing a road unexpectedly are events
that can be replicated in a simulator easily. This will
enable simulator users to be better prepared for
unusual situations that can find in the future.
Simulators can also be used to do studies about how
certain agents, such as fatigue, physical or
psychological state of the driver, medicine, drugs, or
alcohol consumption or age, can influence driving
capacity significantly. Moreover, they can be used to
study the influence of Advanced Driver Assistance
Systems (ADAS) (Gonçalves et al., 2014), or of the
presence of children in the vehicle (Olaverri-
Monreal et al., 2014), on driving performance easily
and without danger. Lastly, it is important to
mention that simulators can gather data in a simple
way. Thus, users can have access to information of
the fulfilled simulations and observe their evolution.
This enables drivers to see their mistakes and
committed traffic offences and what aspects they
should improve to avoid them in the future.
3 DEVELOPED DRIVING
SIMULATION SCENARIOS
AND USER’S VEHICLE
We have developed two 3D driving simulation
scenarios using the Unity game engine with a view
to covering a wide range of environments and
situations that drivers should know to react properly.
We have also modeled the user’s vehicle. As a
peripheral input module, we have selected the
Logitech G27 device, which includes steering wheel,
clutch, brake, and throttle pedals, and gear lever.
3.1 Urban Scenario
The first scenario is urban. We have used the Road
& Traffic System plugin from the Unity Asset Store
to create the road sections and to include the traffic.
This plugin can be used to create dynamic traffic
networks in roads with one, two, and three lanes per
direction, crossroads controlled by traffic lights, and
roundabouts.
Pedestrians were included in the scenario. They
use a 3D model of a person with its linked skeleton
and animations that once applied to the 3D model
make it behave with the intended motion. There are
three different animations: Idle (standing still
pedestrian), Walk Forward (pedestrian walking
forward) and Hit (pedestrian being hit by a vehicle).
The driver is guided in the crossroads and
roundabouts to follow an established route. Fig. 1
shows a schematic view of the scenario where
sections with different lanes, 4-legged and T
crossroads and roundabouts (green circles) can be
observed. Fig. 2 shows images from this scenario. In
these images, the vision of the rear view mirror at
the top center, the current gear at the bottom center,
and the rpm meter and speedometer at the bottom
right of them can be seen.
Figure 1: Schematic view of the urban scenario.
(a)
(b)
Figure 2: Urban scenario images.
Unity-based Simulation Scenarios to Study Driving Performance
185
3.2 Interurban Scenario
The second scenario is interurban with road sections
between 0.5 and 2.5 kilometers long interconnected
with 2-lane and 3-lane roundabouts. Roundabouts
are very common in roads throughout the world as
they have replaced traditional 4-legged crossroads
(Nikitin et al., 2017) to improve traffic flow and
safety. The road sections are also of 2 types: some
have one lane per direction and others have two
lanes per direction. Fig. 3 shows a schematic view of
the scenario. Similarly to the first scenario, drivers
are guided with signs informing, while approaching
a roundabout, about the exit they have to take. The
pedestrians were also included similarly to the first
scenario. The traffic vehicles were included by
applying two scripts to them, one for the car as a
whole and one for each wheel without using the
Road & Traffic System to control their behavior so
that adaptation to interurban traffic can be better
achieved. Each vehicle has to know if there are other
vehicles in the surroundings to change its speed or
lane accordingly. Fig. 4 shows some images from
the scenario. Fig. 4(c) shows an image where the
scenario projected on a screen and the Logitech G27
steering wheel can be observed.
3.3 User’s Vehicle
Regarding the engine modeling of the user’s vehicle
(with internal combustion engine), the dependency
between the engine torque and horsepower and rpm
were set as shown in Fig. 5. Other factors to
compute the overall force of the engine have to be
set, such as differential ratio, gear ratio (per each
gear) and wheel rpm. To compute the fuel
consumption, its dependency on the current gear and
speed was set as shown in Fig. 6. It is possible to
select manual or automatic gear shifting before the
beginning of a simulation. There are several cameras
that can be selected by the user to change the field of
view. One camera is outside the vehicle as shown in
Fig. 4(c). Other camera is inside the vehicle, as
shown in Figs. 4(a) and 4(b), to have a view similar
to the driver in a real vehicle. With this view, the
vision of the rear view mirror of a vehicle is
included. Besides, the user can turn the view left or
right pressing particular buttons on the steering
wheel. While Fig. 4(a) shows the frontal view inside
a car while approaching a roundabout, Figs. 7(a) and
7(b) show the view turning left and the view turning
right that a user had in nearby places during a
simulation, respectively.
Figure 3: Schematic view of the interurban scenario.
(a)
(b)
(c)
Figure 4: Interurban scenario images.
SIMULTECH 2018 - 8th International Conference on Simulation and Modeling Methodologies, Technologies and Applications
186
In each route in a scenario, the simulator stores
for further processing the position (x, y, and z
coordinates), the current and average speed, covered
distance, rpm, current gear, and current, average,
and total fuel consumption every second.
Figure 5: Graphs of the engine torque and horsepower as a
function of rpm of the modeled vehicle.
Figure 6: Graphs of the fuel consumption as a function of
the current gear and speed of the modeled vehicle.
4 EXPERIMENTAL RESULTS
Seven people drove in the driving simulation
scenarios ranging from 21 to 42 years old. The
participants drove in the first scenario twice, firstly
with automatic gear shifting and secondly with
manual gear shifting to analyze the influence of the
different gear shifting. They drove in the second
scenario with manual gear shifting. Figs. 8 and 9
show the average speed and the average fuel
consumption of the users in the three simulations,
respectively. As expected, the average speed is much
lower in the urban scenario, where there were small
differences in the routes using automatic and manual
gear shifting. Five out of the seven participants
drove a bit faster with automatic gear shifting than
manual gear shifting in the first scenario as they did
not have to pay attention to the gear shifting.
Regarding the fuel consumption, it was higher in the
urban scenario as expected and five out of seven
participants has a higher fuel consumption with
manual gear shifting as they did not change gear as
efficiently as using automatic change.
(a)
(b)
Figure 7: Interurban scenario images.
Figs. 10 and 11 show the rpm, standard deviation
of rpm, and average consumption using manual gear
shifting for the urban and interurban scenario,
respectively. The standard deviation of rpm is much
larger in the urban scenario as expected due to
frequent stops in it. In both scenarios, there is a
correlation between large values of rpm, the
standard deviation of rpm and average consumption
as economic driving implies soft driving trying to
keep the value of rpm low and constant.
While User #1 had both the lowest value of
standard deviation of rpm and average consumption
in the urban scenario, he clearly decreased his
driving performance in the interurban scenario
comparatively as he had both the second largest
value of standard deviation of rpm and average
consumption in it. The rest of the users had
comparative values of the standard deviation of rpm
quite similar in the two scenarios. User #7 was the
participant with the worst driving performance as he
had the largest value of standard deviation of rpm
and the third largest value of average consumption
in the urban scenario and had both the largest value
of standard deviation of rpm and average
consumption in the interurban scenario.
Unity-based Simulation Scenarios to Study Driving Performance
187
Figure 8: Average speed of the users in the simulations.
Figure 9: Average fuel consumption of the users in the
simulations.
Figure 10: rpm, Standard deviation of rpm, and average
consumption using manual gear shifting for the urban
scenario.
Figure 11: rpm, Standard deviation of rpm, and average
consumption using manual gear shifting for the interurban
scenario.
After using the simulator, the seven participants
were asked about their experience driving in the
scenarios. They were asked about the ease of
interaction, the similarity to real driving, and the
usefulness for driving learning, obtaining an average
score (out of 10) of 8.5, 7.5, and 7, respectively.
5 CONCLUSIONS
In this paper, two driving simulation scenarios,
which were developed with the Unity game engine,
have been presented. The simulator makes it
possible the acquisition of driving skills and the
assessment of driver performance through the
inclusion of varied road configurations, user’s
vehicle, traffic, and events so that the safety and
efficiency are affected by the driver behavior. The
continuous technological advances have enabled the
development of low-cost simulators as the presented
with realistic scenarios and events impossible to
have in a real driving environment without
endangering people or vehicles. People that took
part in the experiments driving in the simulation
scenarios highlighted the ease of interaction, realistic
experience, and usefulness for driving learning of
them. The data stored in the simulation will allow to
carry out deep comparative analysis to associate the
different drivers and their driving styles with their
0
20
40
60
80
100
User
#1
User
#2
User
#3
User
#4
User
#5
User
#6
User
#7
Scenario 1
(automatic)
Scenario 1
(manual)
Scenario 2
(manual)
0
2
4
6
8
10
12
User
#1
User
#2
User
#3
User
#4
User
#5
User
#6
User
#7
Scenario 1
(automatic)
Scenario 1
(manual)
Scenario 2
(manual)
SIMULTECH 2018 - 8th International Conference on Simulation and Modeling Methodologies, Technologies and Applications
188
safety and efficiency level, and assess the evolution
in the development of driving competence as more
drivers will use the simulator.
The simulator can be extended to new scenarios
and events and virtual reality devices. Oculus Rift
virtual reality device is planned to be integrated in
the simulator to achieve a more realistic and
immersive driving experience together with new
scenarios and different user’s vehicles regarding size
(bus, truck) and motor (electric).
ACKNOWLEDGEMENTS
This work was supported by the National
Department of Traffic (DGT) of the Ministry of the
Interior (Spain) under research project SPIP2017-
02257.
REFERENCES
Bham, G. H., Mathur, D., Leu, M., Vallati, M., 2010.
Younger drivers evaluation of vehicle mounted
attenuator markings in work zones using a driving
simulator. Transportation Letters: the International
Journal of Transportation Research, 3: 187-198.
DriveSim, 2018. Available at http://drivesimsimulator.
com/. [Accessed 17 Apr. 2018].
Gonçalves, J. S. V., Rosetti, R. J. F., Jacob, J., Gonçalves,
J., Olaverri-Monreal, C., Coelho, A., Rodrigues, R.,
2014. Testing Advanced Driver Assistance Systems
with a Serious-Game-Based Human Factors Analysis
Suite. In: Proceedings of the IEEE Intelligent Vehicles
Symposium, 13-18.
Gossling, S., 2017. The psychology of the car, Elsevier.
Amsterdam. 1st edition.
Hooft van Huysduynen, H., Terken, J., Eggen, B., 2018.
The relation between self-reported driving style and
driving behaviour. A simulator study. Transportation
Research Part F, 56: 245-255.
iRacing, 2018. Available at https://www.iracing.com/.
[Accessed 17 Apr. 2018].
Jamson, S. L., Hibberd, D. L., Jamson, A. H., 2015.
Drivers’ ability to learn eco-driving skills; effects on
fuel efficient and safe driving behaviour.
Transportation Research Part C: Emerging
Technologies, 58: 657-668.
Mobility Transport. European Comission, 2018. Available
at https://ec.europa.eu/transport/road_safety/specialist/
statistics_en# [Accessed 19 Apr. 2018].
Munir, S., Hovd, M, Fang, Z., Olaru S., Kemeny, A.,
2017. Complexity reduction in motion cueing
algorithm for the ULTIMATE driving simulator. IFAC
PapersOnLine, 50-1: 10729–10734.
Nikitin, N., Patskan, V., Savina, I., 2017. Efficiency
Analysis of Roundabout with Traffic Signals.
Transportation Research Procedia, 20: 443-449.
Olaverri-Monreal, C., Gonçalves, J., Bengler, K.-J., 2014.
Studying the Driving Performance of Drivers with
Children Aboard by Means of a Framework for
Flexible Experiment Configuration. In: Proceedings of
the IEEE Intelligent Vehicles Symposium, 7-12.
Ryu, W. H. A., Mostafa, A. E., Dharampal, N., Sharlin, E.,
Kopp, G., Jacobs, W. B., Hurlbert, R. J., Chan, S.,
Sutherland, G. R., 2017. Design-Based Comparison of
Spine Surgery Simulators: Optimizing Educational
Features of Surgical Simulators. World Neurosurgery,
106: 870-877.
Stinchcombe, A., Gagnon, S., 2010. Driving in dangerous
territory: Complexity and road-characteristics influen-
ce attentional demand. Transportation Research Part
F: Traffic Psychology and Behaviour, 13(6): 388-396.
Stinchcombe, A., Kadulina, Y., Lemieux, C., Aljied, R.,
Gagnon, S., 2017. Driving is not a game: Video game
experience is associated with risk taking behaviours in
the driving simulator. Computers in Human Behavior,
69: 415-420.
Sullman, M. J. M., Dorn, L., Niemi, P., 2015. Eco-driving
training of professional bus drivers – Does it work?
Transportation Research Part C: Emerging
Technologies, 58: 749-759.
Unity, 2018. Available at https://unity3d.com/es/
[Accessed 16 Apr. 2018].
Yamin, S., Stinchcombe, A., Gagnon, S., 2016. Deficits in
attention and visual processing but not global
cognition predict simulated driving errors in drivers
diagnosed with mild Alzheimer’s disease. American
Journal of Alzheimer’s Disease and Other Dementias,
31(4): 351-360.
Zimmerman, R. D., Murillo-Sánchez, C. E., Thomas, R. J.,
2011. MATPOWER: Steady-State Operations,
Planning, and Analysis Tools for Power Systems
Research and Education. IEEE Transactions on Power
Systems, 26(1): 12-19.
Unity-based Simulation Scenarios to Study Driving Performance
189