Skip to main content

Playing Non-embedded Card-Based Games with Reinforcement Learning

  • Conference paper
  • First Online:
Intelligent Robotics and Applications (ICIRA 2024)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 15206))

Included in the following conference series:

Abstract

Significant progress has been made in AI for games, including board games, MOBA, and RTS games. However, complex agents are typically developed in an embedded manner, directly accessing game state information, unlike human players who rely on noisy visual data, leading to unfair competition. Developing complex non-embedded agents remains challenging, especially in card-based RTS games with complex features and large state spaces. We propose a non-embedded offline reinforcement learning training strategy using visual inputs to achieve real-time autonomous gameplay in the RTS game Clash Royale (Clash Royale is a trademark of Supercell in Finland and other countries. This content is not approved or sponsored by Supercell). Due to the lack of a object detection dataset for this game, we designed an efficient generative object detection dataset for training. We extract features using state-of-the-art object detection and optical character recognition models. Our method enables real-time image acquisition, perception feature fusion, decision-making, and control on mobile devices, successfully defeating built-in AI opponents. All code is open-sourced at https://github.com/wty-yy/katacr.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://clashroyale.com/.

  2. 2.

    The dataset statistics are accurate as of May 6, 2024, and all image datasets have been open-sourced: https://github.com/wty-yy/Clash-Royale-Detection-Dataset.

  3. 3.

    Expert dataset: https://github.com/wty-yy/Clash-Royale-Replay-Dataset.

  4. 4.

    All code: https://github.com/wty-yy/katacr.

  5. 5.

    Match videos: https://www.bilibili.com/video/BV1xn4y1R7GQ.

References

  1. Berner, C., et al.: DOTA 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680 (2019)

  2. Chen, L., et al.: Decision transformer: reinforcement learning via sequence modeling. In: Advances in Neural Information Processing Systems, vol. 34, pp. 15084–15097 (2021)

    Google Scholar 

  3. Dosovitskiy, A., et al.: An image is worth 16x16 words: transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)

  4. Jocher, G., Chaurasia, A., Qiu, J.: Ultralytics YOLO (2023). https://github.com/ultralytics/ultralytics

  5. Kirillov, A., et al.: Segment anything. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4015–4026 (2023)

    Google Scholar 

  6. Kumar, A., Zhou, A., Tucker, G., Levine, S.: Conservative Q-learning for offline reinforcement learning. In: Advances in Neural Information Processing Systems, vol. 33, pp. 1179–1191 (2020)

    Google Scholar 

  7. Mnih, V., et al.: Human-level control through deep reinforcement learning. Nature 518(7540), 529–533 (2015)

    Article  MATH  Google Scholar 

  8. Radford, A., Narasimhan, K., Salimans, T., Sutskever, I., et al.: Improving language understanding by generative pre-training (2018)

    Google Scholar 

  9. Schulman, J., Wolski, F., Dhariwal, P., Radford, A., Klimov, O.: Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347 (2017)

  10. Shang, J., Kahatapitiya, K., Li, X., Ryoo, M.S.: Starformer: transformer with state-action-reward representations for visual reinforcement learning. In: Avidan, S., Brostow, G., Cissé, M., Farinella, G.M., Hassner, T. (eds.) ECCV 2022. LNCS, vol. 13699, pp. 462–479. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-19842-7_27

    Chapter  Google Scholar 

  11. Silver, D., et al.: Mastering the game of go with deep neural networks and tree search. Nature 529(7587), 484–489 (2016)

    Google Scholar 

  12. Vaswani, A., et al.: Attention is all you need. In: Advances in Neural Information Processing Systems, vol. 30 (2017)

    Google Scholar 

  13. Vinyals, O., et al.: Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature 575(7782), 350–354 (2019)

    Article  Google Scholar 

  14. Zhang, Y., et al.: Bytetrack: multi-object tracking by associating every detection box. In: Avidan, S., Brostow, G., Cissé, M., Farinella, G.M., Hassner, T. (eds.) ECCV 2022. LNCS, vol. 13682, pp. 1–21. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-20047-2_1

    Chapter  MATH  Google Scholar 

Download references

Acknowledgments

This work was supported in part by NSFC under grant No. 62125305, No. U23A20339, No. 62088102, No. 62203348.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Xuguang Lan .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wu, T., Wan, L., Wang, Y., Wan, Q., Lan, X. (2025). Playing Non-embedded Card-Based Games with Reinforcement Learning. In: Lan, X., Mei, X., Jiang, C., Zhao, F., Tian, Z. (eds) Intelligent Robotics and Applications. ICIRA 2024. Lecture Notes in Computer Science(), vol 15206. Springer, Singapore. https://doi.org/10.1007/978-981-96-0792-1_20

Download citation

  • DOI: https://doi.org/10.1007/978-981-96-0792-1_20

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-96-0791-4

  • Online ISBN: 978-981-96-0792-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics