rameshvarun / netplayjs

Make P2P multiplayer browser games, no server hosting or synchronization code required. Powered by rollback netcode + WebRTC.
https://rameshvarun.github.io/netplayjs/
ISC License
496 stars 34 forks source link

Demos are abysmally slow even on local #54

Closed TheBricktop closed 1 year ago

TheBricktop commented 2 years ago

When testing the demos im getting like 1-2 fps on most of the demos even whem im running it on localhost, also the resolution is low and blurred, why is that? Tested on both firefox and edge.

johndoe-88 commented 2 years ago

try different windows

TheBricktop commented 2 years ago

Tried, still slow below expectations

AngelShadow2017 commented 2 years ago

it is not slow here.

rameshvarun commented 1 year ago

I haven't seen this issue specifically. I am aware of #76 (backgrounded tabs won't tick anymore). I suspect this is a variation of that problem where a visible but unfocused tab has timer events throttled. If that is indeed the problem, fixing #76 will also fix this.

The blurriness is due to the fact that the games use a fixed canvas size, scaled up to fit the screen. This makes life easier because mouse inputs and rendering happen in the exact same coordinate space for all players.

It's not an inherent limitation - I should add an option for enabling variable canvas size.

rameshvarun commented 1 year ago

There's now an indicator which tells you if the other player has hidden their window. It doesn't fundamentally solve the problem but at least provides some feedback to players, so I'll consider this resolved for now.