I can't help but wonder how much game devs would benefit from a UI framework. Laying out UI elements in code just seems so 90's. While his transformations surely improved the code--and actually start making it resemble a typical UI framework--markup languages take it to a whole new level of compressed clarity. Like XAML:
Almost all AAA developers use Autodesk Scaleform, which is built on Flash. And yet they continue to find new and innovative ways to fuck that up. Worst case I've seen is where everything was rendered by Flash, but managed by C++, meaning elements didn't know if they had focus and input had to be handled by the game instead of Flash.
The best UI framework with a markup language I've used is Qt, but I wouldn't build a game with it. Designers need more than just "a button", they need buttons that dance, bounce, pop in and out of view, are animated or are just pretending to be a button. Scaleform and specifically Flash gives them that freedom, because a "button" is nothing more but a movieclip with a predefined list of animated "states".
I don't get why Scaleform is so popular. It seems that it would be shunned for being based on a web ui technology. The performance obsessed gaming community I would think would throw it out in favor of making their own uis. What do you really need more than polygons and a little animation. Isn't that the bread and butter of gaming dev work? Checkboxes are just items with two states, and scrollbars dont have to be there, everything can be paged...
Worst I've seen was Tribes Ascend, Scaleform for all in game ui. If you disabled everything, you gained about 20 fps, but you couldn't play the game.
A couple of things make Scaleform the best solution.
Tools, tools and tools. You can make the best UI toolkit ever, but artists have to use it as well. Flash allows the creation of art assets, animating them and scripting them. You can say to a UI artist "make me a button" and she'll be able to draw it, test it and hopefully deploy it in the game.
A lot of these types of decisions can be traced back to tools. Why do gamedevs write C++ in Visual Studio? Because it's the best tool for C++.
And Scaleform is surprisingly fast. It has a custom-built VM for the scripts and it renders everything using textures and primitives. Unlike Flash, which renders in software, which is why it's well-known for its poor performance.
What do you really need more than polygons and a little animation.
Turns out, you need a lot. You need a list that can render an arbitrary amount of items that needs to be filled from the game. You need a checkbox that responds to mouse input. You need a dialog box that steals focus from underlying elements. I would say 40% of my work involves wrestling with focus and input issues. It is always a headache.
4
u/WhyComplicateThingz May 28 '14
I can't help but wonder how much game devs would benefit from a UI framework. Laying out UI elements in code just seems so 90's. While his transformations surely improved the code--and actually start making it resemble a typical UI framework--markup languages take it to a whole new level of compressed clarity. Like XAML:
This allows styling and layout to be nicely decoupled from hit-testing and behaviors.