by EMM_386 · 3y ago · 0 comments
When I first heard of this as being a thing, my initial reaction was indeed something like "wait what? HTML and CSS in a desktop PC game driving the UI? No, that shouldn't be ... ".
But then I used Microsoft Flight Simulator 2020, was amazed by the graphics and performance ... and learned about how the complex and detailed cockpit gauges are using WASM/HTML/JS for rendering. No React, but still the "web technologies".
It dawned on me that this is apparently not exactly the weird, strange, bad performing, wrong-use-case, "why would you ever" thing I originally saw it as. Because it was working fine in that complex scenario.
Gameface's architecture is described in its documentation: https://docs.coherent-labs.com/unity-gameface/integration/te...
Most of its divergence from browser implementations are unsurprisingly in font rendering, which is generally a headache in games anyway: https://docs.coherent-labs.com/unity-gameface/integration/op...
And in RTL text rendering: https://docs.coherent-labs.com/unity-gameface/integration/op...
The Javascript DOM API is a subset, but pretty rich considering: https://docs.coherent-labs.com/unity-gameface/api_reference/...
Conference talk by dev: https://www.youtube.com/watch?v=Pkf9H3XEMoE
There is a lot of snobbery and arrogance from "pure" backend developers who think JavaScript is some limited toy language. If it is not C++ or Rust or even Go (...assuming they are ok with the GC) then to them it is not worth wasting a milliseconds time on while they go off and fetishise over their copy semantics for their CRUD website backend.
Modern JavaScript is highly performant and the DX is second-to-none (unless you are using anything related to NPM). JavaScript and Typescript freed from the NPM nonsense is an absolute joy to work with.
I look forward to the inevitable dominance of JavaScript on the backend.
When I realized this was performant enough to drive a 747's entire cockpit while the simulator moved along at a high FPS and with incredible visuals, and was now a thing that was being selected for "state of the art" AAA games ... from there I did my homework.
So that led to reading all about SpaceX Dragon UI, as you mention, and all the myraid of other places this is used.
I did feel like I was too far outside the loop, having been a software engineer and working with these technologies for quite a while by that point. "quite a while" being the pre-JavaScript-existing years.
I just wasn't working on projects that such a thing would meet a requirement.
Now? I still have no use for it but I find it incredible that everything in this entire pipeline has become so optimized and reliable. Apparently to the point you can suggest running a spacecraft's user interface and not leave everyone staring at you, blank-faced and not sure how to respond.
Instead, possible responses can now include "sounds good".
But that's not how web package management works.
Now, there is stuff like imgui of course. But Try writing a very heterogenous UI in something like Qt and then come back to React. There's very little empathy for the machine but it works so well.