News for hackers. Stuff that matters.
Re:SimCity UI Code + DRM by gee_totes on Monday March 11, 2013 @03:57PM (#5359208)
What parts of SimCity were written in Javascript?

(Before you say "The UI, obvs", I'm wondering if it's a common practice to write UI code in games in javascript. I know that Gnome has a lot of JS that's tied into UI, I didn't expect the practice to make itself into game dev).

And if this code is actually from SimCity, does SimCity have some type of v8 or other js engine packaged with it?

Re:SimCity UI Code + DRM by revoked on Monday March 11, 2013 @08:28PM (#5359381)
I asked one of the SimCity devs a question along those lines this weekend: https://twitter.com/MaxisScott/status/310835756107177984

Q: Is the launcher built on WebKit or some other layout engine? Are there things in game that are WebKit too?

A: The whole UI is done in javascript running a custom version of webkit. :D

Re:SimCity UI Code + DRM by Bjartr on Monday March 11, 2013 @05:40PM (#5359331)
>I'm wondering if it's a common practice to write UI code in games in javascript

It's becoming more common. Libraries like Awesomium[1] make it trivial to render browser content to an in-game texture and the V8 engine, while not 'easy' to integrate, is quite empowering in that you can have the UI code call directly into your compiled code.

>does SimCity have some type of v8 or other js engine packaged with it?

Very probably. Most games have some scripting layer in their engines to simplify implementing non-performance-critical game logic. Lua and JS are two of the most popular languages for achieving that these days.

[1] http://awesomium.com/

Re:SimCity UI Code + DRM by notdan on Monday March 11, 2013 @09:54PM (#5359526)
FWIW, we were much happier with Chromium Embedded [1] than Awesomium. Awesomium is not free for non-commercial use (something like $8,000+ if you wanted source code included, the price of the software isn't even listed on the site now), the support was terrible, and the product seemed to be not nearly as fleshed out at Chromium Embedded. The website is prettier though...

We switched to using Chromium Embedded 6-8 months ago and haven't regretted it a bit.

[1] https://code.google.com/p/chromiumembedded/

Re:SimCity UI Code + DRM by TheMakeA on Monday March 11, 2013 @10:06PM (#5359578)
We are starting to use Chromium Embedded for all of our in-game UIs, after going through Flash and (for a brief period) CEGUI. No major regrets here. In fact, we like HTML so much that we are considering moving our game tools (level editors, etc) to HTML as well, ala Insomniac [1].

[1] http://www.insomniacgames.com/new-generation-of-insomniacgam...

Re:SimCity UI Code + DRM by mlla on Tuesday March 12, 2013 @05:03AM (#5360874)
I am at the moment evaluating various browser components for headless browsing and based on my own brief tests, the two best ones seem to be Chromium Embedded and QtWebKit (I would prefer to have C/C++ solution, so PhantomJS and alike are unfortunately out of question).

Does anyone have any experience / is Chromium Embedded any better than using the WebKit component that is part of Qt 5.0 (QtWebKit)? Both seem to use same JavaScript engine (V8) and it seems that using QtWebKit in headless browser scenarios in Linux environment seems to be a bit easier, but I'm kind of wondering why there seems to be more buzz around CE than QTWK. On obvious reason of course is that using QTWK in app "forces" you to use Qt in other parts of the app that can be a good / bad thing depending on the details.

Re:SimCity UI Code + DRM by ramchip on Tuesday March 12, 2013 @01:34AM (#5360407)
That was also my experience with Awesomium. It was buggy and support is awful. I actually tried to contact them for a company which was interested in buying a commercial license -- blows my mind that they'd get emails basically saying "we want to give you thousands of dollars" and not even answer. It may have improved since then but I'd be wary of introducing a dependency on it...
Re:SimCity UI Code + DRM by ErikGelderblom on Monday March 11, 2013 @04:07PM (#5359262)
Quite some game UI's are done in Flash (check out ScaleForm by Autodesk: http://gameware.autodesk.com/scaleform) so using JavaScript seems plausible as well.
Re:SimCity UI Code + DRM by stephengillie on Monday March 11, 2013 @04:58PM (#5359295)
Some older games had the menus fully rendered in openGL. I'm not sure which is better, but I would think our society has more domain experience making menus with flash than with openGL.
Re:SimCity UI Code + DRM by seanalltogether on Monday March 11, 2013 @10:32PM (#5359683)
exactly, the tooling and skillset for interface design/dev is extremely mature these days, and it probably isn't economical to move people onto custom solutions.
Re:SimCity UI Code + DRM by dsl on Monday March 11, 2013 @11:29PM (#5359935)
Re:SimCity UI Code + DRM by thomasvendetta on Monday March 11, 2013 @03:59PM (#5359218)
I can't really speak for how common it is, but the Battlefield Play4Free server browser is written in Javascript [1].

[1] http://documentcloud.github.com/backbone/#examples-battlefie...

Re:SimCity UI Code + DRM by emehrkay on Monday March 11, 2013 @04:06PM (#5359258)
I learned that a lot of game menus are/were written in flash which was a huge shock to me, js would be as much, if not more, of one
Re:SimCity UI Code + DRM by smiddereens on Monday March 11, 2013 @05:03PM (#5359301)
A lot of games use Flash for in-game UIs. See Scaleform.