Game UI

Discussion in 'Backers Lounge (Read-only)' started by vonWolfehaus, January 20, 2013.

  1. vonWolfehaus

    vonWolfehaus New Member

    Messages:
    19
    Likes Received:
    0
    @dantealiegri As neutrino mentioned, the DOM is ridiculously expensive, which is what actually gets rendered. The JS to push it around is also expensive, while the JS itself (as long as it doesn't touch the DOM so the node tree doesn't reflow) is good enough--witness the power of nodejs (not the V8/C part, the actual serverside JS part you write for your app). So unless you prefer static elements, the DOM is best left up to browsers.

    Awesomium was designed for apps, yes, so it's not exactly optimized. Still, ever try optimizing webkit? You're better off just writing your own lua-powered frontend. Or maybe even create your own ECMAScript-based language to get the best of both worlds, like KDE did.

    EDIT: Oh dude. DUDE. TypeScript is open source! Neutrino, what do you think of binding TypeScript to a UI framework? It doesn't have to be fancy right away, just be a sprite system with text... I think? TypeScript is a superset of JS but brings in ECMAScript 6 (the future of JS), so we get those features today. I've been making a lot of stuff with it and while it's still fresh, it's pretty good :)
  2. dantealiegri

    dantealiegri New Member

    Messages:
    21
    Likes Received:
    0
    I don't think he is saying using DOM for the menus in game ( a good question ), but simple JS which binds to an API. Also, the expense of the DOM is the reflow costs .. it's kind of a massive mess, but that's because of how everything is tied to HTTP, so that you can have a script up top which gets pulled in and loaded first .. so it can then start pulling other resources ..

    Neutrino already said he has is leaning towards JS because there is a very large userbase.
  3. vonWolfehaus

    vonWolfehaus New Member

    Messages:
    19
    Likes Received:
    0
    Wait, why on earth would you integrate webkit and not use the DOM? That's all webkit is, one giant layout engine. If you just want to use JS, you don't need the entirety of webkit, just its interpreter (called JavaScriptCore), or even better would be V8 (which nodejs uses). I don't think you understand the situation.

    I suggested using a JS-like language (exact same syntax, just no DOM API) to talk to Uber's own UI engine in order to get the benefit of both, which I think is what you assumed was the case.
  4. neutrino

    neutrino low mass particle Uber Employee

    Messages:
    3,123
    Likes Received:
    2,687
    We are definitely using the DOM for most things. Obviously in game 3d rendered stuff is a different API. If the perf of the DOM kills us (which for the record I don't think it will given the architecture) then we can bind javascript to our currently existing UI system that's already in the engine.
  5. dantealiegri

    dantealiegri New Member

    Messages:
    21
    Likes Received:
    0
    Why integerate webkit and not use the DOM? As you said, there are things the DOM is good for, and things the DOM is bad for. As someone mentioned, pulling a wiki page into a sidebar - good.

    But note, for instance, that GNOME has a JS binding that just uses gtk+, so you are writing client apps in just JS.
  6. dantealiegri

    dantealiegri New Member

    Messages:
    21
    Likes Received:
    0
    So then the 3d stuff and the html stuff will require some work to ensure a consistent look, yeah? But I assume if you do this with css perhaps, it would make it easy for someone to create a page, pull in the css and have a "correct" looking ui.
  7. lacero

    lacero New Member

    Messages:
    10
    Likes Received:
    0
    I know nothing about webkit, but I can sympathise with how horrific scaleform/flash is.

    Flash can force you into trees of entities even for simple use cases. Then scaleform uses a full fat environment for each one. you can see this in the open source version or a profiler.

    I like lua too much myself but at least with webkit you have the option of a fall back using js as you would normally use lua. it sounds like a good approach.
  8. neutrino

    neutrino low mass particle Uber Employee

    Messages:
    3,123
    Likes Received:
    2,687
    So vonwolfehaus emailed me about checking out coherent labs UI solution.

    We are seriously considering switching to it as it has performed well in our tests so far.

    www.coherent-labs.com
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    If you end up with coherent don't use the facebook-integration features please. I don't want facebook buttons everywhere xD They are like cancer that spreads through the web.

    Apart from that the description of that framework sounds nice.
  10. Veleiro

    Veleiro Member

    Messages:
    112
    Likes Received:
    6

    Can you go into detail what this is? I was really excited about the webkit stuff. What vonwolfehaus was suggesting (scaleform, etc) I would definitely not prefer. Why would coherent labs solution be better than webkit and they way you planned before?
  11. Pawz

    Pawz Active Member

    Messages:
    951
    Likes Received:
    161
    From what I read of the features, it looks like a UI system that replaces webkit.

    So it acts like webkit (html5, js, etc) for the UI developer, and the on the game side acts like a streamlined C++ system.


    So all the benefits of webkit with potentially all the performance issues ironed out already?

    If I'm reading it right :)

    EDIT: Check it out: http://www.youtube.com/watch?v=1XxJpghF04g
  12. chirmaya

    chirmaya Member

    Messages:
    30
    Likes Received:
    1
    That one is sure sounding good. It seems pretty new as I haven't heard of anything really using it yet, so you always have to be wary there, but the demos* make it look quite nice.

    * - http://www.youtube.com/watch?v=uIKsnMNf7ns

Share This Page