WebGL

Discussion and feedback on Construct 2

Post » Fri May 04, 2012 4:14 am



Its Great... But DON'T enable it from Configuration Settings yet, and here's Why..

Provide WebGL as an OPTION!

WebGL is awesome it really is, when things are working properly. But (because of crappy video drivers and/or hardware) some Computers will render the WebGL content, but it is painfully SLOW and therefore the game isn't really playable, Resulting in a Closed window or Backspace - LOSS OF POTENTIAL LONG-TERM FANS OF YOUR GAME!!!!

So what can be done for Computers that can run WebGL, but really shouldn't be?

1. Regular Website:
If you have your own website a work around is easy. Build 2 versions (one with WebGL, another without). Have a start screen where the Person can also choose a button "Enable WebGL" which will open the URL using the browser object to where the WebGL version is (Open URL - "http://mydomain.com/game/webgl.html"). If it is slow they can simply backspace and choose to Play the Regular (canvas2D) version. Or on the start page, some type of testing can be done to determine if it can run GOOD WebGL, if not it will go to a page on your site where the Regular version is.


The Game is compiled twice (without WebGL and with it) into separate directories. Then we just rename the c2runtime.js file and index.html from the WebGL build to webgl.html and webgl.js. Then copy these 2 files where the regular version is. Make sure you change the source of webgl.html to reference webgl.js instead of c2runtime.js. Now there will be no loading time between switching webgl and canvas because they will both be using the same source directories for images and media - which will already be loaded into cache memory.

2. Game on the Arcade:
I have not done any testing. I do not know a work around, other than the icon trick mentioned below. Anyone have any suggestions or methods?

3. Chrome Web Store?
I have not done enough testing, I will report my results soon. In theory you should be able to use a method similar to 1. Regular website, but instead your Open URL action to your WebGL version would be something like "chrome-extension://YOURAPPID/webgl.html" if you are exporting a Packaged App.

4. Other Exports.
More testing needs to be done. Feel free to help.

I tested a WebGL game on my friends computer and It was so painful to watch!, because of the above mentioned problem. I updated their driver, but it was still painful to watch. So I just disabled WebGL in Chrome using --disable-webgl on the chrome icon, and the game ran perfect under canvas2D. But most people who just want to play a game on the internet, wont think to change any icon settings; they will just close the page if its painfully slow. WebGL will continue to get better as time goes along. Maybe one day Chrome will give a message "Your computer isn't running the WebGL content well, Click OK to switch to 2D mode." which then will disable WebGL on the tabs process.

Example:
Edited Space Blaster Demo

Edited Space Blaster Demo Source:
Edited Space Blaster Source

Note: The example is on a free web server, so i apologize if you get a server busy message.Doverseer2012-05-04 18:57:22
B
14
S
1
G
1
Posts: 16
Reputation: 1,805

Post » Fri May 04, 2012 6:16 am

It is funny you just brought this subject up Doverseer. I have a perfectly good laptop that is only 2 years old but unfortunately like 90% of the PC's out there Firefox has blacklisted my graphics card.

Over the last few months I have been experiencing many weird browser performance issues with every update from every browser vender. For example Google Chrome with WebGL enabled games started to run slower than the same game with canvas 2d. Also canvas 2d games started to get slower with each new update. Since the new Firefox 12 update this week canvas 2d games started running so slow that they are now unplayable in Firefox. I couldn't even play a game on the arcade without my browser freezing, and crashing. This is not just limited to games but also websites. It is like all of the browser venders are trying to force us to buy new PC's. If you try to contact a browser vender about this they just say update your drivers, or you got a crappy graphics card. That is if they respond to you at all. If your drivers are all up-to-date, and if you got a graphics card that is fused to your mother board you cant change it.

Anyway, this has all pissed me off. I can't afford to buy a new PC right now so I did some searching, and found a solution. This could destroy your computer so I wouldn't recommend doing this especially if your PC is still under warranty because it will then be void. But if your PC is not under warranty, and to use the internet your only other alternative is to buy a new PC then you have nothing to loose by trying this.

First start up your Firefox browser, then type about:config in Firefoxs address bar and make the following changes:

1. To enable WebGL, set webgl.force-enabled to true.

2. To enable Layers Acceleration, set layers.acceleration.force-enabled to true.

3. To enable Direct2D in Windows Vista/7, set gfx.direct2d.force-enabled to true.

Then cross your fingers, restart Firefox, and try running a WebGL application.

By doing this I have increased my Firefox browser performance by over 250% in canvas 2d, and now WebGL works with Firefox. Also all other browsers Chrome, IE9, Opera, and Safari are preforming much faster. I just hope my PC lasts long enough for me to save up for a new one.

Like I said I was left with now other choice because of the browser venders latest updates my PC became useless. But now everything runs great once again.

This is all a real shame that this is happening because the majority of people in this world wont buy new PC's. So I am starting to wonder were this is going to leave us as html5 game developers. The future looks expensive for everyone.
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Fri May 04, 2012 8:35 am

@Wink: Yeah, I mentioned on a post a while ago that I believed HTML5 it is not older computer friendly (poor people friendly). This is a great handicap when it comes to gaining audience for yer game. It really seems HTML5 is trying to make everybody buy new computers, which is ridiculous. Sure, there are oafs out there who will, but that's a minority. I am not working on my game yet (working only on assets) because I am following what's going on with HTML5 closely. Also, I did mention the disadvantage and the bull crap involved on depending now on browsers devs. to do their job right, as if we didn't depend on enough pricks already. As of now, all of this mess with HTML5 seems like the usual: Corporate stupidity. Really hope they get their stuff together because if this is done right, there is a lot of potential. But as things stand right now, native is still winning, by far.
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Fri May 04, 2012 8:55 am

"As of now, all of this mess with HTML5 seems like the usual: Corporate stupidity."
I really think that Adobe will do everything to slowdown HTML5 development to try preventing Flash to become useless.
Do you know any proofs about that?
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Fri May 04, 2012 9:17 am

I have no idea if Adobe is doing anything to slow down HTML5 dev., but good point. I would not put it past them in the least.
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Fri May 04, 2012 9:43 am

HTML5 is still young
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Fri May 04, 2012 9:50 am

@VampyricalCurse you got it so right. Sorry I missed your post about this. I try to read everything here just because you never no when you might miss a shy smart members moment of pure life changing brilliance hidden someplace in a thread. lol

This is all so typical you got the financially elite, trying to make one more money grab. It's like back in the day Microsoft got it right the first time before Corporate money got involved, and decided to bug the system so that we would not only have to depend on them for constant security updates but also the need for antivirus software.

I really thought html5 was going to be the little persons chance (poor persons chance) lol :D to start up a small operation. It is impossible to make a native cross platform game by yourself with little money.
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Fri May 04, 2012 10:54 am

I have updated the Post with examples of a good way - Just Providing WebGL as an Option.

If HTML5 were to get the performance of a Native App, allot of work would have to go into the Security Design of the browser. But I can see it happening soon or at least getting better.
B
14
S
1
G
1
Posts: 16
Reputation: 1,805

Post » Fri May 04, 2012 11:31 am

Is this all just Firefox? Is anyone have problems with Chrome, Safari, or Opera? I run a lot of "old" netbooks and I haven't noticed any problems. Firefox is definitely going their own way, but if they are not cooperating with drivers, people will stop using them.

Actually, I seem to remember that they are declining and Chrome is increasing and no one has noticed that IE has left the building.
Check out my HTML5 Firefox OS Game Programming and Game Playing blog at http://firefoxosgaming.blogspot.com/ and my book on Amazon at http://www.amazon.com/dp/B00IZUYIGO. I wrote a newer post on using Construct for Firefox OS at http://firefoxosgaming.blogspot.com/201 ... -game.html.
B
16
S
4
G
4
Posts: 181
Reputation: 3,837

Post » Fri May 04, 2012 12:47 pm

@Wink: Integrated graphic chip on a laptop is not meant to allow to play games.
The purpose of such "graphic card" is originaly to display office style softwares on working stations.

To make an analogy with mechanical sports, it would be like trying to attend to a Formula1 race in a 4L and wondering why it can't compete.


@VampyricalCurse: what's all the fuss with the corporation insanity there ? Are you blaming microsoft for not having the funds to buy a decent/recent computer ? Why are they responsible for the situation ?
Same remark as for Wink, if you don't have even a decent gear, you can't expect to execute latest game/technology.
You're right on one point though, HTML5 might not be suited to all. But there are enough technologies out there for you to chose from.
If you don't like depending on browser, just go and make native applications.

@Bob Thulfram: Latest FF12 version appears to have the best performances on latest Scirra's benchmark, so you have it wrong, FF is not decreasing, and on the other hand, more and more annoying/critical bugs related to HTML5 gaming gets reported on chrome.

Go back and read Ashley's article about graphic drivers and figure that considering the approximative quality in the graphic drivers provided by graphic cards vendor, FF is actualy protecting the end user with the blacklist.
Go bug the drivers vendors so that they provide correct drivers instead of going the lazy way.

I'd like to see what's @Ashley's take on the original webGL/canvas2D issue though.Kyatric2012-05-04 12:49:29
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Next

Return to Construct 2 General

Who is online

Users browsing this forum: hollowthreat, Solomon and 7 guests