Advice for Web Developer Creating Online RTS HTML5 with Proof of Concept

Started by
5 comments, last by Aurelius1664 11 years, 6 months ago
New to the forum and looking for some advice...

We are a Web Development Company and have done some small to medium web sites using a mixture of C# and Javascript (including some fairly advanced JavaScript stuff). However, we are currently looking at diversifying to create products and one option was small games online and for mobiles.

We've developed a Real Time Strategy Engine, or at least a Proof of Concept for one, in pure HTML5. We've tested it to a certain degree on most of the modern browsers and on the iPhone (planning on testing on Android ICS but not sure about HTML5 support). All of the move, fire, build code and some visual effects and sounds are all working well (link below). It's probably about 5 weeks of research and development that originally started around learning the [color=#222222]nuances of HTML5.

Proof of Concept (EDIT: Now works on iphone minus sound)
http://jsrtsengine.c...vascript.co.uk/

The idea is that the HTML will work not just on normal browser but also on phones (works fine on iphone other than sound) creating a nice cross platform game without massive cross paltform effort. We planned to write simple browser wrappers for iPhone and Android to create saleable apps (and fix the sound issues on iphone).

However, I'm really rather unsure of what to do next. Is it possible for an [color=#222222]independent company to achieve success with something like this? Is there any money to be made from this approach? Is this something that could be taken to a publisher? Or is this just so saturated that attempting anything like this just isn't worth any more effort?

One idea was to laucnh the game with an editor, which we have a basic rough and ready version of, and try do something community based. Any thoughts or ideas would be most welcome as we have no experience what so ever in this field!
Advertisement
If anyone is interested we've got quite far on with this as a bit of a what if experiment and are now putting in into an open BETA. We've also got a native iPhone version that we're testing running from the same core JavaScript and XML files. We came across quite a few problems gettting the game to work on iPhone in "all" JavaScript though. The game runs in the UIWebView however the frame rate is shocking, despite being fine just running in Safari. Turns out this is a common problem with wrapped web apps as Apple does not alow their full Nitro JavaScript engine to be used due to security permissions. So we had to write a native canvas class called by the core javascript and rendered on top of the UIWebView. This seems to work and the framerate is now better than the native HTML5 even in Safari. We also used this method to get around Apple's restrictions on playing sound in HTML5 without a media player style UI and are attempting to use a smiliar process to enable multiplayer over Bluetooth.

Beta is below, any feedback is appreciated...

http://www.enterprisewarfare.com
Very impressive!

I think HTML5 is really going to take a place as a great development option over the next couple of years, and there are a lot of great development tools and libraries in the works.

I've found Android to be problematic thus far -- completely unplayable prior to ICS, and a HUGE variation in device capabilities to deal with -- hopefully this -- along with other problem areas such as audio -- is something that will be resolved over time.


I take it you're developing your own wrappers and support libraries where needed rather than trying to work with an existing platform such as AppMobi or CocoonJS? Of these libraries I've found PhoneGap to be the best in terms of exposing device functionality and working on the largest range of devices, but unfortunately only the simplest of graphics perform at an acceptable framerate -- it's a great library for a simple app, but unusable for most games -- I've heard it does offer good performance on a BlackBerry PlayBook however. AppMobi and CocoonJS seem to offer much better performance on their targeted platforms, but don't expose much device functionality, and seem to really be pushing their own deployment services and add-on (high-scores, etc.) APIs, which makes me more wary of any serious usage.

- Jason Astle-Adams

Yeah we can pretty much hit our target of 25 to 30 fps when on IE9, Firefox, Safari and Chrome on desktop (Chrome seems fastest at present). This is running on fairly old spec. machines so we're quite happy as we've yet to optimise a lot of the code.

On iPhone 4 running through Safari we get about 15 to 20 fps (you can run this yourself via the links above). However, if you pin the game via 'Add to home screen' or run the game in an app via UIWebView the frame rate drops to 4-8fps. This is because Apple disables its Nitro compiler engine for 'security reasons' which slows everything right down if it is outside of Safari.

To get around this we have written a wrapper for the iPhone app version. The core engine and menus run via the UIWebView in exactly the same code as the browser version. However, the JSRTSCanvas JavaScript 'class' is 'overridden' on the iPhone to simply create a call log. This log is then passed back to iPhone native code at the end of frame and performs the drawing using Quartz 2d on a standard UIView. This gets us right back up to the target 25 to 30 fps (and possibly higher but that’s the target frame rate set by the engine). Indecently we also pass the sound calls back to Objective-C on the native app too and intend to do something similar to do Multiplayer support.

On Android (ICS) running directly in the browser we get about 10fps on a Samsung Galaxy 2 (newer phones will obviously be better but that's all we have to test on at the moment). Not sure how well this will work in an actual App using the Android’s embedded web view but I suspect similar if not worse performance. We anticipate we'll have to do something along the lines of what we're doing with the iPhone application. We’ll be moving on to the Android version once the iPhone and browser versions are complete hopefully.

This is very much a cross platform experiment/research project to see how viable HTML5 is for such things. So far whilst it runs well on desktops and runs on mobiles there are still major performance problems. However, it does seem that JavaScript as a cross platform core combined with overridden ‘system’ classes to cover gaps and improve performance is workable. The cost savings in not having to re-develop everything for native apps on each platform are still very attractive.
We have just added multiplayer support for up to four players.

http://www.enterprisewarfare.com/play.aspx

Also updated to show better loading progress on Chrome and Safari and fixed a few other bugs.

Plus it now runs, though a little slow, on the Playstation 3's browser.
That looks amazing! I'll have to give it a longer try when I get home from work. I've actually dabbled with creating some games using HTML5, nothing as advanced as your's but I find it a decent enough platform to be able to create a decent game. The only thing that I can ever see as a problem is the ever changing world of browsers and what they support. I can see it being a pain to keep a large project maintained so it will be supported on all platforms at all times on all browsers.

Hopefully this will be an easy hurdle to jump.

I'll keep a watch out on the development of the game!
*** Why'd you run away? ****** Don't you like my... style***
We have just taken this into open beta on Facebook. The app now has Facebook integration with their credits api and the ability to challenge friends and play multiplayer in realtime. Still with everything written in HTML5 and Javascript (other than the server side code for multiplayer which is C#/.NET). Any feedback would be much appreciated, link below.

http://apps.facebook.com/EnterpriseWarfare

This topic is closed to new replies.

Advertisement