Developing a tactics engine in Godot

The Shaggy Dev
5 Jul 202311:58

Summary

TLDRIn this video, the creator dives into the design and structure of their turn-based tactics game, comparing two prototypes: a Sci-Fi pixel art game in Godot 3 and a Kaiju Clash game in Godot 4. The game features modular components, like event buses and decoupled services, to handle pathfinding, combat, and unit actions. Emphasizing a data-driven approach, actions and effects are managed as resources with flexible orchestration. The creator also explains their switch to Godot 4 for improved rendering and data handling, while addressing the importance of structure in developing a smooth game flow.

Takeaways

  • 😀 The game is a turn-based tactics game, similar to XCOM and Into the Breach, where units perform actions in a sequential order until the mission is completed or everyone is defeated.
  • 😀 The game features a lightweight node structure with high-level coordination at the top and more complex services like pathfinding and combat logic handled in separate nodes.
  • 😀 The navigation service manages pathfinding and handles interactions with the environment, such as obstacles and other units, using Godot’s built-in A* pathfinding system.
  • 😀 Combat service is responsible for answering questions about combat, such as line of sight and the nearest ally, and interacts with the navigation service for pathfinding data.
  • 😀 Combatant groups organize units by allegiance, managing turn execution and determining which units need to act next, and can accommodate multiple groups working together based on their alignment.
  • 😀 Units are structured with several controllers: AI controller, action controller, stats controller, and animation controller, each responsible for different aspects of unit behavior and actions.
  • 😀 Action components are data containers that define the action’s properties, effects, and how they interact with the unit’s stats, while effect groups sync action effects with animations to create smooth interactions.
  • 😀 Event buses are used to decouple game logic and reduce direct dependencies between objects, enabling signals to travel across distant parts of the scene tree efficiently.
  • 😀 The game uses Godot 3 for a Sci-Fi pixel art prototype and Godot 4 for a Kaiju Clash prototype, with Godot 4 chosen for better rendering of higher-resolution graphics and improved data management capabilities.
  • 😀 The game’s design prioritizes simplicity and decoupling, focusing on clear and manageable systems, avoiding deep integration or complex dependencies between nodes and systems.
  • 😀 The game's action system is flexible, with the ability to manage complex effects, such as applying damage or boosting stats, and supports custom resources for optimized performance in Godot.

Q & A

  • What is the primary genre and gameplay style of the game being developed?

    -The game is a turn-based tactics game, similar to XCOM or Into the Breach, where players control units that perform actions until the mission is complete or all units are defeated.

  • How does the author handle action points (AP) in the game?

    -The game uses a simple action point (AP) system, where units have a fixed amount of AP to perform actions like moving or attacking. The focus is on simplicity rather than complex point allocation systems.

  • What is the purpose of the 'combatant group' in the game's node structure?

    -A combatant group is used to organize and manage a collection of units that should be controlled together, like the player's team or enemy units. It manages turn execution at the team level and answers questions about the location of units and their status.

  • Why is the game split between two prototypes—Sci-Fi and Kaiju Clash—and what is the role of Godot versions in this decision?

    -The Sci-Fi prototype is built in Godot 3, while the Kaiju Clash prototype is built in Godot 4. The primary reasons for the split are workflow improvements in Godot 4, better handling of custom resources, and improved graphics scaling for the Kaiju Clash game.

  • How does the game structure combat services, and what role does pathfinding play?

    -Combat services answer questions about combat, such as enemy positions or nearest allies, and depend heavily on pathfinding. Pathfinding is handled through Godot's built-in A* algorithm and must also account for obstacles like other units or environmental conditions.

  • What is an event bus, and why is it used in this game?

    -An event bus is a system for sending signals between different parts of the application without tightly coupling the components. It's used to broadcast messages like action selection or camera movement requests, which need to reach distant nodes in the scene tree.

  • What challenges does the author face when working with Godot 3, and how does Godot 4 address those issues?

    -In Godot 3, the author struggled with managing custom resources and dynamic typing. Godot 4 improved upon this with better support for custom data types, making it easier to develop the game without needing custom plugins or workarounds.

  • How are 'actions' in the game structured, and what role do effects play in these actions?

    -Actions in the game are data containers that define the behavior of a unit, such as dealing damage or boosting defense. Each action can have multiple effects, which are resolved in sync with the action's animations, allowing for more complex behavior like applying damage at a specific animation frame.

  • How does the animation controller function within a unit's operations?

    -The animation controller handles visual animations but also coordinates when certain effects, like damage or status changes, should resolve during the animation. It ensures that actions like gunfire or movement are synchronized with the visual effects and gameplay logic.

  • What is the purpose of 'action overrides' in the unit's operation, and how do they work?

    -Action overrides are components that handle actions that don't fit neatly into predefined animation tracks. For example, movement actions have variable lengths and orientations, so the override component allows the unit to move based on specific data, while still syncing with the animation controller once movement is complete.

Outlines

plate

Dieser Bereich ist nur für Premium-Benutzer verfügbar. Bitte führen Sie ein Upgrade durch, um auf diesen Abschnitt zuzugreifen.

Upgrade durchführen

Mindmap

plate

Dieser Bereich ist nur für Premium-Benutzer verfügbar. Bitte führen Sie ein Upgrade durch, um auf diesen Abschnitt zuzugreifen.

Upgrade durchführen

Keywords

plate

Dieser Bereich ist nur für Premium-Benutzer verfügbar. Bitte führen Sie ein Upgrade durch, um auf diesen Abschnitt zuzugreifen.

Upgrade durchführen

Highlights

plate

Dieser Bereich ist nur für Premium-Benutzer verfügbar. Bitte führen Sie ein Upgrade durch, um auf diesen Abschnitt zuzugreifen.

Upgrade durchführen

Transcripts

plate

Dieser Bereich ist nur für Premium-Benutzer verfügbar. Bitte führen Sie ein Upgrade durch, um auf diesen Abschnitt zuzugreifen.

Upgrade durchführen
Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
Game DesignTactical GameplayTurn-BasedGodot 3Godot 4Game EngineModular DesignSci-Fi GameKaiju ClashPrototype DevelopmentGame Architecture
Benötigen Sie eine Zusammenfassung auf Englisch?