Lostcast 111: Unidiego


  • Patron

    I have always wondered from Day 1 why you are (were?) so focused on native desktop gaming using HTML5 and just leaving mobile on the shelf. Desktop is one of the wonkiest platforms to launch an HTML5 game. You are essentially bundling the entire Chromium browser with the Node.js service engine. Both platforms are rapidly changing, and the node.js community just split. Consider this too:

    Your entire game (extracted using Ragatron):

    • Game engine (index.html) : 1 MB
    • Graphics/Sound/Music (media/): 20 MB

    And here is the added core logic to run your game with node-webkit:

    • nw.exe : 40 MB
    • various DLLs: 16 MB

    Everybody loves graphs!
    AWL vs Wizard's Lizard

    For a perspective, the graphics/media section usually dwarfs core logic (as in 90% or more). Your game is the opposite with core logic > game. If you recall from one of my previous posts, added space is not necessarily that bad. Unused features is just added space on the disk. The user doesn’t care (except maybe on mobile where space is more precious). What it does tell you is that your libary may not be focused fully on your needs.

    If you want to repackage a web application and make it run offline, Node-webkit is a wonderful platform to use. I’ve used it myself. For gaming… not so sure. Here is something to consider, and as the author of a HTML5 game dev book I feel comfortable saying this: JavaScript is a fundamentally flawed language to try to make a AAA game. It is flawed for 2 really critical facts: JavaScript is single-threaded and JavaScript is interpreted. That is 2 massive performance hits you will always be fighting if you stick to your current tech stack.

    Perhaps you could launch some Web Workers (for some concurrency) or Web Socket services (for background networking) or some other pile of band-aid approaches (timer loops for faux-threading, asm.js for niche performance issues) to achieve what could be solved by using a true native language compiler. You may be burning half your time trying to solve the problems of JavaScript when the real answer is to just not use JavaScript if you want AAA.

    I love HTML5. I like I can bang out a Flappy Bird in a weekend and it will easily run on anything and the tools are free. HTML5’s biggest promise is to write once, run anywhere. The trade off is speed and efficiency. Recognize that you will never make a World of Warcraft competitor with it, but if that is the league you want to play in, you will need to change languages. Also, keep in mind even if you go pure-Unity (or some other engine), your HTML5 skills can still be used for contract work for companies wanting silly browser games. Somebody needs to replace all those Flash ads/games, and it might as well be LDG!


  • Patron

    @dannagle said:
    JavaScript is single-threaded and JavaScript is interpreted

    Nope and, technically, nope.

    I don’t have strong data to support this claim but…

    TIGER HAT WARNING

    Javascript is not that slow. Of course, it’s never gonna be as fast as good C++ code, but it’s gonna perform at least as good as Lua, Python ,C# or any other interpreted language out there.

    So, unless you’re gonna code your game from scratch using pure C/C++, I believe your program will perform as good (or better) than in any other engine/platform.

    Also, as Jon Blow pointed out, C++ is not terribly efficient for AAA game programming either.

    Now, I have to agree that a platform switch would be probably the right decision. Well, maybe not in regards to HTML5, but at least to NodeWebkit. What LDG needs is a bundle of V8 + OpenGL bindings + OpenAL bindings.

    So, overall, I really can’t see why would using Javascript as a scripting language for a AAA game would be a bad idea.


  • Tiger Hat

    Well jumping off the HTML5 ship! I have a bunch of mixed emotions about that, mostly sadness. I ultimately understand, making games is more important than the tech. But you’re gonna have to record a new Lostcast intro…

    Now I feel like you’re diving into a realm that I am very familiar with, trying a ton of different tools / engines. Unity probably makes a ton of sense, and I dunno why, but I have a similar aversion to it for some reason. I wonder if you looked into Torque2D ? That one is the MIT solution, with a scripting language as well as open source c++ engine. There is a community of course, but not nearly as large as Unity I’m sure. I also wonder if you looked at Unreal that one is monthly, but only $19 / mo and you can cancel and still ship games (you just don’t get updates). They take a 5% gross cut, but you get the c++ source as well if you want/need to be able to make the tweaks.

    Also just to note (not that this bothers me) I noticed that you didn’t bleep out your f-bomb for possibly the first time I think in Lostcast history.

    @Josue I had a similar idea, wanted to create a “GameBrowser” that was not based on webkit or anything, but more like node.js, except that it’s a game engine only, with javascript bindings. I think that’d work well enough, and likely be faster than the browser (well maybe, prolly depends on how well you code it).

    Oh and @richtaur @geoffb if you are ditching HTML5 will you finally just open source Djinn (no support).

    I would love a modern Hexen game (there prolly are some). Grimrock is awesome.

    Oh and sorry about last week, I did enjoy the interview, just got busy with life and didn’t have a burning need to say anything for some reason.

    ramble ramble, no graphs


  • Patron

    @Josue

    • I mentioned Web Workers in my initial comment. Really, it’s just a band-aid.
    • IonMonkey and asm.js and other tech is Mozilla. These are also nice band-aids, but node-webkit uses Blink, which is made by Google, so it is really a non-starter.
    • C# is not interpreted. Not sure what that video is showing.
    • There is absolutely nothing wrong with high-level events being scripted (Lua is very common in engines for this). I encourage that. The problem is that @richtaur and @geoffb are scripting their entire engine. A modern engine has scripting an event and executing common logic in fast compiled code. Pure JavaScript can’t compete with that.
    • What LDG needs is to stop scrapping together a collection of scattered parts from GitHub’s garage and start making more games.

    We love talking about HTML5 tech, and the podcast probably won’t be the same without the good weekly Node.js rant, but the podcast doesn’t pay their bills (we already bought their games, so entertaining us is a loss-leader for them). They need to publish more games to pay bills, and anything that speeds that process will help them.


  • Patron

    @dannagle said:

    • I mentioned Web Workers in my initial comment. Really, it’s just a band-aid.

    Well, as far as I understand, it’s very simillar to how multitasking on C++ works (on Windows, that is), except that you can only have one interface worker.

    • IonMonkey and asm.js and other tech is Mozilla. These are also nice band-aids, but node-webkit uses Blink, which is made by Google, so it is really a non-starter.

    Blink is just Chromium’s rendering engine, which is responsible for displaying static web pages. It has mostly nothing to do with Javascript.

    Both NW and Node.js use Google’s V8, which, IIRC, was the one that started all that Javascript JIT thing.
    As you can see at Mozilla’s ARE WE FAST YET, V8 and IonMonkey are mostly neck and neck to each other. After everyone switched to Chrome because it was faster, Mozilla really started to push hard on Firefox’s performance, and they’ve actually gotten really amazing results!
    What I can tell, from running lots of WebGL/Canvas demos/benchmarks is that, although Firefox’s Javascript performance is a little bit better, Chrome’s rendering pipeline is still faster.

    Maybe Firefox would speed up collision detection in AWL by, say, 5%, but rendering is still the biggest bottleneck.

    • C# is not interpreted. Not sure what that video is showing.

    Just as with Java, Javascript inside modern browsers or any other language in the .NET Framework, C# is first compiled into CIL code, which is then interpreted by Microsoft’s JIT, CLR.

    The video shows a performance comparasion between C# and UnityScript inside Unity.
    Ok, of course, not all Javascript is valid UnityScript, but the inverse is true.

    A modern engine has scripting an event and executing common logic in fast compiled code. Pure JavaScript can’t compete with that.

    Hmmmm… I’m not so sure.

    Hot functions with very low cyclomatic complexity can be compiled by IonMonkey’s or V8’s optimizing compilers into veeeery optimized bytecode, which has performance almost comparable to native code. Actually, depending on the kind of parameters your function takes, it can perform as good as if it were written in C++.

    The thing is, all the functions that touch the I/O bridge would have to be specifically coded and debugged in a way that they can be optimized by the Javascript engine.

    We love talking about HTML5 tech, and the podcast probably won’t be the same without the good weekly Node.js rant, but the podcast doesn’t pay their bills (we already bought their games, so entertaining us is a loss-leader for them). They need to publish more games to pay bills, and anything that speeds that process will help them.

    Well, switching to C/C++/Go/Rust/D/Assembly/andwhatnot would almost certainly not make their process of making games faster, although it would probably provide better performance.

    Using Unity could be very beneficial to their productivity, but I think it’s performance is very comparable to HTML5’s, specially when using WebGl.


  • LDG

    Awesome feedback guys. There’s quite a lot to say on the topic but @dannagle hits the nail the on head:

    What LDG needs is to stop scrapping together a collection of scattered parts from GitHub’s garage and start making more games.

    Performance aside, putting together an HTML5 game for desktop is just too complicated. The disparate pieces are hard to manage and we spend way more time than necessary working on the tech.

    @Warspawn I’ve heard about Torque2D before but I haven’t investigated it recently. My aversion to Unity started to dissipate when I actually used it. It’s powerful and I can see why developers love it. It’s not without its own issues, of course. but so far it’s the solution that would allow us to move the fastest.

    I wouldn’t mind putting the djinn code out there, too. I’m sort of embarrassed of it, but that’s just the natural developer reaction I suppose.

    And as @dannagle also said, we can keep doing HTML5 contract/license stuff to pay some bills. Use it for game jams, etc.


  • LDG

    @Warspawn said:

    But you’re gonna have to record a new Lostcast intro…

    I’ve been trying to get a new voice recorded for ages. Wanting a new version that’s much shorter; I feel kinda bad about wasting people’s time and bandwidth with a long intro :P

    Now I feel like you’re diving into a realm that I am very familiar with, trying a ton of different tools / engines

    Forgot about Torque and the other stuff. Tho most of it feels even more far removed from our skillset. Hopefully Unity will be so fruitful we won’t feel the need to explore other options, and can ship the next game sooner.

    Also just to note (not that this bothers me) I noticed that you didn’t bleep out your f-bomb for possibly the first time I think in Lostcast history.

    Ugh yeah sorry I placed an edit marker but totally missed it. When I mess up I get mad at myself for creating more editing work for myself, so I get cussy :/ updated the file with the omission!

    @Josue I had a similar idea, wanted to create a “GameBrowser” that was not based on webkit or anything, but more like node.js, except that it’s a game engine only, with javascript bindings. I think that’d work well enough, and likely be faster than the browser (well maybe, prolly depends on how well you code it).

    do iitttttttt!


  • Patron

    @geoffb said:

    Awesome feedback guys. There’s quite a lot to say on the topic but @dannagle hits the nail the on head:

    What LDG needs is to stop scrapping together a collection of scattered parts from GitHub’s garage and start making more games.

    Performance aside, putting together an HTML5 game for desktop is just too complicated. The disparate pieces are hard to manage and we spend way more time than necessary working on the tech.

    Yeah, that is very true.

    HTML5 has the advantage on the web market, but that is as far as it’s domain goes, which reminds me: WHY THE HECK AREN’T YOU MAKING WEB GAMES!!!

    But I think trying to roll your own Node.JS based game centric mini-browser could be worth a try.

    You know, this is as tiger hatty as it gets, but… if I were into your position, I would try to roll my own HTML5 Unity. Yeah, makes no sense from a business standpoint, at least until it’s good enough to be a paid product, but… just imagine if we had a HTML5 counterpart of Unity! I mean, if Ivan did it, why can’t we?

    I’ve experimented with Unity and I have to say: I would love having a nice editor like that. You know, TFW you just want to drag an object into the scene, click on it and start coding…
    But I just bloody hate UnityScript! And C#! And I don’t like Python that much.


  • Patron

    @richtaur said:

    @Josue I had a similar idea, wanted to create a “GameBrowser” that was not based on webkit or anything, but more like node.js, except that it’s a game engine only, with javascript bindings. I think that’d work well enough, and likely be faster than the browser (well maybe, prolly depends on how well you code it).

    do iitttttttt!

    Speaking of which…

    I was about to make some experiments envolving node-canvas and AWL…

    All I would have to do is remove the gamepad and localStorage related stuff, change the way images are loaded and voilà!

    Actually, that would be a bloody heck lot of work…


  • Patron

    Oh, BTW, am I the only one who thinks it’s funny that Matt doesn’t pronounce GUI as an acronym?


  • Patron

    Also, you should totally take a look at Polycode, if you haven’t yet.
    It’s like open source Unity, but with Lua scripting!

    I haven’t got around learning Lua yet, but I feel like I should…
    It looks so familiar but, at the same time, way more classier and organized than Javascript…


  • Patron

    Regarding Unity changing how things work, I’ve already seen that happening, when they implemented the 2D tools.

    Some developers were making probably good money out of tools that turn sprites into animated textures and what not and then BAM, it’s now part of the engine.

    I also saw quite a few developers on Tigsource agonizing about whether they should re-write their code or not…


  • LDG

    @Josue That’s the good kind of change, though. It might suck for people who make money from the Asset Store, but that’s not something that should hold back new features from making it into the core application.

    I think the kind of change we’re mostly afraid of would something along the lines of shutting down a product we depend on or getting bought out by a company that changes licensing or focus, etc.


  • Patron

    @geoffb said:

    @Josue That’s the good kind of change, though. It might suck for people who make money from the Asset Store, but that’s not something that should hold back new features from making it into the core application.

    Yeah, of course.

    I’m just saying that some new game-changing feature might drop in middle of development, pretty much forcing you to re-write a large portion of your code. But that could happens to HTML5 as well.

    I think the kind of change we’re mostly afraid of would something along the lines of shutting down a product we depend on or getting bought out by a company that changes licensing or focus, etc.

    As long as you still have that binary and don’t connect your computer to the internet, I guess you’ll be fine, even if that happens.


  • Patron

    Also, thanks Geoff for making me aware that fru fru is a thing not only in Portuguese.



  • I just finished listening!

    First off, I thought that the LDG anniversary was on the 18th haha whoops (stupid off-by-one errors). Happy birthday! :D

    Second, I had the same fears about Unity. I thought that it would restrict what you could tweak in favor of a simplified GUI-based workflow, but I found out that drilling down into the code is actually a large part of the development process.

    The system that excited me the most is Mecanim. It’s Unity’s animation system, but - wait, have you tried it, @geoffb? I don’t want to spoil the feeling of discovery for everyone haha. It is incredibly powerful.

    The only thing that’s stopping me from using Unity all the time is the performance requirement. I’m on a netbook most of the time, so I want something I can do with just a text editor. But once I get a more powerful machine, I’m definitely going to get into Unity more.

    P.S. I’ll keep listening to Lostcast even if the intro changes :P


  • Patron

    @ken said:

    P.S. I’ll keep listening to Lostcast even if the intro changes :P

    Speaking of which… you still haven’t used my version of the intro, have you @richtaur?


  • LDG

    @ken said:

    First off, I thought that the LDG anniversary was on the 18th haha whoops (stupid off-by-one errors). Happy birthday! :D

    yay thanks!

    @Josue said:

    Speaking of which… you still haven’t used my version of the intro, have you @richtaur?

    quit trying to put work on my plate! I’ve got games to make ;)



  • Very interesting podcast! I love to hear from other people’s development environments.

    In the last months I also looked out for some HTML5 alternatives, because I find that even with Cordova or Phonegap publishing to mobile platforms isn’t as easy and good as it could be.

    Lately I really fell in love with Haxe! Haxe is a language, that compiles to all major programming languages including C++ and Javascript. As it has ActionScript-like syntax and many flash tools and IDEs support it. I don’t come from a Flash background and code in SublimeText, which is perfectly fine and has great support with addons.

    To build games I am developing my own engine, build on the cross-platform media-framework OpenFl, which runs on desktop (powered by C++), mobile and HTML5.

    OpenFl and Haxe in general are very popular in today’s Flash community. However there are both open source projects and run independent from Adobe.


  • Patron

    @JF said:

    I find that even with Cordova or Phonegap publishing to mobile platforms isn’t as easy and good as it could be.

    Ahhh… Have you looked at CocoonJS?

    If you’re making a HTML5 game using WebGL, it’s perfect for you!

    It also has a Chromium based webview mode (only for Android > 4.0, tho), which is perfect if you’re making other types of apps.

    Lately I really fell in love with Haxe!

    I really wish we had something like the Haxe framework for Javascript (well, Cocos2D-x kind of fills that gap)!

    I would totally be using Haxe right now, if it wasn’t for the language itself.

    I understand it’s very familiar and easy to work with for Flash/Actionscript developers, but I HATE ACTIONSCRIPT!


  • LDG

    I also didn’t like AS, until AS3, which I thought was pretty good. Basically like JS but with more features and better dependency management. We thought about trying Haxe, especially when a contract came up that required it, but overall it felt like kind of a lateral step from JS/HTML5, being based in scripting and web frameworks and all that. I love that stuff of course but these days we wanna move lower level.

    BTW @dannagle IDK if I said “awesome charts and data” but YES awesome


Log in to reply