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 C-Lesh   Members   -  Reputation: 124

Like
0Likes
Like

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!"
C-Dev: http://www.francoiscdev.com - Home of the game development language C-Lesh and the Super Mario World game engine!


Sponsor:

#2 clb   Members   -  Reputation: 1780

Like
2Likes
Like

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

Like
0Likes
Like

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.



PARTNERS