agar.io-clone icon indicating copy to clipboard operation
agar.io-clone copied to clipboard

Change to 60FPS?

Open NuclearC opened this issue 9 years ago • 12 comments

Why not change networkUpdateFactor in config.json from 40 to 60 to change fps to 60?

NuclearC avatar Mar 11 '16 16:03 NuclearC

That's a good question. But still if I change it there is some jittering in the image, like it draws at the same position twice

dragos99 avatar Mar 20 '16 21:03 dragos99

Network update speed isn't the only issue, other factors like rendering also take up time.

abalabahaha avatar Mar 21 '16 03:03 abalabahaha

Maybe add some interval between updates and apply interpolation on the client side? If you have that in mind i could help.

dragos99 avatar Mar 25 '16 19:03 dragos99

How I understood, you have no interpolation on client side? Only change position by server data?

dehimer avatar Aug 07 '16 12:08 dehimer

Yes, at the moment the position is only changing by server data. But setting up movement prediction on client side shouldn't be a big problem.

spridev avatar Aug 07 '16 12:08 spridev

Ok. Thank You for fasten answer. I discovering sources becouse I making similar game and noticed, that in original agar.io animation is more smoothed.

dehimer avatar Aug 07 '16 13:08 dehimer

You're welcome. I'm also working on a similar game, but I would suggest you not to start from this project because there are a lot of things that aren't "production ready" in it. ;)

spridev avatar Aug 07 '16 13:08 spridev

No, I found this repo only after I started) My game with star ships))

dehimer avatar Aug 07 '16 13:08 dehimer

Can you please be more specific about what isn't production ready?

2016-08-07 16:06 GMT+03:00 Novikov Denis Yurevich [email protected] :

No, I found this repo only after I started) My game with star ships))

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/huytd/agar.io-clone/issues/397#issuecomment-238081430, or mute the thread https://github.com/notifications/unsubscribe-auth/ARCJwPtumTPCsb-pQm0MvJErA-woGMqCks5qddhOgaJpZM4Hu1Gu .

dragos99 avatar Aug 07 '16 13:08 dragos99

Socket.io isn't really appropriate for this kind of game. Websockets packets are too big. Too much nested for loops. Movement prediction is missing. The quadtree is recreated for each player when it could only be recreated once per update. But the project was still really helpful to me when I was only a beginner. It was a really good startpoint. :)

spridev avatar Aug 07 '16 13:08 spridev

Hmm, native websockets should be better right? As for the packets, what's the maximum size they should have?

dragos99 avatar Aug 07 '16 13:08 dragos99

I'm using einaros ws. This websockets library is one of the fastest that I know. I don't think there is a maximum packet size. The smaller the better.

spridev avatar Aug 07 '16 13:08 spridev