Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: client server communication

  1. #1
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default client server communication

    What form of client server communication is best for a game. Each client messages the server and asks for the updates, or the server automatically sends the updates to all users every frame.


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: client server communication

    Depends on the game. What kind of game did you have in mind?

  3. #3
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: client server communication

    I've been working on a 2d rpg.

  4. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: client server communication

    Is it an MMO? Do the players act in "real time", or is it turn based? How many players will/can there be? Can the players interact with each other? Will it be played across the internet, and/or via lan? Will your game make use of a "dedicated server" (i.e. one comp hosts the game but doesn't play)?

    The more details you have flushed out the easier it will be to pin what kind of network options to use. In general, you might end up using both.

    The server will send the "current state" of the game to each client/player, and in turn they will send what action the player has imputed back to the server. Alternatively, the server can keep track of what changes has happened and the clients can request for a "diff" from a certain time and then each client can update their state accordingly (this usually is better of you expect the current state to be really big, or if you have a slow network connection, but you'll have to pay attention to any synchronization issues that may pop up if real-time interaction is required).
    Last edited by helloworld922; September 2nd, 2010 at 04:46 PM.

  5. #5
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: client server communication

    I want it to be an MMO with real time combat. i'm not sure about the limit yet. Yes they can interact. Internet connection. Yes there will be a dedicated server.

Similar Threads

  1. [Java] Client - server, example
    By Grabar in forum Java Networking
    Replies: 6
    Last Post: January 22nd, 2011, 01:56 PM
  2. Client/Server
    By Dillz in forum Paid Java Projects
    Replies: 2
    Last Post: June 2nd, 2010, 06:19 AM
  3. Client-Server program
    By Reztem in forum What's Wrong With My Code?
    Replies: 0
    Last Post: May 12th, 2010, 06:36 PM
  4. TCP Client Server: Object Oriented
    By nffc luke in forum Object Oriented Programming
    Replies: 2
    Last Post: April 28th, 2010, 07:39 PM
  5. [SOLVED] The concept of Server and Client
    By rendy.dev in forum Java Theory & Questions
    Replies: 3
    Last Post: January 18th, 2010, 04:13 AM