Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (499)
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  
  Synchronizing online games  (Read 1620 times)
0 Members and 1 Guest are viewing this topic.
Offline nickdotjava

Junior Member




I have fallen to the dark side.  I'm using DX9


« Posted 2003-05-27 18:18:40 »

I'm writing a server for an on-line rts game and trying to decide how to make sure all players see the same thing.  Originally, the server was just going to pass commands along to all players, but would all players see the same thing at the same time (eg if player A gives a move order at 5:32, will all players see it at 5:32, or will some see it at 5:33 or later)?  One reason for the game logic to be run on the user is that there will be single player, lan capabilities, and direct ip connections.

-Nick

"Oh ya, that's trivial.  I should have it done in an hour."
Offline elias

Senior Member





« Reply #1 - Posted 2003-05-27 18:51:22 »

http://www.gamasutra.com/features/20010322/terrano_01.htm

is the article I'm particularly interested in when the time comes for me to implement networking. It uses the idea of a totally synchronized game by letting player commands lag a few game turns, depending on connection.

- elias

Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #2 - Posted 2003-05-28 07:45:55 »

Typical RTS setups work completely synchronous. Game commences when every msg is processed.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2003-06-25 00:06:22 »

The problem with frame by frame synchronization is that, done naively, everyones response is equal to that of the worst player and it can vary a lot.

Some lessons we learned when getting Duke Nukem 3D to play well over the internet might be helpful.

(1) Get your data rate down. Dont synchronize every frame but rather every N frames.  In an RTS you coudl for instance have a "command beat" thats much lower then (and decoupeld from) your frame rate.

(2) Packet aggregate at the server if you have one.  You'll generally get better performane characteristics by collecting all the frames at your server, building one "turn" packet and sending it out to everyone rather then sending individual moves through the server to everyone.

(3) You *might* want to consider loosening up the synchronization and going with a tiem based scheme for commands and corrections.  Looked at this way the RTS problem really isnt different from any other dead-reckoning situation except that your controls are actually looser and thus differences are easier to hide...




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
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.

xsi3rr4x (44 views)
2014-04-15 18:08:23

BurntPizza (40 views)
2014-04-15 03:46:01

UprightPath (56 views)
2014-04-14 17:39:50

UprightPath (38 views)
2014-04-14 17:35:47

Porlus (54 views)
2014-04-14 15:48:38

tom_mai78101 (77 views)
2014-04-10 04:04:31

BurntPizza (136 views)
2014-04-08 23:06:04

tom_mai78101 (236 views)
2014-04-05 13:34:39

trollwarrior1 (197 views)
2014-04-04 12:06:45

CJLetsGame (205 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!