Mozilla VR Blog: ECSY Developer tools extension |
Two months ago we released ECSY, a framework-agnostic Entity Component System library you could use to build real time applications with the engine of your choice.
Today we are happy to announce a developer tools extension for ECSY, aiming to help you better understand what it is going on in your application when using ECSY.
A common requirement when building applications that require high performance- such as real time 3D graphics, AR and VR experiences- is the need to understand which part of our application is consuming more resources. We could always use the browsers’ profilers to try to understand our bottlenecks but they can be a bit unintuitive to use, and it is hard to get an overview of what is going on in the entire application, rather than focusing on a specific piece of your code.
With the ECSY developer tools extension you can now see that overview, getting statistics in realtime on how your systems are performing. Once you know which system is causing troubles in performance you can then use the browser profiler to dig into the underlying issue.
Apart from showing the status of the application, the extension lets you control the execution (eg: play/pause, step system, step frame) for debugging or learning purposes, as well as accessing the value of the queries and components used in your application.
When the ECSY extension panel is loaded, you will see all the sections available on the UI. (A big shout out to the flecs team as their work on their admin panel was a big inspiration for us when designing the UI)
Rotating
component, it will highlight the Rotating
query as it is using that component, as well as the RotatingSystem
.$component
so you can use it on the console.When debugging applications sometimes we want to test our code on an external device like a mobile phone or a standalone VR headset. The problem is that custom WebExtensions are not available when connecting to remote devices from the browser’s developer tools.
To address this issue we implemented a custom remote protocol using WebSockets and WebRTC, so you can connect to your device even if it is not connected via USB to your laptop, or using the same browser as you are using for debugging (eg: you could use Chrome to connect to a Firefox Reality browser on a VR device or Firefox to connect to an Oculus Browser sessions).
Today we also release a new version of ECSY (v.0.2) that includes support for using the developer tools with remote devices.
Remote connection can be enabled using two methods:
Explicitly calling enableRemoteDevtools()
on your application.
import {enableRemoteDevtools} from “ecsy”;
enableRemoteDevtools( /* optional Code */);
Please notice that you can pass an optional parameter as the code that the application will be listening for. Otherwise, a new one will be generated:
Adding ?enable-remote-devtools
to the URL when running your application on the browser you want to connect to.
Using any of the previous methods will add an overlay on your application showing a random code that will be used to connect to remotely.
Once we get the code from the previous section, we can connect to that device from our preferred browser by clicking the ECSY icon on the extensions toolbar, entering the code and clicking connect
:
Or doing the same from the ECSY
panel in the developer tools.
When using the developer tools on a remote device there are some differences from running it locally.
We hook every call to console.*
as well as any error thrown by the application running on the remote device, we will send them back to the host developer tools browser and log them on the console.
When connected to a remote device you still have the dump to console
functionality to inspect components and queries, but it works slightly differently: The remote device will serialize the data and send it to the host developer tools that will deserialize it again and call console.log
with that.
Note that currently the deserialization process is quite simple, so we are just preserving the raw data, but we lose all functions and data type definitions.
We also included the ability to execute code on the remote device. Clicking on the remote console
icon, the following panel will appear:
Everything you enter on the textbox will get executed on the remote device and it will write the result of the evaluation on the list above.
Currently, the extension is still experimental and we still have to fix issues on the current implementation (eg: right now there is a lot of re-render going on on the react UI making it slow on applications with many components and systems), and many other cool features we would like to include on the incoming version.
We would love your feedback! Please join us on Discourse or Github to discuss what you do think and share your needs.
Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |