Author Topic: JS port (emscripten)  (Read 17706 times)

Offline caiiiycuk

  • Squaddie
  • *
  • Posts: 5
    • View Profile
JS port (emscripten)
« on: December 13, 2013, 10:00:22 am »
Hi! I successfully ported OpenXcom to js with emscripten. You can play here https://epicport.com/en/xcom.

Offline kkmic

  • Commander
  • *****
  • Posts: 582
  • Undefined
    • View Profile
Re: JS port (emscripten)
« Reply #1 on: December 13, 2013, 10:18:15 am »
Interesting...

Offline hsbckb

  • Colonel
  • ****
  • Posts: 275
  • Gill Man
    • View Profile
Re: JS port (emscripten)
« Reply #2 on: December 13, 2013, 10:25:35 am »
I have just try. What an excellent port!

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: JS port (emscripten)
« Reply #3 on: December 14, 2013, 07:31:41 pm »

Offline HappyCat

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: JS port (emscripten)
« Reply #4 on: December 25, 2013, 10:43:57 am »
Is it possible to just grab a copy of page with scripts and actually play offline?

Offline caiiiycuk

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: JS port (emscripten)
« Reply #5 on: January 11, 2014, 05:42:47 pm »
I dont think so. At least you should start local server for do this because browser cant download resources directly from drive. Or optionally you can embed resources in js, but in this case js file will be to big for browser.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: JS port (emscripten)
« Reply #6 on: January 11, 2014, 10:34:53 pm »
If you wanna play offline, why not just play... the desktop version? :P

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
Re: JS port (emscripten)
« Reply #7 on: January 12, 2014, 09:51:47 am »
If you wanna play offline, why not just play... the desktop version? :P
The biggest advantage of a browser port is that it's a universal port, the game will work on any OS with an up to date enough browser. It's not quite as universal if it only works while you're connected to the internet.

There should be a relatively simple way to expose a folder to the browser doing something like href="file:https://D:/games/xcomdata". <<-- that doesn't work btw.

Offline caiiiycuk

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: JS port (emscripten)
« Reply #8 on: January 12, 2014, 01:04:03 pm »
...
There should be a relatively simple way to expose a folder to the browser doing something like href="file:https://D:/games/xcomdata". <<-- that doesn't work btw.

This does not work because https://en.wikipedia.org/wiki/Cross-origin_resource_sharing. CORS restricts to make XMLHttpRequests by file protocol. But you can disable CORS it is pretty easy, there are another problem JS is significant slower than native port and on mobile devices it will work terrible i think.

Offline elethio

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: JS port (emscripten)
« Reply #9 on: January 13, 2014, 05:36:42 pm »
I have the steam version of xcom, but linking its folder doesn't work with browser openxcom.

can any tell me, Is this an issue with the steam version? or am I missing something?

Quote
C:\UFOpedia\Steam\SteamApps\common\xcom ufo defense
Thanks

« Last Edit: January 13, 2014, 05:39:22 pm by elethio »

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: JS port (emscripten)
« Reply #10 on: January 13, 2014, 06:36:27 pm »
might be a problem with the folder name containing spaces, I'd guess... have you tried copying the game data to a simpler directory (c:\xcom or something) and using that path?

Offline caiiiycuk

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: JS port (emscripten)
« Reply #11 on: January 14, 2014, 03:35:06 am »
I have the steam version of xcom, but linking its folder doesn't work with browser openxcom.

can any tell me, Is this an issue with the steam version? or am I missing something?
Thanks

Sorry, i will fix it today.

Offline caiiiycuk

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: JS port (emscripten)
« Reply #12 on: January 14, 2014, 03:31:41 pm »
I have the steam version of xcom, but linking its folder doesn't work with browser openxcom.

can any tell me, Is this an issue with the steam version? or am I missing something?
Thanks

Fixed, please try again

Offline elethio

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: JS port (emscripten)
« Reply #13 on: January 17, 2014, 11:56:31 am »
Yes its working !

Thank you, this is going to be my favourite browser game :D

Offline elethio

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: JS port (emscripten)
« Reply #14 on: January 24, 2014, 01:12:04 pm »
Having an issue with the advanced settings...

First of all, these are brilliant!
I love what these things do, from range based accuracy to customized starting bases, and I have most of these options turned on, however the game seems to loose my settings when I start it from a different browser from a different machine.

It might be alot to ask, but if threes any way to save the options settings along the login, or within the xcom folder, that would be really helpful.

Thanks again for making this work with a browser, really gets me past quiet periods at work :D