Evolving a TORCS Modular Fuzzy Driver Using Genetic Algorithms

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10784)


This work presents an evolutionary approach to optimize the parameters of a Fuzzy-based autonomous driver for the open simulated car racing game (TORCS). Using evolutionary algorithms, we intend to optimize a modular fuzzy agent designed to determine the optimal target speed as well as the steering angle during the race. The challenge in this kind of fuzzy systems is the design of the membership functions, which is usually done through a trial and error process, but in this paper an adapted real-coded Genetic Algorithm with two different fitness functions - has been applied to find the best values for these parameters, obtaining a robust design for the TORCS controller. The evolved drivers were tested and evaluated competing against other TORCS controllers in practice mode, without rivals, and real races. The optimized fuzzy-controllers yield a very good performance, mainly in tracks that have many turning points, which are, in turn, the most difficult for any autonomous agent. Thus, this is a real enhancement of the baseline fuzzy controllers which had several difficulties to drive in this kind of circuits.


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.
    Loiacono, D., Cardamone, L., Lanzi, P.L.: Automatic track generation for high-end racing games using evolutionary computation. IEEE Trans. Comput. Intell. AI Games 3, 245–259 (2011)CrossRefGoogle Scholar
  4. 4.
    Elsayed, S.M.M., Sarker, R., Essam, D.L.: A genetic algorithm for solving the CEC2013 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
  5. 5.
    Floreano, D., Kato, T., Marocco, D., Sauser, E.: Coevolution of active vision and feature selection. Biol. Cybern. 90, 218–228 (2004)CrossRefzbMATHGoogle Scholar
  6. 6.
    Garcia, S., Molina, D., Lozano, M., Herrera, F.: A study on the use of non-parametric tests for analyzing the evolutionary algorithms behaviour a case study on the CEC2005 special session on real parameter optimization. J. Heuristics 15–6, 617–644 (2009)CrossRefzbMATHGoogle Scholar
  7. 7.
    Goldberg, D.E.: Genetic Algorithms in Search, Optimization and Machine Learning. Addison Wesley, Reading (1989)zbMATHGoogle Scholar
  8. 8.
    Guadarrama.S, Vazquez, R.: Tuning a fuzzy racing car by coevolution. In: Genetic and Evolving Systems, GEFS 2008. IEEE, March 2008Google Scholar
  9. 9.
    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
  10. 10.
    Iancu, I.: A Mamdani type fuzzy logic controller, pp. 325–352. InTech (2012)Google Scholar
  11. 11.
    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
  12. 12.
    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
  13. 13.
    Koutnik, J., Cuccu, G., Schmidhuber, J., Gomez, F.: Evolving large scale neural networks for vision based TORCS. In: Foundations of Digital Games. Koutnik, J.: Dipartimento tecnologie innovative Istituto Dalle Molle di studi sull’intelligenza artificiale, March 2013.
  14. 14.
    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)Google Scholar
  15. 15.
    Loiacono, D., Cardamone, L., B, M., Lanzi, P.L.: The 2011 simulated car racing championship @ CIG-2011. TORCS News (2011).
  16. 16.
    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)Google Scholar
  17. 17.
    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)Google Scholar
  18. 18.
    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)Google Scholar
  19. 19.
    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)CrossRefGoogle Scholar
  20. 20.
    Onieva, E., Pelta, D.A., Alonso, J., Milanés, V., Pérez, J.: A modular parametric architecture for the torcs racing engine. In: Proceedings of the 5th IEEE Symposium on Computational Intelligence and Games (CIG 2009), pp. 256–262. IEEE Press, Piscataway (2009)Google Scholar
  21. 21.
    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). CrossRefGoogle Scholar
  22. 22.
    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). CrossRefGoogle Scholar
  23. 23.
    Sourceforge: Web TORCS, Web, November 2016.
  24. 24.
    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, June 1–6, 2008, Hong Kong, China, pp. 2239–2245. IEEE (2008)Google Scholar
  25. 25.
    Thang, H.D., Garibaldi, J.M.: A novel fuzzy inferencing methodology for simulated car racing. In: FUZZ-IEEE 2008, IEEE International Conference on Fuzzy Systems, Hong Kong, China, 1–6 June 2008, Proceedings, pp. 1907–1914. IEEE (2008)Google Scholar
  26. 26.
    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)GranadaSpain
  3. 3.Department of Architecture and Computer TechnologyUniversity of GranadaGranadaSpain
  4. 4.Department of Computer ScienceUniversity of CádizCádizSpain

Personalised recommendations