4 ms·
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 javascri
by gee_totes 14y ago
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?
- thomasvendetta 14y agoI 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-battlefield http://documentcloud.github.com/backbone/#examples-battlefie...
- emehrkay 14y agoI 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
- smiddereens 14y agoA lot of games use Flash for in-game UIs. See Scaleform.
- ErikGelderblom 14y agoQuite some game UI's are done in Flash (check out ScaleForm by Autodesk: http://gameware.autodesk.com/scaleform http://gameware.autodesk.com/scaleform) so using JavaScript seems plausible as well.
- stephengillie 14y agoSome 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.
- seanalltogether 14y agoexactly, 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.
- Bjartr 14y ago>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/ http://awesomium.com/
- notdan 14y agoFWIW, 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/ https://code.google.com/p/chromiumembedded/
- TheMakeA 14y agoWe 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-insomniacgames-tools-as-webapp/ http://www.insomniacgames.com/new-generation-of-insomniacgam...
- ramchip 14y agoThat 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...
- revoked 14y agoI asked one of the SimCity devs a question along those lines this weekend: https://twitter.com/MaxisScott/status/310835756107177984 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
- dsl 14y agoIt's webkit: https://sites.google.com/site/eawebkitwiki/ https://sites.google.com/site/eawebkitwiki/