Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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  
  Converting Slime Volleyball to online play?  (Read 3981 times)
0 Members and 1 Guest are viewing this topic.
Offline swahiliboy

Innocent Bystander




Java games rock!


« Posted 2002-12-21 21:50:49 »

Hi, I am new to java programming, but I was wondering if there would be some (potentially easy) way to convert a game which is multiplayer on the same computer into a game which could be played between two computers? The game I have in mind is slime volleyball, which can be seen here:

http://www.fetchfido.co.uk/games/slime/slime_volley_ball_game2.htm

How would I go about turning this into a network game? Thank you for any help or advice you can give me.
Offline the2bears

Senior Member


Projects: 2


Little Bear: Code Fu!


« Reply #1 - Posted 2002-12-22 02:13:59 »

This is similar to the following question:

How long is a piece of string?

Hard to answer, isn't it? Wink

There's probably no really easy way, but this is what you might do:  During the update of each frame in the game you now need to have data arrive over the network regarding the other player, and you have to send your data to him.  Input no longer comes from the keyboard for example, it comes in on a socket.  It might take a little work figuring out the most efficient way to send the data.

Regards,

Bill

the2bears - the indie shmup blog
Offline nabetse

Senior Newbie




I love YaBB 1G - SP1!


« Reply #2 - Posted 2002-12-26 09:51:45 »

Hi

   I've had a similar problem with a game i made. My solution was to send the new position and the angle trajectory every time that a player interact with the ball. By this way, you only will send the information needed when the ball is changed by your players.
   Also I recommend to use UDP(DatagramSocket,DatagramPacket) protocol for this game because you will need speed comunication protocol.

  This game is very funny, but, Is there some option to play against the machine?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Kevdog

Junior Member





« Reply #3 - Posted 2002-12-27 19:47:34 »

There's a link to the 1player version at the top of the screen on the link given above Smiley

There are only 10 types of people, those who understand binary and those who don't!
Offline Pyros

Senior Newbie




Let's make Java games rock !


« Reply #4 - Posted 2002-12-27 20:15:10 »

Quote
Hi, I am new to java programming, but I was wondering if there would be some (potentially easy) way to convert a game which is multiplayer on the same computer into a game which could be played between two computers? The game I have in mind is slime volleyball, which can be seen here:

http://www.fetchfido.co.uk/games/slime/slime_volley_ball_game2.htm

How would I go about turning this into a network game? Thank you for any help or advice you can give me.


I don't know how the game handles it's player input, but here's how I'd go about it. I'd remove the player i/o into a separate component. Then I'd hide it behind an abstraction layer. Sort of a "black box" operating through an interface. Then after it works fine, I'd modify the component hiding behind the interface.  Only one player's input is read from local device. The other player's input is received from a network socket. Then the local player's input is sent to the socket. As long as you can stay "black boxed" behind the interface, you don't have to touch the game code. Hopefully!  Roll Eyes

Of course it's not as simple as that but you'll figure it out when you're doing it. First step is to completely remove the keyb/mouse/pad reading from the actual game and hide it behind an interface.
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

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

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

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

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

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

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

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

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

BurntPizza (49 views)
2014-08-09 21:09:32
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!