John Pavlik's Writings

Not guaranteed to inform and no refunds.

Latest Posts

Developing systems with ECS

January 13th, 2025

ECS makes developing a game (or other any complicated system of systems) easier. Each system operates on a small number of components and components provide a clear data oriented interface to the system.

Read More

Entity Component System Implementation

December 17th, 2024

Implementing ECS in C++ can be done by creating an EntityComponentSystem manager class, which holds entities and archetypes. Entities represent individual objects, while archetypes represent a grouping of components. If you think about an ECS Structure of Arrays (SoA) as a 2D data structure of rows and columns, the archetype is the set of all rows in that SoA and the entity uniquely identifies a specific column. Each unique archetype maps to a different SoA structure.

Read More

Composition with ECS

December 2nd, 2024

This week I'm building on last week's post about Entity-Component-System (ECS) for game development. Composition over inheritence is the key takeaway. Composition enables building an object as a collection of behaviors, instead of inheriting behaviors from a single parent.

Read More

Entity Component System (ECS)

November 26th, 2024

Thanksgiving is this week. Time to make pineapple glazed ham, pecan pie, sweet potatoes, and cranberry sauce. In the meantime, I'm working on developing a video game and I want to talk about Entity Component Systems (ECS). ECS is based on composition over inheritance, and storing data in Structure of Arrays (SoA) over Array of Structures (AoS). Composition is easier to implement coherently, and a SoA architecture keeps relevant data together so that it's faster to load into CPU cache.

Read More