I'm a gameplay programmer
focused on developing
engaging and unique experiences!

My Resume Learn more

Entity-Component-System (ECS) : A Data-Oriented Gameplay Framework in C++ - Part 5

Now that I have an ECS Gameplay Framework in place, I'd like to implement a small boid simulation with it. Due to the number of boids these simulations usually display, I think it would be a good demonstration of an ECS use case. This is what I foresee implementing a boid simulation with ECS will need:

  1. Boid Entities, Components, Systems, and Prefabs
  2. Goal Entities, Components, Systems, and Prefabs
  3. Camera Entities, Components, and Systems

Controller Input

Along with my boid simulation, I have already incorporated controller input so that users can have an easier time interacting with the boids. With a controller they'll be able to follow the boids and move the goal around using analog input rather than digital keyboard presses. This was done by using an XInput static library project made by Sai Upadhyayula.

So far, integrating the project was very easy since it has no outside dependencies and followed the interface for Keyboard Input very closely. Something I also didn't realize was the need for implementing a Boolean gate when working directly with XInput to detect OnPressed and OnReleased events. This takes form as:

if (!aIsPressed && IsKeyPressed(ControllerKeyCodes::A))
    aIsPressed = true;

if (aIsPressed && !IsKeyPressed(ControllerKeyCodes::A))
    aIsPressed = false;

With that, I'm still planning on implementing keyboard controls for accessibility and ease of use.


In terms of the features and the interactivity of my boid simulation, this is what I plan on implementing:

  1. Digital/Analog Camera Movement using Keyboard/XInput
  2. Digital/Analog Goal Movement using Keyboard/XInput
  3. Dynamic boid behavior that responds to player movement and input
  4. Altering boid parameters using the directional pad to see how different values create different emergent behavior
  5. A minimal cityscape mesh to aid in depth perception while moving about a 3D environment
  6. A glowing and eye-catching mesh to indicate the goal that boids will be moving towards
  7. A boid mesh that will rotate towards the direction of the goal to indicate the desired movement direction


No Comments Yet.

Leave a comment