#I'm reimplementing my apply on demand to

1 messages · Page 1 of 1 (latest)

tight willow
#

honestly there's a part of me that's starting to become partial to the idea of hard-enforced archetypes

by that I mean your "ultra hot" code paths are hard-coded tables in flecs that never swap archetype locations

digital wharf
#

That would actually be quite helpful tbh. Archetypes hardly change in games. Mostly tags that move around a lot and that can be implemented differently

tight willow
#

which is a massive bummer as it removes the fun of compoisition, but it turns your "enemy location" table into something much more reliable

  • you could probably store component pointers
  • you never have to fight off funny mixed up queries
digital wharf
#

I wonder if entt has these issues

tight willow
#

the idea would be that you hard-define the table at frame 0 and store a handle to it or something, then query it as normal for other things

digital wharf
tight willow
#

yes

digital wharf
#

Shouldn't be too hard to make a nice API for it

tight willow
#

but it's a bit defeating the purpose in some ways 😛

digital wharf
#

Queries kinda do the same thing, but also include other tables. It sounds useful imo

#

I know that if "enemies" somehow fall outside the table something is wrong. Messes up composition tho

tight willow
#

A lot of my transform systems takes are second-hand from more experienced ecs enjoyers like vblanco fwiw

#

It would be interesting to make a giant benchmark comparing different styles

digital wharf
#

That would be best tbh.

#

I'm not comfortable with vblancos style not doing cycle detection. But it's pretty fast

tight willow
#

Imo you could add cycle detection in debug mode

digital wharf
digital wharf
#

I generally prefer immediate, on demand calculation to syncing up at end of frame.

#

I was reading up on bevy transform system again, and it basically said if you want to use global transforms, add the system to end of frame schedule

#

Otherwise, calculate on demand using an expensive query

#

I'm doing something similar to what vblanco is doing. Calculate on demand, but I'm using relationships for hierarchy.

Problem is that I now have to make the relationship a union to reduce fragmentation. But unions can't hold data, which means the local transform has to be a separate component.

tight willow
#

It's going to complicate gameplay code I think

#

But might be okay?

digital wharf
#

Depends. For an RTS, I wouldn't mind too much. The timing of things isn't too important. But if I was making an FPS, I wouldn't like it.

#

Especially if it includes networking