Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Denzil Quixode on Thu 13/01/2011 04:05:26

Title: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Thu 13/01/2011 04:05:26
Inspired by this thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=40394.0) from last year, I have been working on a proof-of-concept demo for an AGS game running in a browser, a similar idea to clarvalon's XAGE running on .NET Silverlight (http://clarvalon.blogspot.com/), except that the primary language is the browser's own JavaScript, using HTML5 or Flash to handle the audio and graphics output.

The demo is of Ben Chandler's awesome miniature-epic "!" (http://www.adventuregamestudio.co.uk/games.php?action=detail&id=1254), for which he graciously released the source code last year (http://ben304.blogspot.com/2010/05/sauce.html).

Web Runtime Proof-of-Concept Demo (http://octospherics.com/toolbox/webruntime/)

Any relatively recent version of Firefox, Opera, Chrome or Safari should be able to play this without requiring Flash. IE8 (and hopefully IE7 and maybe IE6, though I haven't been able to test) should be able to play it, but will require Flash 10+ plugin. You can also see it in Flash mode in other browsers if you like:

Web Runtime Proof-of-Concept Demo: Flash Mode (http://octospherics.com/toolbox/webruntime/?flash)

The "engine" is very incomplete, in fact it just barely covers the functionality needed to play this one specific game, and I even cut some corners towards the end because I was getting impatient :P But not too much, and I am pretty confident it could be fleshed out into something that could run most any AGS game. The question is, of course, whether this is something people really want, particularly as it is much, much harder to "protect" your game's resources. Someone determined who knows what they're doing can easily download all the files, read the script code, etc.

Feedback and discussion welcome!
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Gilbert on Thu 13/01/2011 04:18:50
Wow amazing. I like how it manages to run on nearly everything.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: cianty on Thu 13/01/2011 07:08:25
That's really awesome. I do hope you continue work on this.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: ThreeOhFour on Thu 13/01/2011 08:14:26
Very impressive - aside from music issues I played through the game without noticing any gameplay or presentation glitches at all.

It's hard to deny that the open-ness of the code could be a sticking point, but for the most part I think it'd be preferable to not being able to put the games in a browser at all. The ability to run games in a browser overshadows, for now at least, protection of one's assets - particularly in smaller freeware games.

I'm interested in a couple of things - ability to scale beyond manually doing it with browser zooming features, support of things such as alpha channels, the actual conversion process, eventual support for saving/loading, support for accessing other external files aside from save files (such as, but not limited to, translation files and running other .exes from ), support for plugins (such as, but no limited to, ogg theora player) and support for things such as 8 bit colour modes and the like.

Also, ! probably is not the best simple conversion candidate due to the unconventional nature of it. Have you tried working with multiple mouse modes and inventory items?

Once again most impressive work. If you'd like more source code to experiment with let me know and I'll happily send you some.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: kaputtnik on Thu 13/01/2011 09:50:31
This is fantastic, really. Being able to run AGS games in a browser window without so much as an extra plugin (I suppose people who play games in their browser have Java or Flash installed anyway) is such a huge step towards a much, much broader audience. Adventure games are just perfect for more "casual" players, who in some cases have never even downloaded or installed a game (many of my friends are like that - they grew up playing games on consoles, while on the PC, browser-based Flash games are their way to go).

I mean, technically you could even think of facebook as a means of spreading AGS games, there are so many people on office lunch breaks or just browsing randomly, with so much free time on their hands, and adventure games have a very low entry barrier - you just click and things happen, no further gaming knowledge required.

And it's also a great way for AGS games to reach Mac and Linux users!

I would love to see this continued, this is just awesome.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Calin Leafshade on Thu 13/01/2011 09:59:17
Agreed, little AGS games are usually rather casual affairs and the browser is where casual games are king.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Wyz on Thu 13/01/2011 12:36:51
Ah! I've been waiting for this, good show! Though not all adventure games lent themselves for a in browser experience, many actually do. I'd say the more casual ones that require less immersion, they would really work well boxed. For that reason I see browser based games as the future (or more accurate one of the futures*) of adventure games, and this proof-of-concept as an important step in the right direction.

HTML5 will only increase the flexibility of browsers and interactive content so I believe we could do without extra plugins like flash in the future and without having to drop certain features. Well I'm looking forward where this goes. You certainly proved it can be done!

*) I want to be clear on this: the need for dedicated game engines will never leave, some games need to be fullscreen or require additional resources and a special place on ones desktop. But other games might thrive in a easy accessible environment, stumbled upon. The genre is broadening.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Wonkyth on Thu 13/01/2011 12:42:22
AGS games in HTML5?/me likes this
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Thu 13/01/2011 13:11:12
Quote from: Ben304 on Thu 13/01/2011 08:14:26
Very impressive - aside from music issues I played through the game without noticing any gameplay or presentation glitches at all.
Thank you! These are the music issues I know about, let me know if you are talking of ones that are not covered:
QuoteIt's hard to deny that the open-ness of the code could be a sticking point, but for the most part I think it'd be preferable to not being able to put the games in a browser at all. The ability to run games in a browser overshadows, for now at least, protection of one's assets - particularly in smaller freeware games.

That is what I am hoping. It is always going to be up to the individual to decide, before anyone starts getting worried that this could ever potentially be forced on their games - even though I have called this the "web runtime" demo (because of that other thread), it really isn't a runtime like the existing Linux or Mac runtime projects - you would not be able to use it to run compiled games, you need the original source code to convert a game to be able to run on this. So unless you have released the source to your game, in which case anyone can see the scripts/resources anyway, you are the only one who could make that decision.

But maybe it will be possible to make something that runs server-side: node.js (http://nodejs.org/) is a project for running JavaScript on the server, on Google's highly advanced V8 JIT JavaScript engine; Socket.IO (http://socket.io/) allows two-way communication between client and server; and I know there are projects out there to allow node.js to use jQuery and Canvas, which could conceivably all be put together to run this same code on the server and transfer image data to the client. Whether it could be fast enough, and how many users it could actually sustain at once, are the big questions. I have no plans to try doing this myself, but maybe someone else could do their own proof-of-concept...

QuoteI'm interested in a couple of things -
Okay...
The HTML5 specification quite specifically does not allow you to control how a bitmap image is scaled, which means that if you scale something up to 2x using <canvas> features rather than browser zoom, the result is most likely going to be exactly the same. And it really is too slow to do it manually pixel by pixel, in real-time at least.

Mozilla has a proprietary CSS extension which allows you to specify that an image (or HTML5 canvas) should be rendered with sharply-edged pixels rather than that kinda blurry filtering. This is actually used in the demo, which is why it should always have nice sharp pixels when zoomed in with Firefox, but no other browser.

Flash has the advantage here. With Flash you can both specify that you want something rendered without smoothing, and Flash 10 also has Pixel Blender (http://www.adobe.com/devnet/pixelbender.html) which allows you to run pixel shaders that I believe could be used to do some advanced pixel art scaling algorithms (http://en.wikipedia.org/wiki/Pixel_art_scaling_algorithms) in real-time.
Alpha support is as far as I know is very good, for both Flash and Canvas.

Tinting looks much much easier to do in Flash than Canvas, though.
While the process in this case was mostly manual, I have not done anything an editor plugin could not do automatically (I think...). The scripts are transformed using a C# AGS-Script parser I wrote myself (http://code.google.com/p/spags/), the images and fonts are all exported as PNGs (and packed into a single image (http://octospherics.com/toolbox/webruntime/sprites/spriteSet0.png) using the (C#, MIT-Licensed, open-source) Sprite Sheet Packer (http://spritesheetpacker.codeplex.com/)). I even decided not to have MP3 alternative versions of the Ogg Vorbis music, even though that would make it far easier to play on Flash (and Safari's <audio>), because transcoding music from one lossy format to another is a process that I feel the user would need to control and consent to.
All I can say at the moment is, I don't think it would be that difficult to get the game saving and loading to a JavaScript string, and from there whatever weird and wonderful methods people want to use to store and retrieve those strings can be written around it. I'll know more when I actually try to do it :P
I actually don't know much about translation files yet.

Other .exes, no. Other games similarly converted, yes, most likely.
Well, my idea is that you should be able to customise the export process so that you can supply alternatives yourself for resources like music, video and so on, and this could of course support formats that are not supported by the original AGS engine.

Also, I have ideas that you should be able to do things like this in your AGS code:

#ifdef WEB_RUNTIME
 WebRuntime.CallJavascriptFunction("alert", "Hello World!");
#endif

...so customisation of the web version of the game could be endless.
I am actually far more confident that Flash could be used to simulate 8 bit colour games, with realtime palette effects and everything, than HTML5. Surprisingly enough.
QuoteAlso, ! probably is not the best simple conversion candidate due to the unconventional nature of it. Have you tried working with multiple mouse modes and inventory items?
This is true, and no, I have not. Even more significantly, it doesn't even have walk zones. Walk zones! How do you live without them?
Quote
Once again most impressive work. If you'd like more source code to experiment with let me know and I'll happily send you some.
Thank you, that would be great. I definitely would like to try a medium sized game with walk zones, mouse modes, inventory items, many rooms, etc.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Wersus on Thu 13/01/2011 14:03:24
I'd say this is very interesting. Although AGS dodges one bullet by not forcing people to install the game, it still needs to be downloaded and for some that is too much. Especially to try a game of such niche market.

It would be great to see this kind of thing truly coming to life.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: kaputtnik on Thu 13/01/2011 14:45:42
Feedback time!

I've briefly tested the Java version on all browsers I have installed (2,2Ghz Dualcore Thinkpad, Linux Mint) and had very different results concerning audio and game performance. The best choice seemed to be Chromium, though.

Chromium: Game runs smoothly, audio performance is pretty good, no stutters - but audio files are always cut off something like a second before they have finished playing.

Firefox: The zoom looks good and crisp (as you mentioned), audio stops after spending some seconds in a room and only starts playing again when you change the room (although sometimes it doesn't) - there is also a pretty heavy lag when leaving a room.

Opera: Really heavy graphics lag when leaving a room, funny colour confusion (if a conversation spans over two lines, they appear in two different colours, the @OVERHOTSPOT@! text will sometimes be displayed in blue or green tint, hovering over dialogue options tints them green. Opera had the best audio performance, it never so much as stuttered and the files played nicely to the end (even though they didn't loop seamlessly, but you already mentioned that issue)

Midori: Audio stops from time to time, heavy lag when leaving a room, but none when entering. Game runs pretty slow. I realize that maybe 8 people in the world use Midori as a browser on a daily basis, but I had it installed, so I wanted to mention it...

Maybe you can use some of this feedback - I guess audio handling and performance is still the weakest spot of your proof-of-concept, but this is probably because of the script necessary to play .ogg files. If you want, you have my official permission, as creator of the soundtrack, to convert from .ogg to .mp3 for test purposes.







Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Thu 13/01/2011 15:31:08
Quote from: kaputtnik on Thu 13/01/2011 14:45:42
Feedback time!

I've briefly tested the Java version on all browsers I have installed (2,2Ghz Dualcore Thinkpad, Linux Mint) and had very different results concerning audio and game performance. The best choice seemed to be Chromium, though.
Thanks very much for your report!
QuoteChromium: Game runs smoothly, audio performance is pretty good, no stutters - but audio files are always cut off something like a second before they have finished playing.
Hmm, interesting. The <audio> output should be using the 'loop' parameter to loop audio (except Firefox, which doesn't support it for some reason - I set up a dirty hack to detect this and use a JavaScript timer to check whether the sound has finished playing every quarter of a second...) so it sounds like it may be a Chromium bug.
QuoteFirefox: The zoom looks good and crisp (as you mentioned), audio stops after spending some seconds in a room and only starts playing again when you change the room (although sometimes it doesn't)
Ah, maybe my dirty hack didn't work so well then. And I have no idea why a new audio track just wouldn't start up at all. :P
Quotethere is also a pretty heavy lag when leaving a room.
That might be the walk-behind buffers being redrawn, not sure...
QuoteOpera: Really heavy graphics lag when leaving a room, funny colour confusion (if a conversation spans over two lines, they appear in two different colours, the @OVERHOTSPOT@! text will sometimes be displayed in blue or green tint, hovering over dialogue options tints them green.
This is very interesting - I don't think I ever noticed any such graphical glitches when I tried it in Opera (11.00 build 1156, Windows). I'm relying on the 'globalCompositeOperation' property of <canvas> to colour the text, I'm not sure there is much I can do if a browser doesn't seem to support it too well.
QuoteOpera had the best audio performance, it never so much as stuttered and the files played nicely to the end (even though they didn't loop seamlessly, but you already mentioned that issue)

Midori: Audio stops from time to time, heavy lag when leaving a room, but none when entering. Game runs pretty slow. I realize that maybe 8 people in the world use Midori as a browser on a daily basis, but I had it installed, so I wanted to mention it...
I had never heard of Midori before, I'll have to look into it. The more the merrier!

QuoteMaybe you can use some of this feedback - I guess audio handling and performance is still the weakest spot of your proof-of-concept, but this is probably because of the script necessary to play .ogg files. If you want, you have my official permission, as creator of the soundtrack, to convert from .ogg to .mp3 for test purposes.
Thanks :) I might do that soon as a separate page to see what the comparison is like.


Edit: Ha, I just tried it on Midori 0.2.6 for Windows and the graphics seem to work fine - except that it ignored the width and height I gave the canvas, so it remains a cropped 300x150 pixels...
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Thu 13/01/2011 23:44:03
Okay, I've quickly made an MP3 version of the demo:
Web Runtime Demo: MP3 edition (http://octospherics.com/toolbox/webruntime/mp3.html)
Chrome/Chromium and Safari should play MP3s in HTML5 <audio>, but everything else will probably require Flash to play audio in this version. I made the Flash MP3 player very quickly today and it might have some bugs still, but it does support crossfading and track mixing.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Clarvalon on Fri 14/01/2011 00:27:08
also managed it in javascript (I'm warming to JQuery but in general find development and debugging a slow and arduous affair, even with FireBug).

Quote from: Denzil Quixode on Thu 13/01/2011 13:11:12
  • ability to scale beyond manually doing it with browser zooming features
The HTML5 specification quite specifically does not allow you to control how a bitmap image is scaled, which means that if you scale something up to 2x using <canvas> features rather than browser zoom, the result is most likely going to be exactly the same. And it really is too slow to do it manually pixel by pixel, in real-time at least.

I had the exact same problem with Silverlight version of the engine, where point scaling isn't possible unless its done manually (which hurts performance quite a bit, which is why the Awakener Facebook app has several quality settings).  I've also had problems recreating AGS's SeekMP3PosMillis function due to limitations with the XNA framework's audio manipulation.  But that you got everything else to work so flawlessly, Ben's fiddly backward animations and all, is super impressive.  

Excellent work!  You're a machine, Mr. Quixode.  I wonder how many different formats we'll eventually be able to enjoy robotic rap battles on.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: straydogstrut on Fri 14/01/2011 01:42:42
Brilliant work Denzil! Tried it out on my iDevice just for kicks and it works pretty good, albeit sans sound and it's hard to touch accurately when it's scaled up, but seeing it running is a real pleasure. I hadn't tried this one of Ben's yet but it didn't disappoint. The writing is brilliant. I'll have to finish it back on my desktop though as it would be a challenge to persevere this way. Good work though, this would be a welcome addition in my opinion.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Fri 14/01/2011 01:48:47
Thanks sds :) Would you mind trying the MP3 version (http://octospherics.com/toolbox/webruntime/mp3.html) on your iDevice to see if the audio works then?
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: straydogstrut on Fri 14/01/2011 07:14:15
Tried it last night, but just tried it again now: no joy I'm afraid, unless I've done something silly. It's a 4th gen iTouch running Safari if that makes any difference. I wouldn't worry too much about it though.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Shane 'ProgZmax' Stevens on Fri 14/01/2011 12:55:36
Pretty interesting.  Since my site uses highslide for all popups it would definitely be interesting to be able to allow people to play games in popup, resizable windows directly from the site.

You show much potential, young jedi.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: tzachs on Fri 14/01/2011 13:43:49
That's pretty exciting!
Specifically the flash port would be most useful in order to get AGS game distributed to portals.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Fri 14/01/2011 16:00:20
Quote from: straydogstrut on Fri 14/01/2011 07:14:15
Tried it last night, but just tried it again now: no joy I'm afraid, unless I've done something silly. It's a 4th gen iTouch running Safari if that makes any difference. I wouldn't worry too much about it though.
Ah, thanks anyway. As I understand it Safari does support <audio> but only for MP3s, not Ogg Vorbis, and that seems to be the case in my (desktop, Windows) version of Safari. I don't know how different the mobile version of Safari is, or whether it lags behind in the feature set, or what.

Quote from: tzachs on Fri 14/01/2011 13:43:49
Specifically the flash port would be most useful in order to get AGS game distributed to portals.

It might not be as easy as that - even in Flash mode, it really is still JavaScript running the show. The Flash part is a tiny 10kb "renderer" SWF that knows nothing about any of the game logic and simply displays what it is told to by the JS. I assume that what the portals want is a single, self-contained Flash file.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: deadsuperhero on Fri 14/01/2011 16:19:40
Quote from: tzachs on Fri 14/01/2011 13:43:49
That's pretty exciting!
Specifically the flash port would be most useful in order to get AGS game distributed to portals.

There would be a field day on a site such as Newgrounds, I'd imagine.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: benco on Tue 18/01/2011 12:28:15
First of all, as everybody said: Congrats !  ;)

You were the fastest ha ha  ;D ... I was planning to make an adventure game engine in html5/js. I had begun collecting resources last year and AGS (that's still my favourite engine) was in my opinion the best candidate to analyse (api requirements ...) for my first experimentations.

I took a look at your js code. Indeed, it's a really incomplete engine but there are nice stuffs all the same (in my case, I wasn't planning to base all on canvas but also on imgs-areas-maps but it seems to rock anyway) !

Just about the music and sounds:

* On mobile safari, there is currently a bug that impede playing more than one sound file at the same time and I don't know when they plan to fix it :(
* I think when the new mozilla audio api will be popularised and used , it will allow playing more audio formats - a bit like new flash 10 stuffs allow now. And there are already experimentations done about Amiga MODs playing what is really awesome: you might take a look at the dynamicaudio.js library and the jsmodplayer project on github, it's really interesting

Good luck with it all! 
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Tue 18/01/2011 17:00:33
Quote from: benco on Tue 18/01/2011 12:28:15
First of all, as everybody said: Congrats !  ;)

You were the fastest ha ha  ;D ... I was planning to make an adventure game engine in html5/js. I had begun collecting resources last year and AGS (that's still my favourite engine) was in my opinion the best candidate to analyse (api requirements ...) for my first experimentations.

I took a look at your js code. Indeed, it's a really incomplete engine but there are nice stuffs all the same (in my case, I wasn't planning to base all on canvas but also on imgs-areas-maps but it seems to rock anyway) !
I have been wondering about attempting a really retro-DHTML renderer that doesn't need Flash or HTML5, just works with absolutely-positioned <img>s and <div>s and stuff. It wouldn't be able to do everything, but for a particularly simple game it might be enough. It's hard to imagine there are really that many people left who would benefit from it, though...

QuoteJust about the music and sounds:

* On mobile safari, there is currently a bug that impede playing more than one sound file at the same time and I don't know when they plan to fix it :(
Crap, that is annoying. I suppose the solution is to do some (ugly) browser-sniffing and then ensure there's only ever one audio file playing at once...
Quote* I think when the new mozilla audio api will be popularised and used , it will allow playing more audio formats - a bit like new flash 10 stuffs allow now. And there are already experimentations done about Amiga MODs playing what is really awesome: you might take a look at the dynamicaudio.js library and the jsmodplayer project on github, it's really interesting
Cool, yeah, very interesting stuff. I am trying to make the audio system modular so it could potentially use several different ways of playing sound in the same game, depending on the formats the game uses and what plugins/features the player's browser has.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: benco on Tue 18/01/2011 18:43:45
Quote from: Denzil Quixode on Tue 18/01/2011 17:00:33
I have been wondering about attempting a really retro-DHTML renderer that doesn't need Flash or HTML5, just works with absolutely-positioned <img>s and <div>s and stuff. It wouldn't be able to do everything, but for a particularly simple game it might be enough. It's hard to imagine there are really that many people left who would benefit from it, though...

Of course, for special effects... canvas/flash is the only way to go. But I think the advantage of dhtml can be found in managing hotspots and areas (walking, interactive ...). Those one should be simpler to implement. And the algorithm for path-finding could thus be simpler too - but knowing that I was thinking about a specific html5/flash  editor too that would also generate some init data...

Quote from: Denzil Quixode
Crap, that is annoying. I suppose the solution is to do some (ugly) browser-sniffing and then ensure there's only ever one audio file playing at once...

I think the only solution would be in this case (and yep, you should snif the browser version/os version - not sure if it's inherent in webkit or iOS):
1) pause() the current sound
2) save the track position
3) put the position to the end
4) play the second sound
5) wait for the complete event
6) restore the position on the first track
7) play()

to test... (and knowing that it only works with two concurrent sound files only)

Cheers,

Benco
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: theo on Sun 23/01/2011 11:31:46
Insane yet highly impressive project!

Definitely interested in seeing where this leads. Keep up the good work!
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Sat 05/02/2011 18:51:21
I am experimenting with WebGL rendering. WebGL looks very cool but is only available in the bleeding-edge beta preview versions of Firefox 4 and Chrome 9 at the moment.

If you have one of those (you can get the Chrome 9 beta from http://www.google.com/landing/chrome/beta/ (http://www.google.com/landing/chrome/beta/) or Firefox 4 beta from http://www.mozilla.com/en-US/firefox/beta/ (http://www.mozilla.com/en-US/firefox/beta/)), I'd appreciate it if you would try this page and tell me if you see two of exactly the same image, or if there are any graphical glitches/other problems:

http://octospherics.com/toolbox/webruntime/paltest.html (http://octospherics.com/toolbox/webruntime/paltest.html)

The left side is a normal image, the right side is a WebGL-rendered version using a shader to simulate 8-bit palette mode.

Edit: I have a second test page now with some simple palette effect buttons. I've no idea why but on Chrome you may need to click them a few times before they will work (Firefox doesn't seem to have this problem):

http://octospherics.com/toolbox/webruntime/paltest2.html (http://octospherics.com/toolbox/webruntime/paltest2.html)
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: hedgefield on Sun 06/02/2011 12:49:55
I'm running the latest official release of Chrome 9 and both links work absolutely fine over here. I do need to press each of those buttons twice for it to work, but it works :)
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: benco on Tue 08/02/2011 09:29:05
works great on my FF 4 beta 10 (win32)...
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Tue 08/02/2011 09:42:48
Great to hear, thanks guys.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: arj0n on Tue 08/02/2011 12:04:25
Firfox 4 Beta 10 results:

(http://arj0n.webs.com/webruntimedemo.png)
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Tue 08/02/2011 20:46:48
Thanks for the report. I have modified the technique, could you try again and let me know if it is any better now?
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Wyz on Tue 08/02/2011 22:01:16
It worked great for me (Chrome 9) but the new technique looks just like Arj0n's. :(
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Tue 08/02/2011 22:17:59
Really? Damn... I can't reproduce that, it looks OK to me on the latest Chrome 9 (I just updated, no difference) in both 32-bit and 16-bit color mode. It's probably unlikely to be this but could you try a Ctrl-F5 hard refresh? Just in case...
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: arj0n on Wed 09/02/2011 13:11:31
Tested again in Firefox 4.0 Beta 10, don't know why but the result looks good/better now:
(http://arj0n.webs.com/webtest2.png)


*Also tested in Firefox 4.0 Beta 11 [latest beta at this moment] but no go: "Could not initialise WebGL, sorry :-("
Tried to reactivate WebGL using 'about:config': no result.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Wed 09/02/2011 19:42:01
Quote from: iCyborg on Wed 09/02/2011 13:11:31
Tested again in Firefox 4.0 Beta 10, don't know why but the result looks good/better now:
(http://arj0n.webs.com/webtest2.png)
Because I changed it := I switched Windows into 16-bit colour mode and started getting the same result you did, realised what was going on and altered the code to work around it. (However, Wyz reports that doing that has broken it in Chrome for him, but I still haven't managed to reproduce this...)

Quote from: iCyborg on Wed 09/02/2011 13:11:31
*Also tested in Firefox 4.0 Beta 11 [latest beta at this moment] but no go: "Could not initialise WebGL, sorry :-("
Tried to reactivate WebGL using 'about:config': no result.
Hmm, can you see if you can run any WebGL things? Possibly I'm trying to initialize it wrong or something.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Kyari on Sun 06/03/2011 20:14:12
I know it's been almost a month since there was an update here, but I just figured I'd post a reply anyway to confirm that it runs on both iPhone and Android 1.6 (sort of)

Using the default Safari browser for iOS 3.1.2 on an iPhone 3G, the game runs at about half speed. You need to turn off automatic screen turning off, otherwise the game won't progress after it automatically dims. On the plus side, assuming you do nothing that causes your virtual memory to spike and the iPhone to clear your Safari cache, you can close and reopen the browser and it will still be where you left off:

(http://img135.imageshack.us/img135/6789/img0064.png)

On my Android 1.6 tablet however it went less well, all of the non-background assets (text, characters and objects) were partially see-through, and I don't know if this was due to my low spec tablet, or a limitation of the OS.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Monsieur OUXX on Mon 07/03/2011 10:51:43
Are you planning on releasing the source code? Maybe I read too fast but I didn't see if you already did. Or maybe it's just in the page's source?
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Denzil Quixode on Mon 07/03/2011 11:12:46
Kyari: Thanks very much for that! It's hard to know whether the slowness or transparency weirdness is something I can reasonably fix without having my own device to experiment with, but it's good to know at least that the game runs at all.

Ouxxey: I haven't formally released any source code yet. The demo JS code is probably easy to find but it's minified, which makes it harder to read as the whitespace is stripped out and the variable names are replaced with letters etc., but that was just in an attempt to make the demo as small as possible rather than a serious attempt at protecting the code. If I manage to make a releaseable version of the converter and JS engine (still working on it) I am currently thinking of releasing it under an MIT/BSD type license.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Monsieur OUXX on Mon 07/03/2011 11:53:36
Quote from: Denzil Quixode on Mon 07/03/2011 11:12:46
If I manage to make a releaseable version of the converter and JS engine (still working on it) I am currently thinking of releasing it under an MIT/BSD type license.

I'm always scared by those "if" (not specifically you, but in general). I'm happy to see you're still working on it, but don't let your project disappear in the void just because it's "not ready". :)
(I'm saying this not in a patronizing way, but just because I'm excited about it)
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: Kyari on Mon 07/03/2011 14:51:48
Quote from: Denzil Quixode on Mon 07/03/2011 11:12:46
Kyari: Thanks very much for that! It's hard to know whether the slowness or transparency weirdness is something I can reasonably fix without having my own device to experiment with, but it's good to know at least that the game runs at all.

I think it's largely down to the comically low specs of my tablet (400Mhz CPU, 128mb RAM) rather than a failing of the Android OS, I can get access to another Android device and try it out for certain (mostly because of my own curiosity than anything else).

As far as the iPhone goes, there is a slight problem that I think is just because of the way Safari processes things, in that whenever you tap the screen it registers your touch as a click before it moves the cursor to that position you just touched. Also, holding a tap results in it trying to select/copy the game. Just figured I'd let anyone know who had aspirations of creating a game with the intention of porting to browsers for iOS.
Unfortuanately, because of Apple's rules around javascript and whatnot, all alternative iOS browsers are built using the same webkit, so there would likely be little or no change in performance in from any alternatives. The exception to this is Opera Mini, but since it basically only gives a compressed screenshot of what you SHOULD be seeing, it doesn't run or refresh java correctly.

I imagine running it on a 3GS or an iPhone 4 would have much more favourable results, but unfortuanately I don't have access to either of those to try it on.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: deltamatrix on Thu 10/03/2011 19:30:11
Wow! Nice!

See this is something that AGS could seriously benefit from. But I'm thinking moreso being able to DEVELOP the AGS games on the cloud rather than just merely play them. This makes perfect sense for AGS as it is mostly driven by an internet community and lots of non-solo AGS development projects utilise human resources distributed the globe. As AGS is not well-adjusted for source control such as CVS, its own cloud development tool would be ideal if it could ever exist.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: SSH on Fri 11/03/2011 02:16:12
All seemed to look OK on an HTC Desire with Android 2.2
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: benco on Fri 11/03/2011 09:43:15
Quote from: Kyari on Sun 06/03/2011 20:14:12
Using the default Safari browser for iOS 3.1.2 on an iPhone 3G, the game runs at about half speed.

I've heard that Mobile Safari has been enhanced with iOS 4.3 but I don't know if the speed difference is that notable.
Title: Re: Proof-of-Concept "Web Runtime" Demo (HTML5 / Flash 10)
Post by: selmiak on Fri 11/03/2011 14:57:20
really cool! :D
No problems in FF4 RC1
Now only savestates are missing.