is crosswalk faster than cocoonjs - javascript

I just recently discovered cooconjs and i was excited to learn in a week or two. However i also have discovered crosswalk from intel.
Both look very promising And i have no idea which one is better for making games run faster on cellphone.
In article here: https://www.scirra.com/blog/133/introducing-crosswalk-the-new-way-to-publish-to-android it says that it is really fast and asmjs code can actually can get close to native mobile apps. If chrome now can run amsjs compatiable code faster than it should be true..doesn't cooconjs run the chrome version too but without all dom.

First of all, I have developed a game in cocoonjs and it's impressively fast.
I would recommend downloading the cocoon launcher from the app/play store.
In this app you can open DEMO apps where you can actually see what you can do with cocoonjs and how fast it is.
Secondly what cocoonjs actually did is that they built an complete own accelerated browser from scratch which has 100% focus on speed for the canvas element. This browser is not able to handle any other DOM elements its only for canvas. Nevertheless you can open an transparent webView as a overlay on the accelerated browser which can communicate in both ways. So you are actually able to build a GUI in a normal web browser communicating with the accelerated browser(probably your game) underlying. In addition you can access system functions through their javascript api and there are a lot extension ready to use like facebook/in-app purchase/ads etc all via javascript.
For more information visit http://docs.cocoon.io/

Related

Is there a way run an HTML file in a Google Chrome "environment" without having it installed?

I'm making a game with HTML/CSS/Javascript because it's the code I'm most comfortable with at the moment. I'm only really doing this as an exercise in game development and plan to learn C# later. But for now that's what I'm using, and I have a question about it.
Obviously when making a website, you want your website to be compatible with all web browsers equally. Right now, I'm using Chrome to test/debug my game, and I've decided to develop this game with Chrome in mind. But not everybody has Chrome, and not everyone would want to download it in order to play my game.
Is there a way to run an HTML/CSS/Javascript file in a Google Chrome "environment" without having the actual browser installed? Just it's code engine and none of the rest of the browser.
I've been reading about their V8 Javascript engine that they use in Chrome, and am wondering if that is part of the answer I'm looking for. What I'd like to do is include this "engine" in an installer with my game files and have it install like any other game.
Hopefully this makes sense. This may not be possible/exist, but if someone knows something I don't or an point me in the right direction, that'd be amazing. Thanks!
You could look into Node-webkit which essentially allows you to write desktop applications in html/css/js. When you distribute your game along with your node webkit executable, it is always run in the same environment. You can see some cool examples on their demos and examples page.
Usually a common path to convert web application to native desktop applications is to use a "thin" browser as app container and ship it.
A lot of current applications out there are using this trick (Spotify, Slack, etc...) and it works pretty well.
I've read of some people using the CocoonJS game engine framework and successfully ship it with this techniques.
To most famous wrappers, that I know are node-webkit or electron (AKA atom-shell).
Once you include your game in either one of those you can just "compile" it (it is not a real compile, but just to give you an idea) and ship it: with some tricks it is also possible to publish it in the Mac/Win app stores.
In case you want to focus on mobile instead, there are similar frameworks but I don't really know which are the most common.
Note: if you're using fancy WebGL or very advanced stuff these tools may have some issues sometimes.
So essentially you want to install the JS engine to use it with any browser? In this case, the answer is: nope. Browsers act different, they don't have a standard interface, nor have this "swapping" capability in mind.
In case you'd be asking for an embedded browser inside an app... well, isn't that worse than installing Chrome? You may embed webkit/V8, but it's a hard way and you'd know programming.
So simple answer is: you'd make it compatible for at least the evergreen browsers (Chrome / Firefox mainly). Or reduce your target to webkit based only browsers (or in your case V8, i.e. Chrome, Chromium and the forks).
If you want that your game is only for chrome, because you read V8 documentation, you can create it as an extension. There'sn't other way to install your JS, because browser interpret javascript, not compile it. And the docs you need is found at: https://developer.chrome.com/extensions/getstarted

Viability of HTML5 audio for a music web app?

To preface this, all of my experience has been with developing Ruby on Rails web apps serving, essentially, text data - I don't have any experience yet with rich media.
I'm looking into developing a music notation app (for practice and because I'm dissatisfied with many of the current options), and am trying to determine whether or not to build a native app or a web app. Since all of my programming experience lies in web development, I would prefer to make this a web app if I can, because if I chose to go native I would need to find a decent cross-platform solution in addition to the usual pitfalls of developing natively.
I suspect that even with HTML5 I wouldn't have access to enough processing power to make a browser-based audio engine feasible. It would need to have the ability to play and sequence not a single large .wav file of a song, but many short .wav files concurrently and in sequence. There would be no need for recording - only playback.
But since I've never done this before I really don't know if this is possible. So, I wanted to pose this to more experienced HTML5 media developers:
For modern browsers (I'm not too concerned with support for older browsers), would such an audio engine be feasible? (As in, is the current landscape of JS libraries and the HTML5 audio API sufficient for building something like this?) Or would something like this be far too CPU / memory hungry in a browser?
Thanks!
In my experience Chrome and Firefox for desktop both work great with multiple, sequenced, .wav files embedded in audio tags. You can trigger them with JavaScript and it all seems to work great.
Unfortunately, Mobile Safari seemed to be unhappy with more than one audio tag playing at once, and Chrome for Android had similar limitations. This was a year ago, so things might be different now.
Since we were targeting iPads, we wound up using Phonegap to mix in some native sound libraries into our HTML & JavaScript app. One gotcha that tripped us up: if you want looping audio samples, stick to .wav files; .mp3 files have some silence at the start and end that's really tricky to get rid of.
I've been investigating Web Audio Api to build synths, and it's still very primitive and difficult to use. The infrastructure seems to have had a boost when Web Audio was introduced, but not much development since. Mobile audio on the web is rarely mentioned, too clunky, or unsupported.
At the same time, JS has become significantly faster with the V8 engine, JS loading can happen as needed, asynchronously, and non-blocking, which may solve many of the CPU/memory concerns you have. Look into NodeJS and various module loaders such as webpack, ES6, for more info.
I think there will be attention to web-based music apps because the web can support multiple users. That could be a good reason to keep pushing through these murky waters.. especially if you're talking concurrent connections.
See Molgav tracker. It works on desktop and mobile, it uses hundred of sampled instruments, it has UI adapted for small mobile touchscreens. See how examples sounds.

webview for user interface in android

I was searching for how to use swf file in android and most of the answer suggested me to use webview and an simple html file.
Now i think We can easily put css and javascript files in asset folder and then we can use them in an html5 code.
Looking at the power of HTML5, This will make app development for a web designer very easy job !
I just want to know that is it good to use this approach to build a good user interface in android ? Are there any technical pros/cons behind it ? will i miss some features provided by android ?
There are a lot of frameworks that allow you to write native android applications using HTML/CSS/JavaScript only. Here some of them :
PhoneGap
Cordova
Titanium
I've never used any of them, so I can't say if it's good or bad idea to write android apps this way, but here you can find a good session about it HTML5 versus Android.
There are pros & cons of using cross platforms. As per my point of view you shouldn't go for loading of everything in WebView.
I still recommend you native app approach because of following points :
WebView is one of the UI control in Android SDK. So, it will have
limitation of memory size and working with CPU utilization. So, you
might face performance issues in some devices.
As you know in older era we were used to work with desktop apps and after that everything is shifted to web-application.
It was
possible only because our browser(s) gets more features for e.g. more
memory area, CPU access, threading, individual Processing (like
google chrome) etc...
in-short, web browsers gets more smart and get treated as separate application. Now a days web-application can have mostly similar
performance as desktop apps. So, everything is now shifted to
web-application development.
This era will come in to Mobile development in later stage. but currently we are in middle stage of Mobile development and Cross platform development. So until and unless Web-View control of any platform (iOS / Android) gets more powerful, we can not totally relay on that.
I Hope I explain it properly :)

Measuring memory usage when developing mobile web applications

I'm writing a mobile web application using JQuery Mobile, JQuery, Javascript. This is my first run at writing a mobile web application so I'm trying things out. I want the program I'm writing to continuously run in the background so I can't rely on a garbage collector and I'm worried about memory usage on a mobile device. I'm being careful to "null" and "delete" vars and functions when I'm done with them but I'd like a tool or system I can use to measure. I'm using CS5 Web Premium as the platform with which I'm writing my code. So...
Question: How do you test memory usage when bulding mobile web applications?
The easiest would be to type about:memory in your GoogleChrome browser and watch the memory usage there.....
You could also use something like DynaTrace to get more details per jscript function (execution times and so on)
The Mobile validator of the W3C http://validator.w3.org/mobile/ Should tell you what size your site is. (How much memory it takes to load) That is if your application is HTML.

2D web-game: on what?

I want to make a basic, 2D fighting game (not fast paced nor does it have many cool effects.)
I could make it with jQuery, but I think that it would run slowly (to my knowledge).
Can anyone give me an alternative to flash for the development of this game?
You might want to check out Processing.js, if you prefer not using browser plug-ins.
Processing.js uses Javascript to draw shapes and manipulate images on the Canvas element. The code is light-weight, simple to learn and makes an ideal tool for visualizing data, creating user-interfaces and developing web-based games.
If you like get this game running on the most computers out there I would go for these technologies:
Flash (fast, and availabable and installed nearly everywhere, frameworks for gameprogramming are out there)
JavaScript (no browser-plugin required, but performance will realy suck, especially at older computers or browsers)
Silverlight (could be suitable, but still a just a very few people have it installed and I do not know if there any good working versions for Mac and Linux)
JavaApplets (lesser installations then Flash, could be fine, altough it seems quite unsexy to use JavaApplets in these days.)
I already saw most options listed, but I thought I'd chime in with another great option that is now free (unless your game makes more than $100K/year and then you must pay a one time $1,500 fee: Unity.
This game generation tool allows you to use a visual developement environment with either javascript, boo or C# to develop games that can be played in a browser, on windows or on a mac. Though it is best known for 3D game development, it certainly supports 2D development.
Here is an example of a browser based 2D game made using Unity.
Bubblemark provides a "performance test" of sorts of all of your available options. I'm biased, but I'd still say Flash.
Jquery is not designed whatsoever to do what you want, flash however is the obvious and ubiquitous solution as far as you're talking about a browser game. If you want something localized, look for graphics packages for whatever language you're comfortable with: pygame[python], gosu[ruby]
Saw this yesterday on reddit: http://www.renderengine.com/demos.php JavaScript game engine
You mentioned jQuery for games, and I recently came across the gameQuery library. Coupled with jQuery 1.4 (with recent performance improvements) and the fact that all major browser vendors are falling over themselves lately to improve JavaScript performance, building a game without Flash or Silverlight is now feasible and productive.
I have also investigated the Raphaël library (raphaeljs.com), a low-level graphics alternative to Processing.js and canvas mentioned earlier. SVG elements are indeed compatible with jQuery. Here's an example of a hex grid on Raphaël with jQuery for click events.
You should check out Effect Games.
It is a free to use, online hosted Javascript Game Engine that runs incredibly smooth and supports all major browsers. Don't believe me? Play this demo, or this one.
Those that say you must use Flash and Javascript is too slow, obviously haven't been paying attention, especially to the newer browser such as Chrome that utilise compiled javascript. Why use Flash, when you can have a cross platform, cross browser game developed using native browser functionality.
You should also check out Chrome Experiments to see just how much current Javascript (and sometimes HTML5) capabliities have improved.
Effect Games provides free, online
tools for building, sharing and
playing your own browser based games.
Your games may include sound effects,
music, and multiple layers of
parallax-scrolling tiles and sprites.
Users can play your games right in
their browsers, without needing any
new plugins or extensions. Publish
your games on your website or blog,
share on social networking sites, and
submit them to our featured games
section!
Build your games using JavaScript and
our custom browser game engine, level
editor, and suite of developer tools.
The Effect Engine supports Mac OS X,
Windows, Linux and all modern browsers
including IE, Firefox, Chrome, Opera
and Safari.
Microsoft Silverlight is similar to flash, but not flash.
Flash can be done in the traditional sense or in Flex if you want it more of a traditional programming experience. Silverlight is a great flash substitute if you would rather do your programming in .net. Javascript games are possible but difficult to do I think you would save a lot of your time if you did it in flash instead.
I believe a great option would be to use SilverSprite. It allows for creating XNA games for Microsoft SilverLight using the same knowledge base you find for Windows and XBOX 360 (only working for 2D games so far)
Panda3D is a full-blown game engine that can make browser-based executables. I have not tested this functionality myself, but it seems to work pretty well.
http://www.panda3d.org
check it out, it rocks.
http://gamejs.org
or any of https://github.com/bebraw/jswiki/wiki/Game-Engines

Categories