bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.12k stars 3.56k forks source link

`HeadlessPlugins` for headless apps, rather than `MinimalPlugins` #15203

Closed Aceeri closed 1 month ago

Aceeri commented 1 month ago

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

MinimalPlugins touts itself as a good starting point for headless apps, but I feel like this is misleading and causing more confusion/debugging frustration than anything else. When we want a headless app for a game, what we really want is everything except rendering related things, not to disable everything.

For example, basically every bevy game is going to want TransformPlugin and LogPlugin.

What solution would you like?

A new plugin group that is just DefaultPlugins minus rendering related plugins. From my own project this is what I've started with:

DefaultPlugins
    .build()
    .disable::<RenderPlugin>()
    .disable::<PbrPlugin>()
    .disable::<CorePipelinePlugin>()
    .disable::<ImagePlugin>()
    .disable::<TextPlugin>()
    .disable::<SpritePlugin>()
    .disable::<WindowPlugin>()
    .disable::<WinitPlugin>()
    .disable::<GizmoPlugin>()

What alternative(s) have you considered?

Letting users do this themselves if it's what they want.

Additional context

christianlarrabure commented 1 month ago

Out of curiosity, why would you want the Transform plugin in a headless app / game if you don't have rendering? I have my own project in headless mode, but I don't use TransformPlugin, I did have to enable the others.

Aceeri commented 1 month ago

Out of curiosity, why would you want the Transform plugin in a headless app / game if you don't have rendering? I have my own project in headless mode, but I don't use TransformPlugin, I did have to enable the others.

As of right now there is no first party separation of gameplay/simulation position and rendering position, which leads a lot of people to use Transform for gameplay position. I personally use physics position/rotation as the true source for my gameplay.