Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forked WebQuake supports Async IO #25

Open
efess opened this issue Nov 28, 2015 · 8 comments
Open

Forked WebQuake supports Async IO #25

efess opened this issue Nov 28, 2015 · 8 comments

Comments

@efess
Copy link

efess commented Nov 28, 2015

Figured I'd write a note to let you know that I created a fork off this project that uses promises and recursion to support JS's async functions. The main reason for this is support indexed db, which requires async support to retrieve files. Also, synchronous IO functionality will be deprecated at some point anyway.

I was planning on extending your source further, adding some modern features (from proquake or qrack) and hosting a web based gaming environment. This requires users to specify their own local pak1 file (for licensing reasons).

Just wanted to get your thoughts on this project, and if you had any ideas for performance improvements

@kzahel
Copy link

kzahel commented May 4, 2016

Hi efess. I forked your fork, and used/re-enabeled audio context API because audioelement.clone() was causing crashes on chromebooks. https://bitbucket.org/kzahel/webquake

Great work with your fork, love your work with promises. I was able to extend it as necessary. I wasn't a fan of promises until now

Also added gamepad support
And fullscreen setting in options

Basically I am trying to get it working well in a chrome app: https://github.com/kzahel/WebQuake-Chrome

@efess
Copy link
Author

efess commented May 5, 2016

Cool, although I wonder how much the excessive use of promises affects the performance.. I was going to try testing with bluebird promises, but never got around to it. Some of my promise implementations were pretty hacky as well.

@kzahel
Copy link

kzahel commented May 5, 2016

99% of those promises are initialization code, and arent used at all in the game loop. so not at all, really.

No idea what bluebird promises are :-) is that an ES6 thing?

@kzahel
Copy link

kzahel commented May 5, 2016

I'm just right now trying to Promisify the Server initialization code. Using your work as a reference :-)

@efess
Copy link
Author

efess commented May 5, 2016

Oh yea the game loop definitely uses promises, the program code creates a promise even when one isn't necessary.

I was working in my local copy to optimize and cut down the creation of promises when not needed, but there's some loose ends I haven't been able to figure out (or had time)

Bluebird (http://bluebirdjs.com/) is a faster promise implementation, but it comes at the price of needing to import a library.

@kzahel
Copy link

kzahel commented May 5, 2016

Cool. Well please let me know if you make any nice changes!

@kzahel
Copy link

kzahel commented May 5, 2016

I had another approach that I tried which was to use "await"
I ended up having still some problems with the loading and would get funny exceptions when a new map loaded. But it mostly worked, and didn't require a lot of rewrite
kzahel@8bb479f

@SpiritQuaddicted
Copy link

Awesome stuff!

This issue can be closed, #33 is there and a PR is in order I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants