I used to stress about how much was too much.
I think my entity megastruct is almost 2 KB now. The biggest level in my game has around 3,000 entities, which is only about 5.8 MB of data which is nothing compared to texture data. The level is also divided into rooms, so I only simulate a couple hundred entities at any given time. Each room has its own contiguous array of entities, which makes iteration a breeze.
Even iterating over every entity to serialize the level is extremely fast. I separate things like blood splatter and body parts, since those can easily number in the thousands, and I don’t want them slowing down the main entity simulation. Also, those don't need to be serialized, so that's another win.
Agreed. It does start to look like ECS.
I wrote the article a while ago, and it turns out I didn’t actually need to pull buoyant entities out of the megastructure. With good spatial partitioning and fast entity indexing, the megastructure performs fine.
Nowadays, I separate entities from the outset when it matters. If I know I’m going to have 100,000 or more particle-like entities, I create a minimal struct and store those entities in a separate array. I do this for things like blood splatter and body parts in my game.
If I needed to separate data all the time, then ECS does start to look more appealing. In that case, I would probably focus on creating simple helpers to make allocation and iteration easier for new types.
I actually 'hot pack' data a lot less these days. It's not necessary most of the time. From what I've learned it's usually better to start with the data in a packed format rather than pack from a sparse format. If I know that I am going to simulate 100,000+ 'particle-like' entities, then I will just create a specialized struct + array.
In my game, 'body parts', 'blood splatter', and 'souls' are stored in separate arrays with their own tiny structs. Most of my entities use the mega struct approach. I only separate types in severe cases, so the work is usually minimal.
However, sometimes packing data is the first step for a refactor.
Thanks for reading the article :)
Our team is looking for a composer to create music for our game Cultist Astronaut.
We’re aiming for a heavy metal + sci-fi soundtrack with distinct themes for different cults and alien planets.
If you’re interested, please DM relevant samples (metal/industrial/sci-fi), your availability, and your rate structure.
A few examples of our cult/planet themes include:
Excoria (The Flayed): mining world turned purification cult built around ritual skin-shedding.
Sludge Haven (The Imposters): worm-parasites that stalk targets and wear corpses like borrowed bodies.
Obchodnik (The Nukes): a corporate faith that sells miracles with lethal fine print, then sells the cleanup.
@GameInfinitive
is making a "Megaman meets Doom" 2D shooter game and should be releasing a new demo soon! Here is an example of how deadly 1 crate can be!
Join the discord to help with feedback and support!
https://t.co/StG7mti9Bv
The 'Timmy Tickler' fight.
An early and silly "boss" before your face is stomped in by the other Flayed cultists.
We are looking for early playtesters for the Demo.
Join the discord and let us know you are interested.
#indiegame#gamedev
We are releasing a free demo on Steam soon for this tough as nails, action shooter.
We are looking for early playtesters. DM, respond here, or join our discord if you are interested.
#indiegame#gamedev
Who doesn’t love a little sawblade dodging, plague swimming, and zealot smashing?
Touch down on Planet Excoria and send the Flayed screaming.
#gamedev#indiegame