chiubaka Posted October 10, 2014 Share Posted October 10, 2014 Hi! I'm working on an HTML5 massively multiplayer online game. I've been playing with this project for awhile now and am having some difficult performance issues with the game at the moment. Since this is a multiplayer game, information is sent to and received from the network. New game entities that show up on a player's screen must be streamed from the server to the client. Sometimes new entities represent quite a bit of data and processing this data takes a sizable amount of time on the client. What is the best way to ensure that receiving new game state from the network doesn't cause rendering to skip frames? Right now if I receive a large enough chunk of data or enough packets of data in a short span, frame rate will suffer as the client spends its time unpacking and processing this data instead of running the rendering. Any advice on this would be greatly appreciated! Best,Daniel Quote Link to comment Share on other sites More sharing options...
IamThatGuy Posted October 11, 2014 Share Posted October 11, 2014 Are you using node.JS? What does your packet data look like? I am not asking because I know the answer, but so when I start converting my games to multiplayer, I could maybe avoid the problem. Quote Link to comment Share on other sites More sharing options...
mfdesigner Posted October 12, 2014 Share Posted October 12, 2014 Have you tried using websockets inside webworkers? Webworkers are your best friends since everybody nowadays uses multi-core processor. Quote Link to comment Share on other sites More sharing options...
Sebi Posted October 14, 2014 Share Posted October 14, 2014 Sounds like an bad entity architecture. What kind of data are you sending to your players?Keep in mind to store as much data on the client side as possible. For example:How are to monsters walking in your game?Instead of sending each position update to the player, only send the destination of the monster to the player, then calculate the monsters path on the users side.You should keep the client side code really close or identical to the server side code, so that the client can do the work and need less updates. Same with players:Instead of sending each players data to each other player on the map, only send the data of players in the users viewport.Divide your game world into chunks and send the data to people in that area. That's really everything you need. Maybe you have a demo online or a game that is similiar to your game, then we could give you some better advices. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.