Update 'Step 0: ECS Architecture'

master
sadpmpk 2022-12-30 04:31:42 -05:00
parent 0a3198317c
commit 46cf360c26
1 changed files with 4 additions and 3 deletions

@ -61,6 +61,7 @@ In a game, it is expected than entities can be created and removed at any time,
One way to solve this is to implement a memory pool for the entities and components. This way, a new entity will merely draw from the pool, and a removed entity will just return to the pool. No new allocation needed. This is covered by the lecture series as well, though it is much later down the series. One way to solve this is to implement a memory pool for the entities and components. This way, a new entity will merely draw from the pool, and a removed entity will just return to the pool. No new allocation needed. This is covered by the lecture series as well, though it is much later down the series.
This is actually a premature optimisation, which is bad. However, I thought it would be fun to implement a memory pool. That's why I did it. This is actually a premature optimisation, which is bad. However, I thought it would be fun to implement a memory pool. That's why I did it.
**Note: this does not get rid of dynamic allocation usage. The library SC will make use of it for obvious reasons.** **Note: this does not get rid of dynamic allocation usage. The library SC will make use of it for obvious reasons.**
The mempool struct can be seen in `mempool.c`: The mempool struct can be seen in `mempool.c`:
``` ```
typedef struct MemPool typedef struct MemPool