Author Topic: Web platform, possible?  (Read 8385 times)

gumix

  • Administrator
  • Jr. Member

  • Offline
  • *****

  • 62
    • View Profile
    • Ascii Patrol
Web platform, possible?
« on: April 14, 2016, 09:16:13 am »
I have done several experiments trying to port the game to browsers. Reasults are promising but still there are many quircks, especially on mobile platforms.

Rendering experiments, both should run well on major desktop browsers.
Test 1: canvas (2d) http://ascii-patrol.com/canvas.html
Test 2: canvas (web-gl) http://ascii-patrol.com/webgl.html

On mobile devices unfortunately:
Test1: makes too many graphics calls so framerates are rather low: 5-15fps
Test2: web-gl gives promising performance of 60fps, if only web-gl is avaliable on more devices :)

Porting game code to java script is another story. I gave a try to Emscripten.
Test3: http://ascii-patrol.com/test.html
It is using web-gl for rendering, desktop browsers should feel comfortable with it.
Unfortunately strange effects appear on my BB Q10 mobile.


gumix

  • Administrator
  • Jr. Member

  • Offline
  • *****

  • 62
    • View Profile
    • Ascii Patrol
Re: Web platform, possible?
« Reply #1 on: April 14, 2016, 12:57:09 pm »
Ok, figured out what caused problems to my BB - but still don't understand why.
So setting LLVM optimization to -O0 done the trick but why does it affect my mobile device only? All desktop browsers are fine with -O3.

Another tiny problem was with webgl shaders, they need a bit more precise control on arithmetic errors.

Summarizing everything, seams Ascii Patrol will have a web port, with requirement for desktop browser to have either canvas 2d or web-gl support while mobile browsers if one lacks of web-gl it may fall into really low frame rates because of unaccelerated 2d canvas.