Jump to content

  • Log In with Google      Sign In   
  • Create Account

JavaScript Games on Android Phones

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Francois Soft   Members   -  Reputation: 136


Posted 18 July 2012 - 08:52 AM

Recently I've been workin on a project called C-Lesh which is an interpreter written in JavaScript to develop games on mobile devices. (as of now) I have tested it on Android 2.2 (Froyo) and up and things seem to run at top speed. I bring this up because I am wondering if anyone has attempted games in JavaScript and put them on Android phones. From my own experience mobile phones can run JavaScript very fast, like C# or Python because of the native code compilation. Now here's my other question: If I were to convert the bytecode of my language, C-Lesh, to javascript and place it in an eval() statement would this also compile to native code? I'm thinking about generating JavaScript from bytecode for a speed boost. For anyone who wants to see how C-Lesh work please check out my site. But seriously, answering the latter of the two questions would be of great help to me.

Nerd's Quote: "If you stare at a computer for 5 minutes you might be a nerdneck!"

"I got an $86000 company, what do you have a**hole?"

"After 10+ years FrancoisSoft is back? Yep, and we're here to stay. It'll be a good time!"

"The Super Mario World Tournament is here! Will I win or will I lose it all?"
FrancoisSoft on the Web: http://www.francoissoft.net:3000 <- Inquire for account.


#2 clb   Members   -  Reputation: 2138


Posted 18 July 2012 - 09:57 AM

I did a quick evaluation of using JavaScript + WebGL on Android and iOS, with the prospect of writing cross-platform games for desktop, web, iOS and Android using the same JavaScript codebase. The brief report can be read here. The summary is that I found JavaScript+WebGL to be too slow on Android phones, and WebGL virtually unsupported by mobile browsers, both Android and iOS. I do not know how much of the slowness was caused by WebGL portion specifically, and how JavaScript without WebGL would work on Android.

After that, I switched the strategy to developing a cross-platform C++ codebase, which works with native performance on all of the platforms I am interested in. To bring the C++ codebase over to web, I use the emscripten compiler. It is not perfect, but results so far have been positive. Some tests: QuadTree.html: click anywhere with a mouse, Geometry.html, aabb_obb_sphere.html, SceneView.html: use WSAD and arrows to move around.

Most JS engines nowadays have some form of JIT support. Even then, I am most certain that JavaScript on web browsers is not JITted to native code that would have the same performance as when the code had been written natively to start with. The above samples all run at 60fps on my Android Tegra3 device (when compiled to native Android applications), but if I try to run them in a web browser on that Tegra3, I get performance ranging at 2-10fps (try yourself if you have an Android phone, I'm interested in hearing how other devices fare). The mobile Opera web browser was the only one I could find with WebGL support.

I tried to find more information in the web site you pasted, but the links seemed to be locked behind a password.
Me+PC=clb.demon.fi | C++ Math and Geometry library: MathGeoLib, test it live! | C++ Game Networking: kNet | 2D Bin Packing: RectangleBinPack | Use gcc/clang/emcc from VS: vs-tool | Resume+Portfolio | gfxapi, test it live!

#3 Acotoz   Members   -  Reputation: 73


Posted 18 July 2012 - 09:02 PM

I did a quick evaluation of using JavaScript + WebGL

Tell me, how's everything with WebGL? last I checked only a couple of browsers supported it, and IE refused to support it.

I was very interested some time ago on that particular technology, but forgot about it.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.