Skip to content

Conditional system execution #128

@aclysma

Description

@aclysma

I didn't want to derail #125 but I think there are other usecases that are similar, some of which I encountered while prototyping:

  • Things that only run in an editor
  • Things that only run on server or client in a networked game
  • Things that only run when the game is paused/unpaused

I prebuilt schedules in legion for a few permutations and it worked fine but I don't think it was ideal. The number of permutations can grow quickly.

Another approach I had considered was using a bitflag. When you kick off the schedule, you provide bits and the systems could require certain bits be high. You could in theory have a bit for a particular timestep. This sounds a lot like (2) mentioned in bug #125 at a conceptual level. "Tags" might be another way to think about it conceptually. (i.e. tag systems, and then filter which ones will run by enabling/disabling systems by tag)

I was also running a separate schedule for a simulation thread and a rendering thread and pipelining them. (I was rendering frame N while simulating frame N+1). I could see the same approach working for other systems like network and audio where you copy over a bunch of immutable data into another system, let it crunch an entire frame's data, and produce a result.

Mainly just wanted to mention that there are quite a few scenarios I think make sense and there may be some intersection between them and the original issue #125 that was mentioning fixed timesteps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions