Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
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  
  Few Questions  (Read 1016 times)
0 Members and 1 Guest are viewing this topic.
Offline fubz

Junior Newbie





« Posted 2005-12-29 18:02:36 »

Ok, i've done a lot of reading, here and on google, about networking.  I've even went and coded most of it in TCP, but there are a few problems and i have to rewrite it from scrratch so i need to start over the right way. 

Ok, my game is a platformer, and as i was reading UDP was reccomened for this type of game.  My only question is.... what data do i send/don't send?

Should i send keypresses to the server and let the server handle it?  Then i read you want to send last position and velocity etc, incase of packet loss and out of order packets.  I'm not really sure how to keep the players synced on everyones screen, and then what if keypresses dont make it? Then what?  The biggest problem would be shooting.... how do you make sure that when a player shoot, and it hits, that everyone registers.  Or do you just kinda let it fly by showing all the shots on the client, and if the server doesnt get the info, oh well.

Also, how big do you think the packets should ever get?  It seems like alot of data to send from server to clients.  Especially if there was only like 8 players, you need positions, velocitys, player state, etc.
Offline Jeff

JGO Coder




Got any cats?


« Reply #1 - Posted 2005-12-29 23:30:03 »

Ok, i've done a lot of reading, here and on google, about networking.  I've even went and coded most of it in TCP, but there are a few problems and i have to rewrite it from scrratch so i need to start over the right way. 

Ok, my game is a platformer, and as i was reading UDP was reccomened for this type of game.  My only question is.... what data do i send/don't send?

Thats an over simplification.  Is this an Internet or LAN game?  Over LAN TCP is fine.  Over Internet TCP *may* be fine too depending on your game.  if this is a traditional twitch platformer then no matter which way you go you have major latency issues to overcome over the net,.

Quote
Should i send keypresses to the server and let the server handle it? 

You *might* just get away with this on a LAN, maybe.  Yould never get away with it on the net.  In general for latency reasons you want to handle player response locally.  If you need to do cheat-checking then Id run a parallel game on the server that "double checks" the results.  (or let other players double check ech other is is more typical for a lock-step type game.

I believe Kev Glass just completed an internet lockstep based RPG that would have similar characteristics.  He might be willing to share his techniques (or even some code) with you.

Quote
Then i read you want to send last position and velocity etc, incase of packet loss and out of order packets. 

This is only for open loop asynchronous games.  It sounds to me like youve got a lock-step design.

Quote
I'm not really sure how to keep the players synced on everyones screen,

You don't.  Open loop games show only an approximation of the other players' actions.

Quote
and then what if keypresses dont make it? Then what?  The biggest problem would be shooting....

Every game has *some* critical data. You either need to send this by TCP or effectively re-invent TCP on top of your UDP with redundancy and re-trasmit frames.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Online kevglass

JGO Kernel


Medals: 172
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2005-12-31 14:17:53 »

All my code for everything I've done recently is at:

http://www.cokeandcode.com/feck

I'd hardly call the RPG complete Wink but the networking model worked pretty well. I generally referred to it as distributed simulation - but thats just because of some old background Smiley

HTH

Kev

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.

Pippogeek (40 views)
2014-09-24 16:13:29

Pippogeek (31 views)
2014-09-24 16:12:22

Pippogeek (21 views)
2014-09-24 16:12:06

Grunnt (47 views)
2014-09-23 14:38:19

radar3301 (29 views)
2014-09-21 23:33:17

BurntPizza (65 views)
2014-09-21 02:42:18

BurntPizza (37 views)
2014-09-21 01:30:30

moogie (43 views)
2014-09-21 00:26:15

UprightPath (53 views)
2014-09-20 20:14:06

BurntPizza (55 views)
2014-09-19 03:14:18
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!