Joshua Anderson Innovative Navigation Artificial Intelligence For
Total Page:16
File Type:pdf, Size:1020Kb
Joshua Anderson Innovative Navigation Artificial Intelligence for Motor Racing Games This is a digitised version of a dissertation submitted to the University of Bedfordshire. It is available to view only. This item is subject to copyright. INNOVATIVE NAVIGATION ARTIFICIAL INTELLIGENCE FOR MOTOR RACING GAMES By Joshua Anderson A thesis submitted to the University of Bedfordshire, in fulfilment of the requirements for the degree of Masters of Science by Research May 2016 Abstract Motor racing games are pushing the boundaries of realism and player experience. Artificial Intelligence (AI) allows developers to create believable opponents. By getting their AI to follow a racing line that is similar to that taken by real racing drivers, developers are able to create a sense that the AI racers are trained drivers. This paper identifies two methods used in the field: the sector based system and the sensor based system. The sector based approach offers two or more pre- determined lines for the AI to follow, with added logic allowing the AI to judge when to switch between lines. The sensor method is able to guide AI vehicles around tracks with sensors, offering more possible behaviours and lines. After implementation, the strengths and weaknesses of both methods are realised. The planning and development of a hybrid system was based on these findings. The resulting system is able to produce a more believable line for the AI. With the setting up process of a race track the sector method taking a long time, exploration into tool development is conducted to reduce the process. The subsequent tool reduced the time needed to set up a track, providing results similar to the old method. i Acknowledgements I would like to acknowledge my Director of Studies Rob Manton for the advice and guidance given, as well as keeping me on task throughout the project. Without this advice, this thesis wouldn’t be in the stage it is today. Acknowledgement is also due to Hong Qing Yu (Harry) for being my second supervisor, and providing feedback this thesis. Acknowledgement goes to my parents Neil and Doreen Anderson, for the outstanding support shown to me, especially during the most difficult of times. Without the encouragement shown by these individuals, the motivation needed to complete this paper would have been lost, and ultimately, never completed. I would also like to acknowledge Zachary Cohen, Lionel David, Grigor Todorov and Yi Zu (Joey) for the support given to me during times where it was needed the most. Extra acknowledgement is given to Zachary and Joey who volunteered to take part in a testing process of the project, with the results produced were critical was evaluation of a specific part of research. Finally, I would like to acknowledge the University of Bedfordshire for funding this degree through the Jubilee Scholarship, and for allowing me to continue on from my previous three years of studying. Without this, this research project would not have been possible. ii Table of Contents Abstract .....................................................................................................................i Acknowledgements .................................................................................................. ii Table of Contents .................................................................................................... iii List of Figures ....................................................................................................... viii Chapter 1 – Introduction ......................................................................................... 1 1.1 – The Problem ............................................................................................... 1 1.2 – Aim and Objectives ..................................................................................... 1 1.3 – Motivation for Research ............................................................................. 2 1. 4 – Research Question ..................................................................................... 2 1.5 – Adopted Methodologies ............................................................................. 2 Chapter 2 – Literature Review ................................................................................ 4 2.1 - Introduction ................................................................................................. 4 2.2 - Introduction to Artificial Intelligence ......................................................... 4 2.2.1 – Pretending to be human ....................................................................... 4 2.2.2 – Importance of AI outside of Single-player .......................................... 4 2.3 – Background to Motorsport ......................................................................... 6 2.3.1 – Racing Line .......................................................................................... 6 2.3.2 – Cornering and Apexes ......................................................................... 7 2.3.3 – Other Important Terminology .............................................................. 7 2.4 - Importance of Artificial Intelligence in Motor Racing Games ................... 8 2.4.1 – Track AI ............................................................................................... 8 2.4.2 – Race Control AI ................................................................................... 9 2.5 – Current Research into Motor racing games .............................................. 10 2.5.1 – Player perception and interaction of the game world ........................ 10 iii 2.5.2 – Procedural Track generation .............................................................. 11 2.5.3 – Artificial Intelligence ......................................................................... 13 2.6 - Identified Racing Line Methods ................................................................ 14 2.6.1 - Sector Based........................................................................................ 15 2.6.2 - Sensor Based ....................................................................................... 16 2.7 – Overview of Artificial Intelligence in Racing Games .............................. 17 2.7.1 – Historical Development...................................................................... 17 2.7.2 – Track racing vs. Open World ............................................................. 20 2.7.3 – AI and Online Multiplayer ................................................................. 21 2.7.4 – AI learning from the Player ................................................................ 22 Chapter 3 – Planning the Hybrid System .............................................................. 23 3.1 – Introduction ............................................................................................... 23 3.2 – Implementing Current Racing line methods ............................................. 23 3.2.1 - Sector Based Implementation ............................................................. 23 3.2.2 - Sensor Based Implementation ............................................................ 25 3.2.3 - Comparing the Racing Lines .............................................................. 29 3.3 - User Racing Lines ..................................................................................... 32 3.4 - Reading the Racing Lines .......................................................................... 33 3.4.1 – Experienced Players (Racing games) .................................................. 34 3.4.2 – Experienced Players (Non racing games) ........................................... 36 3.4.3 – Inexperienced Players ........................................................................ 38 3.4.4 – Comparing the groups ........................................................................ 41 3.5 - Requirements for the Hybrid System ........................................................ 46 3.5.1 - System Set-Up .................................................................................... 46 3.5.2 - Path finding method ............................................................................ 46 iv 3.5.3 - Behaviours .......................................................................................... 47 3.5.4 - Full List of requirements .................................................................... 48 Chapter 4 – Developing the Hybrid System ......................................................... 49 4.1 – Introduction .............................................................................................. 49 4.2 – Setting up the track for the `Hybrid System ............................................. 49 4.3 – Sector Based System implementation ...................................................... 50 4.3.1 – Setting up the system – Comparison.................................................. 50 4.3.2 – Adjusting to the Sub Interfaces .......................................................... 52 4.4 – Sensor Based System implementation...................................................... 54 4.4.1 – Transferring the Sensor system over ................................................. 54 4.4.2 – Setting up the track ............................................................................ 55 4.4.3 – Ensuring the system was ready .......................................................... 55 4.5 – Getting the two systems to co-exist .........................................................