Part 4: Refactoring to SoA ECS: Bitmasks and Flat Component Arrays

When I started building Derelict Facility , my initial instinct for game actors was standard Object-Oriented design: create an Entity struct, add pointers for position, sprite, and stats, and store them in a slice ( []*Entity ). It worked fine for five entities. But as soon as I added automated doors, save terminals, and active power grids across a 1000-tile map, keeping track of separate heap…