amethyst / evoli

An ecosystem-simulation game made with Amethyst
https://community.amethyst.rs/t/evoli-introduction/770
Other
217 stars 33 forks source link

Debug menu #16

Open khskarl opened 5 years ago

khskarl commented 5 years ago

Currently debugging is really not the smoothest experience, the only way to watch values for variables is by inserting prints everywhere and changing them on-the-fly is an even bumpier road.

I propose using this really cool project: https://github.com/Awpteamoose/amethyst-inspector image

Seems like a solution to this problem and is simple enough to integrate.

Also, feel free to write on this issue any development frictions that could be improved by better debugging support on the Amethyst side, e.g. more helpful error messages, more debug drawing options besides debug lines.

erlend-sh commented 5 years ago

I assume we’d only use this for local play testing? Making imgui work for WASM deployment is out of scope for some time still, possibly always.

khskarl commented 5 years ago

Yes, it's really easy to gate this out when building for wasm.

We can gate out imgui code like this:

#[cfg(not(target_arch = "wasm32"))]
fn inspect(&mut self, entity: Entity, ui: &imgui::Ui<'_>) {
    ...imgui usage...
}

But I'm not sure if that's enough or we need to explicitly state somewhere that amethyst-inspector isn't a dependency when targeting wasm.

khskarl commented 5 years ago

Closing the issue as the inspector has been merged in #17 :).

erlend-sh commented 5 years ago

As this was temporarily disabled in #79 pending an update, I’m reopening this as a starter-friendly task.