mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.3K
active users

Continuing my UI experiments but in C++ land now.

Experimenting with an ECS-ish structure with data stored in separate arrays identified by id. Not sure it makes sense since most interaction with the data is not linear iterations, so I don't know how much data locality matters.

Currently putting the data in maps and I don't love having to worry about hash lookup being a cost. Could use array, but that comes with other issues.

Maybe should just go back to pointer tree of heterogenous objects.

The Seven Voyages Of Steve

@SonnyBonds I imagine most UI has one major bulk access pattern and that’s for drawing; but it’s likely to be a tree traversal rather than linear. Updating / interacting is likely tree structured too. Perhaps you could make ECS arrays work by ordering everything by tree traversal order (depth or breadth depending on preference) and iterating directly on that. But insertions/deletions will be a pain

@sinbad Yeah. Drawing, layout and overlap queries iterate but in tree order like you say, which may or may not be linear-ish depending on how the tree is created.