IDLED Survival Game Engine: How It Works

Creating a custom game engine is both a challenge and an opportunity to have full control over the development process.

Creating a custom game engine is both a challenge and an opportunity to have full control over the development process.

30 December 2024

The IDLED Survival Game Engine: How It Works

Creating a custom game engine is both a challenge and an opportunity to have full control over the development process. For IDLED Survival, I decided to build a custom engine to bring my vision to life. Here, I'll explain how the engine is structured, the problems it solves, where it excels, and where there is room for improvement.

Core Components of the Engine

The IDLED Survival game engine was built from scratch using TypeScript and Vue 3 for the interface. Here are the key components of the engine:

  1. Rendering System The engine processes the visualization of game objects through custom algorithms optimized for browsers and mobile devices. The primary goal is to ensure stable performance, even with a large number of objects on the screen.
  2. Collision System I implemented a custom algorithm for handling collisions between characters, enemies, and objects by checking hitbox overlaps. This algorithm is not only high-performing but also easily scalable.
  3. Event Processing The event system handles interactions between game elements. For example, it triggers animations during collisions, applies buffs, or deals damage. All events are sequenced and processed in strict order to prevent bugs.
  4. State Management By integrating Pinia (a Vuex alternative), I implemented centralized state management. This makes it easy to track player progress, active buffs, and enemy parameters.
  5. Shaders and Animations The engine uses custom shaders to create visual effects such as hit flashes or glows around buffs. Animations are also handled by the engine, ensuring their synchronization with game events.

Problems the Engine Solves

  1. Performance Optimization One of the engine’s main tasks is maintaining stable performance across all devices. This is achieved through multithreaded calculations, simplified shaders, and adaptive rendering. For example, secondary effects are disabled on lower-end devices.
  2. Flexibility and Scalability The engine easily adapts to new mechanics. For instance, adding new enemies or buffs doesn’t require significant code changes since the architecture was designed to be modular from the start.
  3. Integration with External Services Beyond the game itself, the engine handles interactions with a Telegram bot using Node.js and Telegraf. This enables players to receive notifications, share progress, and participate in polls.

Advantages

  1. Full Control A custom engine gives me the freedom to make changes at any time without being constrained by the limitations of third-party solutions.
  2. High Performance With tailored solutions, I minimized delays, even in the later stages of the game.
  3. Modularity Each part of the engine — rendering, event processing, collisions — is an independent module that can be improved and expanded.

Disadvantages

  1. Time-Consuming Development Building an engine from scratch requires significant time investment. Most of the game’s development time was spent on this.
  2. Complex Maintenance A custom engine demands a deep understanding of the entire architecture, making it harder to onboard new developers.

Unique Features

One of the key features is the flexibility of the event system. For example, players can receive random buffs that are applied instantly or enhance their character through activatable cards. The engine manages these processes through a unified queue, preventing conflicts.

The collision system is also unique. It supports dynamic hitbox adjustments based on character or enemy animations, making gameplay more realistic.

Scalability

Thanks to its modular architecture, the engine scales easily. For example, I plan to add a cooperative mode, and the engine is already prepared for integrating network capabilities. There is also room for creating new game modes without overhauling existing code.

Conclusion

The IDLED Survival game engine has been a crucial part of the project’s success. It combines high performance, flexibility, and scalability. Despite the challenges of development and maintenance, the custom engine gave me the freedom to bring bold ideas to life. In the future, I plan to continue improving and adapting it to meet new challenges.

Thank you for being with us! Join the IDLED Survival community: Telegram Group.