Is my javascript network game client planning correct?

Hi,

So, I'm going to use Javascript for my game client. I can do the server in Java, thanks to local legends. I need a listener waiting for user directives on the game window and sending an activity packet for each frame.
It's going to be a platform style multiplayer.
I'm going to treat it like an RTS, UDP over TCP, for fast delivery of info in UDP packets over reliable TCP sends.
Does Javascript block for GameWindow activity? How is it queried?

What should I know? I got it done in Java be4 w Threads
Thanks
LVL 1
beavoidSelf EmployedAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
This is a very broad question and I am not quite sure what it is you are asking - are you aware of JavaScript Service Workers

https://developers.google.com/web/fundamentals/primers/service-workers/
from the above
A service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction.
https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
from the above
Service workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. They will also allow access to push notifications and background sync APIs.
beavoidSelf EmployedAuthor Commented:
Thanks.

I'm aware of a few situations where not all browsers support functionality for security reasons.
Is this one of them?
Julian HansenCommented:
Always a good resource is https://caniuse.com/ and the MDN resources - they give good indications of cross browser compaitibiliaty.
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

beavoidSelf EmployedAuthor Commented:
Thanks

Since Javascript can't do Threads, do you think a multiplayer game could work, where the server is done in Java, like many RTS's I've made,
and the clients in Javascript. -  And, because Javascript is single Threaded. - I'd have to use the packets being received on the clients as the game clock. Do you think TCP would be pointlessly slow?  - is there a UDP type workaround, for fast duplicate packets to be sent faster, a microsecond behind?

I'd prefer the servers to be off-site on my machines, to eliminate cheating, - altering the game-state, and a UDP type quick packet failsafe is desirable.

Ideas?
Julian HansenCommented:
If you want to offload processing then you can also look at Web Workers .
WW run in a different thread - don't have access to the DOM but can be used to do processor intensive calcs
Services workers act as an intermediary between your app and the external network or cache.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
beavoidSelf EmployedAuthor Commented:
Thanks,
We Workers look promising.
Julian HansenCommented:
You are welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.