wxyz-abcd/node-haxball

Room.modifyFrameNo

Closed this issue · 5 comments

Room.modifyFrameNo causes "Bad Actor" most of the time. Almost seems hopeless.

It is worthy to note that some(or maybe most) of "Bad Actor" was caused by the wrong replacement of "requestAnimationFrame" in node.js. It was an interval with 0ms latency, and later changed to 16.6666666666ms in order to achieve 60fps. This might have fixed the issue. Have to check sometime.

Since the modifyFrameNo works only if you are client and unless room is created with noPlayer and the player of host is joined with ID: 1 as player the effects of modify framing won't happen on the player. There is some functions that share and communicate the frame no of clients between host and client and when it's overwritten it causes clients froze on their screen. We can work there to maybe create some modifier such as modifyPlayerFrameNo(frameNo, playerId). I will add some comments to the function for peoples interest if someone wants to work on it.

Thanks, I will look into it in detail as soon as I publish the website project.

Some people are saying that modifyFrameNo is working correctly now. I'm still not very sure, have to test some time.

I think it's working. At least it's not causing bad actor now, so there's no more bug.