Applying Genetic Algorithms for the Improvement of an Autonomous Fuzzy Driver for Simulated Car Racing

  • Mohammed Salem
  • Antonio Miguel Mora
  • Juan Julian Merelo Guervós
  • Pablo García-Sánchez
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 855)


Games offer a suitable testbed where new methodologies and algorithms can be tested in a near-real life environment. For example, in a car driving game, using transfer learning or other techniques results can be generalized to autonomous driving environments. In this work, we use evolutionary algorithms to optimize a fuzzy autonomous driver for the open simulated car racing game TORCS. The Genetic Algorithm applied improves the fuzzy systems to set an optimal target speed as well as the instantaneous steering angle during the race. Thus, the approach offer an automatic way to define the membership functions, instead of a manual or hill-climbing descent method. However, the main issue with this kind of algorithms is to define a proper fitness function that best delivers the obtained result, which is eventually to win as many races as possible. In this paper we define two different evaluation functions, and prove that fine-tuning the controller via evolutionary algorithms robustly finds good results and that, in many cases, they are able to play very competitively against other published results, with a more relying approach that needs very few parameters to tune. The optimized fuzzy-controllers (one per fitness) yield a very good performance, mainly in tracks that have many turning points, which are, in turn, the most difficult for any autonomous agent. Experimental results show that the enhanced controllers are very competitive with respect to the embedded TORCS drivers, and much more efficient in driving than the original fuzzy-controller.


Videogames Fuzzy controller TORCS Steering control Optimization Genetic algorithms 



This work has been supported in part by: Ministerio español de Economía y Competitividad under project TIN2014-56494-C4-3-P (UGR-EPHEMECH), TIN2017-85727-C4-2-P (UGR-DeepBio) and TEC2015-68752 (also funded by FEDER).


  1. 1.
    Butz, M.V., Lönneker, T.D.: Optimized sensory-motor couplings plus strategy extensions for the TORCS car racing challenge. In: Lanzi, P.L. (ed.) Proceedings of the 2009 IEEE Symposium on Computational Intelligence and Games, CIG 2009, Milano, Italy, 7–10 September 2009, pp. 317–324. IEEE (2009)Google Scholar
  2. 2.
    Cardamone, L., Loiacono, D., Lanzi, P.L.: On-line neuroevolution applied to the open racing car simulator. In: Proceedings of the Eleventh Conference on Congress on Evolutionary Computation, CEC 2009, pp. 2622–2629. IEEE Press, Piscataway (2009)Google Scholar
  3. 3.
    Elsayed, S.M.M., Sarker, R., Essam, D.L.: A genetic algorithm for solving the CEC 2013 competition problems on real-parameter optimization. In: IEEE Congress on Evolutionary Computation, CEC 2013, Cancun, Mexico, 21–23 June 2013, pp. 356–360 (2013)Google Scholar
  4. 4.
    Floreano, D., Kato, T., Marocco, D., Sauser, E.: Coevolution of active vision and feature selection. Biol. Cybern. 90, 218–228 (2004). Scholar
  5. 5.
    Goldberg, D.E.: Genetic Algorithms in search, optimization and machine learning. Addison Wesley, Reading (1989)Google Scholar
  6. 6.
    Guadarrama, S., Vazquez, R.: Tuning a fuzzy racing car by coevolution. In: Genetic and Evolving Systems, GEFS 2008. IEEE, March 2008.
  7. 7.
    Herrera, F., Lozano, M., Verdegay, J.: Automatic track generation for high-end racing games using evolutionary computation. Artif. Intell. Rev. 12(4), 265–319 (1998)CrossRefGoogle Scholar
  8. 8.
    Iancu, I.: A Mamdani Type Fuzzy Logic Controller, pp. 325–352. InTech (2012)Google Scholar
  9. 9.
    Kim, T.S., Na, J.C., Kim, K.J.: Optimization of an autonomous car controller using a self-adaptive evolutionary strategy. Int. J. Adv. Robot. Syst. 9(3), 73 (2012)CrossRefGoogle Scholar
  10. 10.
    Kolski, S., Ferguson, D., Stacniss, C., Siegwart, R.: Autonomous driving in dynamic environments. In: Proceedings of the Workshop on Safe Navigation in Open and Dynamic Environments at the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Beijing, China (2006)Google Scholar
  11. 11.
    Koutnik, J., Cuccu, G., Schmidhuber, J., Gomez, F.: Evolving large scale neural networks for vision based TORCS. In: Foundations of Digital Games. J. Koutnik, Dipartimento tecnologie innovative Istituto Dalle Molle di studi sull’intelligenza artificiale, March 2013.
  12. 12.
    Liébana, D.P., Recio, G., Sáez, Y., Isasi, P.: Evolving a fuzzy controller for a car racing competition. In: Lanzi, P.L. (ed.) Proceedings of the 2009 IEEE Symposium on Computational Intelligence and Games, CIG 2009, Milano, Italy, 7–10 September 2009, pp. 263–270. IEEE (2009).
  13. 13.
    Loiacono, D., Cardamone, L., Butz, M., Lanzi, P.L.: The 2011 simulated car racing championship @ cig-2011. TORCS news (2011).
  14. 14.
    Loiacono, D., Lanzi, P.L., Bardelli, A.P.: Searching for the optimal racing line using genetic algorithms. In: 2010 IEEE Proceedings of the Symposium on Computational Intelligence and Games (CIG). IEEE Press, Copenhagen (2010).
  15. 15.
    Neubauer, A.: A theoretical analysis of the non-uniform mutation operator for the modified genetic algorithm. In: Proceedings of the IEEE International Conference on Evolutionary Computation. IEEE Press, Indianapolis (1997).
  16. 16.
    Onieva, E., Alonso, J., Perez, J., Milanés, V.: Autonomous car fuzzy control modeled by iterative genetic algorithms. In: Fuzzy Systems, pp. 1615–1620 (2009).
  17. 17.
    Onieva, E., Pelta, D., Godoy, J., Milanés, V., Rastelli, J.: An evolutionary tuned driving system for virtual car racing games: the autopia driver. Int. J. Intell. Syst. 27, 217–241 (2012). Scholar
  18. 18.
    Saez, Y., Perez, D., Sanjuan, O., Isasi, P.: Driving cars by means of genetic algorithms. In: Rudolph, G., Jansen, T., Beume, N., Lucas, S., Poloni, C. (eds.) PPSN 2008. LNCS, vol. 5199, pp. 1101–1110. Springer, Heidelberg (2008). Scholar
  19. 19.
    Salem, M., Mora, A.M., Merelo, J.J., García-Sánchez, P.: Driving in TORCS using modular fuzzy controllers. In: Squillero, G., Sim, K. (eds.) EvoApplications 2017. LNCS, vol. 10199, pp. 361–376. Springer, Cham (2017). Scholar
  20. 20.
    SeongKim, T., Na, J.C., Kim, K.J.: Optimization of an autonomous car controller using a self-adaptive evolutionary strategy. Int. J. Adv. Robot. Syst. 9(3), 73 (2012)CrossRefGoogle Scholar
  21. 21.
    Sourceforge: Web TORCS. Web, November 2016.
  22. 22.
    Tan, C.H., Ang, J.H., Tan, K.C., Tay, A.: Online adaptive controller for simulated car racing. In: Proceedings of the IEEE Congress on Evolutionary Computation, CEC 2008, 1–6 June 2008, Hong Kong, China, pp. 2239–2245. IEEE (2008).
  23. 23.
    Varun Kumar, S.G., Panneerselvam, R.: A study of crossover operators for genetic algorithms to solve VRP and its variants and new sinusoidal motion crossover operator. Int. J. Comput. Intell. Res. 13(7), 1717–1733 (2017)Google Scholar

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Department of Computer SciencesUniversity of MascaraMascaraAlgeria
  2. 2.Department of Computer Sciences and Technology, ESITInternational University of La Rioja (UNIR)LogroñoSpain
  3. 3.Department of Architecture and Computer TechnologyUniversity of GranadaGranadaSpain
  4. 4.Department of Computer Science, ESIUniversity of CádizCádizSpain

Personalised recommendations