Talk

Entity Component System vs Classic OOP in C++

  • In Russian

A game engine must process thousands of objects in real-time. Traditional OOP in C++ is not ideal for achieving the necessary flexibility and performance:

  1. Tight coupling of data and logic.
  2. Dependency management complexity.
  3. Poor data organization.

Additional C++-specific challenges include:

  1. Weak coupling via pointers: Managing pointers in a dynamic game world is complex and error-prone.
  2. Virtual table overhead: Resolving virtual table pointers hurts performance when processing thousands of polymorphic entities per frame.

These issues lead to poor performance, scalability, and development efficiency, increasing debugging time and requiring higher developer expertise, which strains tight deadlines.

This talk introduces an alternative architecture for C++ game engines: Entity Component System (ECS). ECS offers a different approach:

  1. Loose coupling and modularity: Data and logic are separated, simplifying the addition of new features without affecting existing systems. Entities are accessed via IDs instead of pointers, easing dynamic scene management.
  2. Flexibility: ECS minimizes inheritance, favoring aggregation. For example, physics can be processed independently, and custom aggregates can be constructed on-the-fly using only relevant components.
  3. Performance optimization: Components are stored in memory pools, improving cache efficiency and enabling SIMD optimizations.

The talk will cover ECS implementation in C++, touch on Data-Oriented Design (DOD), and discuss multithreading strategies. It will be relevant not just for game developers but for the wider C++ community, as it tackles an essential subject: OOP in C++, the pitfalls of the classic approach, and modern alternatives.

Speakers

Invited experts

Schedule