Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8627187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:12:51+00:00 2026-06-12T08:12:51+00:00

im making a simple html5 game for learning purposes. I want to send as

  • 0

im making a simple html5 game for learning purposes. I want to send as minimal data over the wire as possible to keep in sync. When i send the game state between client and server i only want to send what has changed in the game state since last update to save on bandwidth / latency.

The only way i can figure out to do this is by creating a “snapshot” or copy of the game state object on each update recieved from the remote source, then after the game state is manipulated locally and needs to be sent out to the remote source loop through the game state object comparing each value to the tempory game state and only send the differences…

is this the most efficient way to do this?

/****************************/
/**** Current game state ****/
gameState = {

    playerOneID: 'XXX-XXX-XXX-XXX',
    playerTwoID: 'YYY-YYY-YYY-YYY',
    elapsedTime: 00007,
    myVariable: 'abcd1234'    
}    

/*******************************************/
/**** saves game state from last update recieved ****/
tmpGameState = {

    playerOneID: 'XXX-XXX-XXX-XXX',
    playerTwoID: 'YYY-YYY-YYY-YYY',
    elapsedTime: 00003,
    myVariable: 'abc123'    
}    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:12:52+00:00Added an answer on June 12, 2026 at 8:12 am

    Most networks at least sends data into at most 1024 byte packet and at least when it is schedule to leave.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a simple game in HTML5 canvas, it involves driving a little
I'm making a simple prototype in HTML5 canvas, and want to basically draw a
I'm making a simple app using the HTML5 <canvas> tag and compile the code
I am making a simple static app in HTML5. What I am doing now
I am making simple grid like game ( grid is matrix 128x128) and matrix
I'm making a simple http page-requester in C. It uses sockets to send HTTP/1.0
I'm writing a simple game with javascript/html5, and I'm trying to implement gravity. The
Newbie question: I am making a simple html game. It consists of these DIV
I'm making a simple jQuery game with the score being the elapsed time from
I'm making a simple reading canvas app, and I want to be ale to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.