OpenXcom Forum

Contributions => Builds & Ports => Topic started by: caiiiycuk on December 13, 2013, 10:00:22 am

Title: JS port (emscripten)
Post by: caiiiycuk 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.
Title: Re: JS port (emscripten)
Post by: kkmic on December 13, 2013, 10:18:15 am
Interesting...
Title: Re: JS port (emscripten)
Post by: hsbckb on December 13, 2013, 10:25:35 am
I have just try. What an excellent port!
Title: Re: JS port (emscripten)
Post by: SupSuper on December 14, 2013, 07:31:41 pm
(https://i.imgur.com/rrPHxtC.gif)
Title: Re: JS port (emscripten)
Post by: HappyCat on December 25, 2013, 10:43:57 am
Is it possible to just grab a copy of page with scripts and actually play offline?
Title: Re: JS port (emscripten)
Post by: caiiiycuk 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.
Title: Re: JS port (emscripten)
Post by: SupSuper on January 11, 2014, 10:34:53 pm
If you wanna play offline, why not just play... the desktop version? :P
Title: Re: JS port (emscripten)
Post by: darkestaxe 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.
Title: Re: JS port (emscripten)
Post by: caiiiycuk 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 (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.
Title: Re: JS port (emscripten)
Post by: elethio 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

Title: Re: JS port (emscripten)
Post by: moriarty 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?
Title: Re: JS port (emscripten)
Post by: caiiiycuk 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.
Title: Re: JS port (emscripten)
Post by: caiiiycuk 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
Title: Re: JS port (emscripten)
Post by: elethio on January 17, 2014, 11:56:31 am
Yes its working !

Thank you, this is going to be my favourite browser game :D
Title: Re: JS port (emscripten)
Post by: elethio 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