Jump to content

How do I avoid rendering frame drops when receiving network data in a multiplayer game?


chiubaka
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...