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

  • SEARCH
  • Home
  • 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 601979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:46:24+00:00 2026-05-13T16:46:24+00:00

Right now I’m trying to make a mmorpg for the iPhone. I have it

  • 0

Right now I’m trying to make a mmorpg for the iPhone. I have it set up so that the iPhone requests for the player positions several times a second. How it does this is that the client sends a request using asynchronous NSURLConnection to a php page that loads the positions from a mysql database and returns it in json. However, it takes about .5 seconds from when the positions are requested to when they actually get loaded. This seems really high, are there any obvious things that could cause this?

Also, this causes the player movement on the client to be really choppy too. Are there any algorithms or ways to reduce the choppiness of the player movement?

  • 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-05-13T16:46:24+00:00Added an answer on May 13, 2026 at 4:46 pm

    Start measuring how long the database query takes when you run it outside your iPhone.

    Then measure how long it takes when you send the same http request from something other than your iPhone(It’s e.g. a 10-15 line c# program to figure this out).

    If none of the above show any sort of significant latency, the improvements need to be done on the iPhone side. Some things to look out for:

    • GPRS/3G has rather high latency

    • GPRS/3G has rather high bit error rates – meaning there’s going to be quite a few dropped packets now and then which will cause tcp to retransmit and you’ll experience even higher latency

    • HTTP has a lot of overhead.

    • JSON adds a lot of overhead.

      Maybe you’ll need to come up with a compact binary format for your messages, and drop HTTP in favor of a custom protocol – maybe even revert to UDP

    The above points generally don’t apply, but they do if you need to provide a smooth experience over high latency,low bandwidt, flaky connections.

    • At the very least, make sure you’re not setting up a new TCP connection for every request. You need to use http keep-alive.

    I don’t have any specific info on player movement algorithms, but what is often used is some sort of movement prediction.

    You know the direction the player is moving, you can derive the speed if it’s not always constant – this means you can interpolate over time and guess his new position, adjust the on screen position while you’re querying for the actual position, and adjust back to the actual position when you get the query response.
    The trick is to always interpolate over time within certain boundaries. If your prediction was a bit off compared to what the query returned, don’t immediatly snap the positon back to the real position. Do interpolation between the current position and the desired postion over a handful of frames.

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

Sidebar

Related Questions

Right now I have this SQL query which is valid but always times out:
Right now I have an application that loads a bunch of thumbnail images into
Right now, I have developed an android app that is available free on the
Right now, I have a jQuery UI pop-up dialog that reads from an external
Right now we have a dll file that contains all the database calls and
Right now I have a script that creates symlinks to anything newer than 2
Right now I have an SSIS package that runs every morning and gives me
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName
Right now, I have an array of Point objects and I want to make
Right now I have views with layout_weight inside another view that also has the

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.