News for hackers. Stuff that matters.
Re:State of JavaScript 2020 by Pfhreak on Friday January 15, 2021 @07:02PM (#25798333)
I've seen Svelte used in a number of high impact tools, including in AAA videogame UI. In my experience, I've seen engineers very happy working with it, and it meets the performance needs for a videogame it should be good enough for the web.
Re:State of JavaScript 2020 by mattdesl on Saturday January 16, 2021 @03:00AM (#25800848)
I’m also working with Svelte for my (non-AAA) game, and enjoying it thoroughly. The only problem I find is that complex animations/transitions can get a little messy (compared to say GSAP timelines), and it tends to create a lot of garbage out of the box so some tuning is necessary to avoid GC thrashing.
Re:State of JavaScript 2020 by ha4fsd3fas on Friday January 15, 2021 @07:06PM (#25798382)
Do you have any info on that AAA game? I would be curious to read up on how/why they used svelte.
Re:State of JavaScript 2020 by preommr on Friday January 15, 2021 @08:38PM (#25799059)
> including in AAA videogame UI

elaborate, please, because this sounds so bizarre.

Are they bundling an entire web view and then interfacing it with their game engine? Not only is the tech conceptually weird, I can't think of too many AAA games that have very complex UIs other than maybe the CK series.

Re:State of JavaScript 2020 by turtlebits on Saturday January 16, 2021 @12:17AM (#25800254)
A lot of games have storefronts for DLC. I've seen these used as webviews, especially payment forms.
Re:State of JavaScript 2020 by Pfhreak on Saturday January 16, 2021 @10:22AM (#25802741)
Yes, it was two Svelte apps. One for the menus and one for the in game ui/hud elements. Things like health bars, reticles, ability timers, etc.

The interface between the game engine was designed to be as decoupled as possible. The UI could run in a browser with a mocked game underneath it, which allowed the UI devs to iterate very quickly. This also has the advantage of allowing UI to be built before the game had a feature implemented.

Re:State of JavaScript 2020 by Macha on Saturday January 16, 2021 @09:04AM (#25802198)
It doesn't surprise me. 5 years ago the standard solution was Scaleform, which is pretty much the same thing but with Flash.
Re:State of JavaScript 2020 by vbezhenar on Saturday January 16, 2021 @09:06AM (#25802211)
It might be for main menu. I think that WC3 reforged used webview for its menu.
Re:State of JavaScript 2020 by Pfhreak on Saturday January 16, 2021 @10:23AM (#25802748)
Main menu but also in game UI. Ability timers, weapon reticles, health bars, etc.
Re:State of JavaScript 2020 by Macha on Saturday January 16, 2021 @09:10AM (#25802228)
I would wager that a middle of the road data-heavy web UI actually asks more of their framework performance wise than a video game UI. Compare the number of interactable elements in e.g. a Trello board to a FPS weapon loadout screen. Sure, the consequences of a sluggish UI in a video game can be worse than a sluggish UI in a web app if it's running on the main thread and blocking the game's execution, but plenty of games update their UI less than once a frame, or run it in a separate thread altogether.
Re:State of JavaScript 2020 by Pfhreak on Saturday January 16, 2021 @10:25AM (#25802761)
Possibly. It's not just the loadouts though. Reticles and health bars need to animate at least 30 fps if not 60.