Live data from Hacker News

SimCity UI Code + DRM

gist.github.com

21–30 of 66 posts

Re: SimCity UI Code + DRM

#21

It would be an interesting project to offline the game - but I do wonder how hardcore the calculations are that run it. Would it be realistic to run the game itself and the server-side simulation stuff (nulling input from other cities) on an ordinary desktop computer? Or would you definitely need a secondary machine?

I think it's worth noting that older versions ran completely fine executing the totality of the required code...

Re: SimCity UI Code + DRM

#22

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

#23

3.5 mb of Javascript. Glug. Looks like just the game ui. I cannot really find references to DRM like the title says. Lots of nice references to cheats though! They all rely on simcity.DEBUG being true, if (simcity.DEBUG) switch (a) { case scrui.kKeyCodeDigit1: c && (e && !d) && scrui.RunCheat("scgameui -unlockalltools"); break; case scrui.kKeyCodeLetterW: c && (e && !d) && simcity.CreateUnit("T_RCI_AddHourlyIncomeChe…

http://telemetry.simcity.com/simcity/

That's the REST url

Re: SimCity UI Code + DRM

#25

It would be an interesting project to offline the game - but I do wonder how hardcore the calculations are that run it. Would it be realistic to run the game itself and the server-side simulation stuff (nulling input from other cities) on an ordinary desktop computer? Or would you definitely need a secondary machine?

People have been saying that they could play for hours after the servers were offline. I think it's pretty safe to say there isn't much running on the server.

Re: SimCity UI Code + DRM

#26

3.5 mb of Javascript. Glug. Looks like just the game ui. I cannot really find references to DRM like the title says. Lots of nice references to cheats though! They all rely on simcity.DEBUG being true, if (simcity.DEBUG) switch (a) { case scrui.kKeyCodeDigit1: c && (e && !d) && scrui.RunCheat("scgameui -unlockalltools"); break; case scrui.kKeyCodeLetterW: c && (e && !d) && simcity.CreateUnit("T_RCI_AddHourlyIncomeChe…

Chet Keno is also the name of one of the mayors of a neighboring town during the tutorial.

Re: SimCity UI Code + DRM

#27

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

Re: SimCity UI Code + DRM

#28
Good to see people using the Closure Tools. It really is a powerful toolkit.

Just a reminder that I (and some others, hopefully) are in ##closure-tools on Freenode to help you out if you have questions. Make sure to stay in the channel if you ask, as it's low-volume. I don't believe I've let a question go unanswered in well over a year, unless the person left right away and there was no point in answering it.

The channel itself is in no way affiliated with Google, nor am I.

Re: SimCity UI Code + DRM

#29
post #21

It would be an interesting project to offline the game - but I do wonder how hardcore the calculations are that run it. Would it be realistic to run the game itself and the server-side simulation stuff (nulling input from other cities) on an ordinary desktop computer? Or would you definitely need a secondary machine?

I think it's worth noting that older versions ran completely fine executing the totality of the required code...

Note also that the last version of SimCity was launched in 2003, running on a completely different engine with a completely different simulation model.

The Maxis team has talked quite a bit about the challenges in making their agent-based simulation engine, Glassbox, performant on low- and medium-spec PCs.

Re: SimCity UI Code + DRM

#30
post #22

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'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 p…

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/

Post reply on HN