Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> A brief glance at the JS bundle reveals that they are using React and bundling using Webpack. While this is something that is guaranteed to make the average native development purist yell at clouds and complain that the darned kids should get off their lawn,

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.



Electron's bad performance really poisoned that well early on.

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/...


Battlefield 1 was using React to render the UI in 2016!

Conference talk by dev: https://www.youtube.com/watch?v=Pkf9H3XEMoE


I imagine lots of backend developers never really thought about what it actually takes to build complex, responsive, performant and visually appealing UIs and how the web platform just so happened to have matured for decades to make all of that as painless as possible. Last time I saw that reaction was someone learning about how SpaceX is using it for their flight controls in the Dragon capsule.


> I imagine lots of backend developers never really thought

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.


So... Node?


Deno, bun, or something else that hasn't been created yet I would hope. NPM has shat the bed for Node et al IMHO


All sorts of industries use web tech to render UIs. Even SpaceX used it in Dragon. People just have preconceptions and biases, and gamers are horrendously intolerant of everything and anything that doesn’t fit their world view of “how things should be”.


> All sorts of industries use web tech to render UIs. Even SpaceX used it in Dragon.

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".


Yeah, It's still not game engine ready (maybe wasm can convince me), but JS isn't that bad as far as interpreted languages go. If you can maticulously control package dependency you can get fine enough performance. It's only rendering a flat page at the end of the day, after all.

But that's not how web package management works.


I would not sing praises for Microsoft Flight Simulator 2020. First, the cockpit displays are rendered at lower framerate, because they take considerable chunk of frame time. Second... It may be fine to render display and UI using js, but if you dig in, you will also find the autopilot there on top of inheritance hell.


In the recent versions of the simulator, most cockpit displays render in less than 1ms per aircraft. Early versions were a mess; the cockpit displays were not only slow, but also entirety fictional. At some point Microsoft hired WorkingTitle, a studio of web developers with no C++ experience, to optimize and improve the cockpit displays. They also wrote that autopilot code you mention. It's not "the autopilot" however; the PID controllers that fly the plane are on C++ side, in JS are huge amounts of input related code to make it behave like a Garmin or Airbus system.


People like to whine about web stuff being for babies, but writing dynamic UIs in "normal" things is very messy.

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.


Do MSFS menus use html as well? Because they are 100% the worst most laggy menus I've ever used.


Just wait for Boeing to start making real cockpits in React...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: