Engineering a Two-Player Card Game in Godot 4 and GDScript: Architecture, Shader Design, and Artificial Intelligence Decision Making
Open Access
- 3 September 2026
- conference paper
- Published by MDPI AG in Engineering Proceedings
- Vol. 154 (1) , 37
Abstract
This paper presents a software engineering case study on designing a reusable architecture for interactive 2D card games using Godot 4 and GDScript. Rather than focusing only on a specific game implementation, the study investigates generalizable engineering patterns for managing interactive objects, visual feedback, user interaction, and decision-making systems. A unified Item/Pool architecture is introduced to represent cards and game containers through reusable abstractions, reducing duplicated logic among different scene types. The proposed design separates input handling, object management, and rule enforcement through a signal-driven architecture. A canvas-item shader pipeline demonstrates how perspective tilt and dynamic shadow effects can be achieved in a 2D environment without requiring a 3D rendering pipeline. Furthermore, a transform-aware drop detection method based on affine inverse transformation is presented to overcome interaction errors caused by rotated interfaces. For opponent behavior, a deterministic rule-based artificial intelligence model is developed using weighted suit evaluation, legal-card filtering, and context-dependent card selection strategies. The results show that Godot 4’s scene instancing, typed GDScript, shader materials, and signal system provide suitable mechanisms for building maintainable interactive applications. The discussed solutions and engineering lessons can be applied to a broader class of UI-driven 2D games beyond card games.Keywords
Funding Information
- European Union (BG-RRP-2.013-0001)
This publication has 8 references indexed in Scilit:
- DTCard: A Framework for Decision Transformers in Card GamesApplied Sciences, 2026
- A Design Implication for Casual Card Games in Game Jam2026
- The 2D Android Game ‘Bung Tomo Adventure’ uses the Finite State Machine MethodJournal of Enhanced Studies in Informatics and Computer Applications, 2026
- Artificial Intelligence in Video Game Development with Accessibilities in Godot EngineTEM Journal, 2025
- AI Audit: A Card Game to Reflect on Everyday AI SystemsProceedings of the AAAI Conference on Artificial Intelligence, 2023
- Software Architecture Design Reasoning: A Card Game to Help Novice DesignersLecture Notes in Computer Science, 2016
- Information Set Monte Carlo Tree SearchIEEE Transactions on Computational Intelligence and AI in Games, 2012
- GIB: Imperfect Information in a Computationally Challenging GameJournal of Artificial Intelligence Research, 2001