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.
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.
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.
Depends on the game. What kind of game did you have in mind?
I've been working on a 2d rpg.
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 03:46 PM.
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.