Multiplayer Pictionary

hi,

i need to create a java game which demonstrates client server communication for my school coursework. Ok ill set it straight first, im not looking for someone to do it for me !

but from a design perspective, what is required and what am i looking to do for this task ?

i understand i need to create a canvas for each player to draw on, but how would i send the data to each client to keep each screen updated in real time with the picture ?

thanks

most basic way would be to create a tcp/ip connection via sockets between both player-applications. one of them takes
the role of a host.
so host opens a port and listens for incoming coupling from a client (2nd player).
while gaming it is important to decide which information is really needed so that both players see each other (coordinates, actions, events, whatever). if player1 moves it sends either its new coordinates or the movement command to player2 which actualizes its own view of the opponent.

but beware, there are many(!) pitfalls and tricks parts in this easy sounding concept.
imaging what happens, if

  • games run on different speeds ?
  • lag/ disconnection occurs ?
    (…)

thanks

i was thinking since pictionary is turn based and only one person draws at any one turn. The coordinates of the drawing would be stored on the server, so if any disconnections occur, the server can just send the data to each client again.

then that brings me to another qeustion. How would i actually send the coordinate info ? would it be stored in a text file ? If it is, any suggestions on how to format it ? would the coordinates be pixel positions ? I was going to post this in the networking forum, but it sounds like a complete newbie question, as you can tell my programming skills arent too great.

ahh sorry, i really overstepped that it is no general question (you said you have to do ‘a’ java game) but its pictionary.
my fault. but i really have no clue, what this game is about.
i googled for it and now i know its a board game but somehow with drawing things.

turn based games are much(!) easier to realize over network.
but now your question is in which format to submit the drawings. that really depends upon whether it is needed that
the opponent sees every drawn pixel realtime oor if it is enough to send the final picture (did i mention, that i dunno the game? =)

there are many ways, at the moment i dont know which one would be most suitable.
what you are sending doesnt matter, e.g. you do your drawings on a bufferedimage and send the pixel-matrix which you can access over getter methods.
but that can be a rather huge amount of data (for network
issues)