Skip to content

Send events from the render world to the main world #18491

Open
@IceSentry

Description

@IceSentry

What problem does this solve or what need does it fill?

In some situations, we need to communicate data back to the main world from the render world. This is a non trivial thing to do because of the async nature of the main and render world split. The solution is to use channels, but it's not easy to manage for less advanced users.

The gpu readback feature shows that passing data between these worlds is possible but it's a purpose built abstraction.

What solution would you like?

One possible solution would be to have some kind of RenderEventWriter/RenderEventReader plugin that creates a channel between both worlds and sends any render event to the main world by polling the channel in the main world.

What alternative(s) have you considered?

Tell users to write their own channel.

Additional context

We often get comments that the render world is hard to work with because it's hard to communicate data back to the main world. In some cases it comes from a misunderstanding of how the render world is intended to be used, but there are various valid reasons to want to pass some data back to the main world.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions