-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bevy 0.15 #574
Bevy 0.15 #574
Conversation
See bevy#13069, bevy#14831
See bevy#14909 Co-authored-by: Rich Churcher <[email protected]>
Looks like there's a major performance regression. It seems that something is going wrong with change detection for tilemaps and chunks are getting rebuilt every frame. Specifically, Seeing a ~20x regression in edit: Okay, edit: Seems like there may be some subtle main/render entity mismatch happening that's preventing chunking from working properly? Tracing didn't get any more specific than " edit: drilled down slightly further w/ tracy. Most of the time is spent in the first edit: seems like |
Okay, fixed the performance regression. Frame times on This PR: ~9ms |
Testing with
Will investigate |
See bevy #16461
I can reproduce the issue if I I don't fully understand what is happening but it does not happen if I remove the I dig a bit into the code, especially around extraction logic (see What is strange is that it works for the first frame but it does not after.
Not sure why a |
Got it to work by removing the I don't understand because this component should still be present on the tilemap entity since it is also inserted via the Hopefully performances are still OK ? PR = rparrett#6 |
Any chance you could provide a runnable example that reproduces this? My thinking at the moment is that we
(or, rework things so that we do persistent extraction, and have some separate mechanism for detecting changed tiles/maps/textures or whatever. Would probably prefer fixing up the temporary entities for now.) (grain of salt, I don't know the renderer super well) I had the same thought though to do what you just did as a quick workaround. I'll take a closer look in a bit. I feel like there might be a similar bug lurking with tile despawning though. edit: Hit a bit of a snag with the hashmap approach because we rely on tilemaps getting extracted when checking visibility in |
Okay, I think I was misunderstanding things pretty badly -- It is confusing though, and should probably be swapped out for The thing that's melting my brain at the moment though is reconciling this "custom change-based extraction" with Other stuff in Bevy operates this way... sort of... I think. But instead of deleting the whole entity with So I think that Understanding this code more and more though. Will look again a little later. |
This reverts commit e131640. This fixed the performance regression, but broke other stuff. It doesn't make sense for an entity to be both SyncToRenderWorld and TemporaryRenderEntity.
I reverted the Perf seems even better (~7.5ms), and map reloading seems to work again. |
Hey, in 0.14 i used to have a custom bevy_mod_picking backend to be able to react when clicking on a tile. fn on_click_print_hello(click: Trigger<Pointer<Click>>) {
println!("{} was clicked!", click.entity());
} doesn't work. |
That isn't expected to work out of the box. Individual tiles don't have meshes or bounding boxes. (IMO) A picking backend would be great to add now that picking is built into Bevy. Please see #572 for related discussion. |
Added a |
Okay, no idea why adding that example is breaking the headless CI, but I'll just remove it for now. |
I spot-checked
(mac m1/chrome) And tested for entity leaks with the example from #578 |
I see the review request and will start on that later today. |
Based on this PR, the update of bevy_ecs_ldtk is also coming along nicely: Trouv/bevy_ecs_ldtk#340 I've tested the bevy_ecs_tilemap + bevy_ecs_ldtk updates on Linux X11 and Wayland and didn't see any issues. |
Reveiwed and have been using this PR for about a week now to good effect and haven't noticed any issues. Intending to approve, merge, and release later today. |
This seems to be in a pretty good place now. Some things left to do:
atlas
featurewebgl2
andwebgpu
Many thanks to @bas-ie, @evilenzo, @adrien-bon, @tychedelia.
Let me know if I missed anything important.