Video Tutorial: Handle-based entity management -- Vittorio Romeo

Almost every C++ application and game deals with entity management.

Video Tutorial -- Handle-based entity management

By Vittorio Romeo

From the tutorial:

Entities are usually self-contained objects that...

  • ...store data and/or logic.
  • ...are tied a specific concept (e.g. an UI widget, or a 3D model).
  • ...we need to keep track of.
  • ...can either be alive or dead.
  • ...are extremely often used in groups.

Problem: we need to keep track of specific entity instances, and iterate on every instance. We also need to remove dead entities and add new entities.

Keeping track of specific instances is easily solved with pointers and smart pointers.
Fast-iteration of a group of objects with the same type is achieved with cache-friendly memory locality and no indirection.
Adding and removing entities stored in a cache-friendly manner invalidates existing pointers.

How can we facilitate instance tracking/addition/removal and still allow fast iteration?

In this video, we will create a generic container that stores objects in a cache-friendly way, allows to keep track of specific object instances and also allows addition and removal of entities. 
 

 

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.