bevy_mod_debugdump icon indicating copy to clipboard operation
bevy_mod_debugdump copied to clipboard

Incompatability with iyes_loopless

Open InnocentusLime opened this issue 3 years ago • 2 comments

It's not a big problem, I suppose, but bevy_mod_debugdump gets super confused when it meets iyes_loopless's data in the schedule graph:

  1. It just formats the StateTransitionStageLabel in an user unfriendly way
  2. It can't print the systems the StateTransitionStage contains, because it doesn't expose any interface for that AND doesn't fall into either of the cases bevy_mod_debugdump tries in its implementation, since iyes_loopless uses its own custom stage type.

InnocentusLime avatar Aug 11 '22 08:08 InnocentusLime

Can you send an example graph?

jakobhellermann avatar Aug 11 '22 08:08 jakobhellermann

Consider the following minimal example which includes iyes_loopless

use bevy::prelude::*;
use bevy_mod_debugdump::*;
use iyes_loopless::prelude::*;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum MyState {
  A,
  B,
}

fn main() {
  let mut app = App::new();
  app
    .add_plugins_with(DefaultPlugins, |plugins| plugins.disable::<bevy::log::LogPlugin>())
    .add_loopless_state(MyState::A);
  print_schedule(&mut app);
}

cargo run | dot -Tpdf > graph.pdf produces the following graph (together with the "Missing downcast" message). I assumes this is because iyes_loopless inserts its own stage type, which is a custom type, that implements Schedule.

In addition it also seems that the formatting of that custom stage's label doesn't look very informative. (probably because its Debug impl isn't quite human readable)

InnocentusLime avatar Aug 11 '22 18:08 InnocentusLime

I think this is should be fine now with stageless released, but if there are issues left feel free to reopen

jakobhellermann avatar Mar 06 '23 19:03 jakobhellermann