Hacker News new | past | comments | ask | show | jobs | submit login

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?




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


>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/


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/


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...


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.


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...


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.


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.


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.



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...


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


A lot of games use Flash for in-game UIs. See Scaleform.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: