ECS Alternatives

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Even if you don't use an ECS, it is still probably a good idea to follow "composition over inheritance" as a design rule. That gives most of the non performance related benefits of ECS without ECS.

ECS is more or less just a specific optimization you can choose to do if you follow that design rule.

If it later turns out you have performance problems, you can pretty easily transition to an ECS (or directly perform the "array of struct" -> "struct of array" transformation yourself)

timseguine
Автор

I think the key idea is to know your constraints and build only what you need.

General purpose systems and large teams have very different constraints and requirements compared to a small team and highly specific system.

The real trick is building only what you need, minimally and effectively, but in such a way that it leaves room to expand in the future if necessary - you have to keep the bigger picture and future in mind even if you're not yet building it, or there is a risk of painting yourself into a corner and having to rewrite

orterves
Автор

Very clear video thank you. The examples make it easy to follow. Maybe the code samples could be larger for us mobile watchers though 😅

marioigkiempor
Автор

Very good advice for general game programming, and nice to have the example in Odin. Megastructs are not for game programming only, I think most software would benefit from this approach. Instead of classes, object instances and their methods, you just have chunks of data that allow for a large set of behaviour, and functions operating on that data.

nommos
Автор

Spot on explanation, I would love to see more of those. Great channel btw!

jeisonsantiago
Автор

Am i the only one who thought this was about Amazon ecs?😅 Great video either way. Always nice to learn more about game dev👍.

dawill
Автор

I believe the "distinct int" can be done in C, by just wrapping an int in a struct.

typedef struct
{
int id;
} Entity_Id;

void eid)
{
for (Entity_Id i = {0}; i.id < 10; ++i.id)
{
//...
}
}

RockTo
Автор

Could you make the code a bit bigger in next videos? It's hard to read on mobile screens.

antonib
Автор

I believe Odin's [dynamic] has stable pointers so even if it grows you don't have the problem of losing the reference to it

LuizMoraes-xbqj
Автор

How do you multithread it? If you can't reason about your data it's hard to scale multithreading (especially deterministically). I get most games don't need multithreading, but for something like mass scale rts it would be nice..

Veeq