Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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 995 times)
0 Members and 1 Guest are viewing this topic.
Offline Dirk

Junior Newbie




Java games rock!


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

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
Offline Serethos

Junior Member




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 »

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.

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

Junior Member




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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (16 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (31 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (44 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!