Skip to main content

Evolving Behaviour Tree Structures Using Grammatical Evolution

  • Chapter
  • First Online:
Book cover Handbook of Grammatical Evolution

Abstract

Behaviour Trees are control structures with many applications in computer science, including robotics, control systems, and computer games. They allow the specification of controllers from very broad behaviour definitions (close to the root of the tree) down to very specific technical implementations (near the leaves); this allows them to be understood and extended by both behaviour designers and technical programmers. This chapter describes the process of applying Grammatical Evolution (GE) to evolve Behaviour Trees for a real-time video-game: the Mario AI Benchmark. The results obtained show that these structures are quite amenable to artificial evolution using GE, and can provide a good balance between long-term (pathfinding) and short-term (reactiveness to hazards and power-ups) planning within the same structure.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 169.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    The sum of absolute differences in Cartesian coordinates.

  2. 2.

    This and all results reported in this chapter are averaged over 30 independent runs. Videos of the best controllers of some runs are available online (http://tinyurl.com/gebtMarioAI).

References

  1. C. Ryan, J.J. Collins, M. O’Neill, Grammatical evolution: evolving programs for an arbitrary language, in EuroGP 98 (1998), pp. 83–96. Available: https://doi.org/10.1007/BFb0055930

  2. J. Togelius, S. Karakovskiy, J. Koutnik, J. Schmidhuber, Super Mario evolution, in IEEE Symposium on Computational Intelligence and Games (2009), pp. 156–161

    Google Scholar 

  3. S. Karakovskiy, J. Togelius, The Mario AI benchmark and competitions. IEEE Trans. Comput. Intell. AI Games 4(1), 55–67 (2012)

    Article  Google Scholar 

  4. M. Nicolau, D. Perez-Liebana, M. O’Neill, A. Brabazon, Evolutionary behavior tree approaches for navigating platform games. IEEE Trans. Comput. Intell. AI Games 9(3), 227–238 (2017)

    Article  Google Scholar 

  5. R. Colvin, I. Hayes, A semantics for behavior trees. ARC Centre for Complex Systems (ACCS), Technical report ACCS-TR-07-01 (2007)

    Google Scholar 

  6. M. O’Neill, C. Ryan, Evolving multi-line compilable c programs, in Genetic Programming, 2nd European Workshop, EuroGP 99, Göteborg, May 26–27, 1999, Proceedings, ed. by R. Poli, P. Nordin, W.B. Langdon, T.C. Fogarty. Lecture Notes in Computer Science, vol. 1598 (Springer, Berlin, 1999), pp. 83–92. Available: https://doi.org/10.1007/3-540-48885-5_7

  7. J. M. Swafford, M. O’Neill, M. Nicolau, A. Brabazon, Exploring grammatical modification with modules in grammatical evolution, in European Conference on Genetic Programming, EuroGP 2011, Torino, April 27–29, 2011, Proceedings, ed. by S. Silva, J.E. Foster, M. Nicolau, P. Machado, M. Giacobini. Lecture Notes in Computer Science, vol. 6621 (Springer, Berlin, 2011), pp. 310–321

    Google Scholar 

  8. E. Murphy, M. Nicolau, E. Hemberg, M. O’Neill, A. Brabazon, Differential gene expression with tree-adjunct grammars, in Parallel Problem Solving from Nature - PPSN XII, 12th International Conference, Taormina, September 1–5, 2012, Proceedings, ed. by C.A.C. Coello, V. Cutello, K. Deb, S. Forrest, G. Nicosia, M. Pavone. Lecture Notes in Computer Science, vol. 7491 (Springer, Berlin, 2012), pp. 377–386

    Google Scholar 

  9. E. Galván-López, D. Fagan, E. Murphy, J.M. Swafford, A. Agapitos, M. O’Neill, A. Brabazon, Comparing the performance of the evolvable PiGrammatical evolution genotype-phenotype map to grammatical evolution in the dynamic Ms. Pac-Man environment, in IEEE Congress on Evolutionary Computation (2010), pp. 1587–1594

    Google Scholar 

  10. R. Harper, Co-evolving Robocode tanks, in GECCO, Genetic and Evolutionary Computation Conference, ed. by N. Krasnogor et al. (ACM, New York, 2011), pp. 1443–1450

    Google Scholar 

  11. R. Harper, Evolving Robocode tanks for Evo Robocode. Genet. Program Evolvable Mach. 15(4), 403–431 (2014)

    Article  Google Scholar 

  12. J.E. Murphy, M. O’Neill, H. Carr, Exploring grammatical evolution for horse gait optimisation, in EuroGP 2009, ed. by L. Vanneschi, S. Gustafson. Lecture Notes in Computer Science, vol. 5481 (Springer, Berlin, 2009), pp. 183–194

    Google Scholar 

  13. N. Shaker, M. Nicolau, G. Yannakakis, J. Togelius, M. O’Neill, Evolving levels for super mario bros using grammatical evolution, in IEEE Conference on Computation Intelligence and Games, CIG 2012, Granada, September 11–14, 2012, Proceedings (2012), pp. 304–311

    Google Scholar 

  14. N. Shaker, G.Y.J. Togelius, M. Nicolau, M. O’Neill, Evolving personalised content for super mario bros using grammatical evolution, in AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, AIIDE-12, 8th Conference, Stanford, October 8–12, 2012, Proceedings (AAAI, Palo Alto, 2012), pp. 75–80

    Google Scholar 

  15. S. Bojarski, C.B. Congdon, REALM: a rule-based evolutionary computation agent that learns to play Mario, in IEEE Conference on Computational Intelligence and Games (2010), pp. 83–90

    Google Scholar 

  16. E.R. Speed, Evolving a Mario agent using cuckoo search and softmax heuristics, in International IEEE Consumer Electronics Society’s Games Innovations Conference (ICE-GIC) (2010), pp. 1–7

    Google Scholar 

  17. N.C. Hou, N.S. Hong, C.K. On, J. Teo, Infinite Mario Bross AI using genetic algorithm, in IEEE Conference on Sustainable Utilization and Development in Engineering and Technology (STUDENT) (2011), pp. 85–89

    Google Scholar 

  18. A.M. Mora, J.J. Merelo, P. García-Sánchez, P.A. Castillo, M.S. Rodríguez-Domingo, R.M. Hidalgo-Bermúdez, Creating autonomous agents for playing super Mario bros game by means of evolutionary finite state machines. Evol. Intell. 6(4), 205–218 (2014)

    Article  Google Scholar 

  19. J.-J. Tsay, C.-C. Chen, J.-J. Hsu, Evolving intelligent Mario controller by reinforcement learning, in International Conference on Technologies and Applications of Artificial Intelligence (TAAI) (2004), pp. 266–272

    Google Scholar 

  20. H. Handa, Dimensionality reduction of scene and enemy information in Mario, in IEEE Congress on Evolutionary Computation (2011), pp. 1515–1520

    Google Scholar 

  21. E.J. Jacobsen, R. Greve, J. Togelius, Monte Mario: platforming with MCTS, in GECCO, Genetic and Evolutionary Computation Conference (2014), pp. 293–300

    Google Scholar 

  22. J. Liu, J. Togelius, D. Perez-Liebana, S.M. Lucas, Evolving game skill-depth using general video game ai agents, in IEEE Conference on Evolutionary Computation (2017)

    Google Scholar 

  23. K. Kunanusont, R.D. Gaina, J. Liu, D. Perez-Liebana, S.M. Lucas, The N-tuple bandit evolutionary algorithm for automatic game improvement, in IEEE Conference on Evolutionary Computation (2017)

    Google Scholar 

  24. A. Champandard, M. Dawe, D.H. Cerpa, Behavior trees: three ways of cultivating strong AI, in Game Developers Conference. Audio Lecture (2010)

    Google Scholar 

  25. D. Isla, Managing complexity in the Halo 2 AI system, in Game Developers Conference (2005)

    Google Scholar 

  26. L. McHugh, Three approaches to behavior tree AI, in Game Developers Conference (2007)

    Google Scholar 

  27. M. Mateas, A. Stern, Managing intermixing behavior hierarchies, in Game Developers Conference (2004)

    Google Scholar 

  28. C.-U. Lim, R. Baumgarten, S. Colton, Evolving behaviour trees for the commercial game DEFCON, in EvoApplications 2010, vol. 6024 (Springer, Berlin, 2010), pp. 100–110

    Google Scholar 

  29. J.R. Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection (Complex Adaptive Systems), 1st edn. (A Bradford Book, London, 1992)

    MATH  Google Scholar 

  30. A. Klöckner, Behavior trees for UAV mission management, in INFORMATIK 2013: informatik angepasst an Mensch, Organisation und Umwelt (2013), pp. 57–68

    Google Scholar 

  31. M. Colledanchise, P. Ögren, How behavior trees modularize hybrid control systems and generalize sequential behavior compositions, the subsumption architecture, and decision trees. IEEE Trans. Robot. 33(2), 372–389 (2017)

    Article  Google Scholar 

  32. I. Millington, J. Funge, Artificial Intelligence for Games (CRC Press, London, 2016)

    Google Scholar 

  33. M. Nicolau, Automatic grammar complexity reduction in grammatical evolution, in GECCO, Genetic and Evolutionary Computation Conference Workshops (2004)

    Google Scholar 

  34. R. Harper, GE, Explosive grammars and the lasting legacy of bad initialisation, in IEEE Congress on Evolutionary Computation (2010), pp. 2602–2609

    Google Scholar 

  35. N.J. Nilsson, Artificial Intelligence, A New Synthesis (Morgan Kaufmann Publishers, San Francisco, 1998)

    MATH  Google Scholar 

  36. A. Champandard, Behavior trees for Next-Gen game AI, in Game Developers Conference. Audio Lecture (2007)

    Google Scholar 

  37. M. Nicolau, I. Dempsey, Introducing grammar based extensions for grammatical evolution, in IEEE Congress on Evolutionary Computation (2006), pp. 2663–2670

    Google Scholar 

  38. M. Nicolau, D. Costelloe, Using grammatical evolution to parameterise interactive 3D image generation, in EvoApplications 2011. Lecture Notes in Computer Science, vol. 6625 (Springer, Berlin, 2011), pp. 374–383

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Diego Perez-Liebana .

Editor information

Editors and Affiliations

Appendix: Actions, Conditions, Filters and Sub-trees for Mario

Appendix: Actions, Conditions, Filters and Sub-trees for Mario

This section contains tables with the actions, conditions, filters and sub-trees used by the approaches described in this chapter to evolve Behaviour Trees. Note that some actions and conditions can be analogous in both the controllers with and without A* (i.e. IsBreakableUp vs. UnderBrick); they are, however, different: while the A* version checks the nodes in the graph, the no-A* implementation needs to analyse the contents of each cell. Also, note that actions use the terms left and right, which imply movement, while conditions use ahead (for right) and back (for left). Entries marked with a † denote sub-trees that have an analogous left (or back) variant (Tables 4 and 5).

Table 4 Filters available to the GE to evolve a BT
Table 5 Conditions, actions and sub-trees available to the GE to evolve a BT

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Perez-Liebana, D., Nicolau, M. (2018). Evolving Behaviour Tree Structures Using Grammatical Evolution. In: Ryan, C., O'Neill, M., Collins, J. (eds) Handbook of Grammatical Evolution. Springer, Cham. https://doi.org/10.1007/978-3-319-78717-6_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-78717-6_18

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-78716-9

  • Online ISBN: 978-3-319-78717-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics