Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Multiplayer Pictionary  (Read 1582 times)
0 Members and 1 Guest are viewing this topic.
Offline Dirk

Junior Newbie

Java games rock!

« Posted 2004-12-14 08:06:42 »


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 ?

Offline Serethos

Junior Devvie

Java games rock!

« Reply #1 - Posted 2004-12-14 09:01:31 »

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 ?

Offline Dirk

Junior Newbie

Java games rock!

« Reply #2 - Posted 2004-12-14 09:13:19 »


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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Serethos

Junior Devvie

Java games rock!

« Reply #3 - Posted 2004-12-14 11:08:05 »

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
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

numerical (124 views)
2017-02-21 07:32:16

numerical (123 views)
2017-02-21 07:31:46

theagentd (230 views)
2017-02-18 13:42:33

theagentd (231 views)
2017-02-18 13:35:16

h.pernpeintner (1394 views)
2017-01-24 22:39:11

h.pernpeintner (1382 views)
2017-01-24 22:38:32

Galdo (1944 views)
2017-01-12 13:44:09

Archive (2013 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2550 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2318 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!