Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
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  
  How to create smooth network for real time action game ?  (Read 3990 times)
0 Members and 1 Guest are viewing this topic.
Offline phu004

JGO Knight


Medals: 19
Projects: 10
Exp: 10 years


NoSuchPersonException


« Posted 2008-12-10 23:56:03 »

My previos attempt was to synchronize all the clients, so each client program won't progress to  the next game frame unless
they received a message from the server.  It worked in Lan computers, but it became unplayble when I tried with my firend overseas
(had about 5 frames per second).

I guess the synchroniztion method i used really sucked, but I can't think of any other way to do this. Anybody got better idea?
Offline CommanderKeith
« Reply #1 - Posted 2008-12-11 01:46:49 »

Hi,

I tried a different approach here which worked pretty well over the internet:

http://www.java-gaming.org/topics/multiplayer-top-down-view-shooter/18019/view.html

Also, search the posts of Kev Glass and his Mootox game which used a nifty approach to smooth network sync'ing. It's a pretty hard topic, by the way  Smiley

Keith

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #2 - Posted 2008-12-11 17:57:41 »

It also makes sense to put the client's actions into a list, so that whenever they try to do something their action gets added to this list, which gets sent to the server periodically. Because of the nature of lag spikes, the server will receive the list irregularly, and as a result must intelligently decide how many queued actions it should execute based upon how long the latest lag spike was, as well as the client's fps vs. the server's fps (if the client is going twice as fast, then only half of their movement should be considered by the server).

This approach is typically good for movement, whereas it might get hokey for bullet firing and the like. It is usually okay however if you restrict less common actions (like jumping, or bullets, or whatever) until the server has received the message and sent it back, and the lag won't seem too bad.

See my work:
OTC Software
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline phu004

JGO Knight


Medals: 19
Projects: 10
Exp: 10 years


NoSuchPersonException


« Reply #3 - Posted 2008-12-11 20:54:12 »

Hi Keith I looked at your post, and I didn't quite get the conept, it is indeed a complicated topic. However the game application looks awsome,
 I wonder if all the client are synchronized such that  they all see the same world in every game frame?


Offline CommanderKeith
« Reply #4 - Posted 2008-12-12 06:26:05 »

It also makes sense to put the client's actions into a list, so that whenever they try to do something their action gets added to this list, which gets sent to the server periodically.

Yeah I found that keeping an event list was a good idea too.

Hi Keith I looked at your post, and I didn't quite get the conept, it is indeed a complicated topic. However the game application looks awsome,
 I wonder if all the client are synchronized such that  they all see the same world in every game frame?

Thanks!
Unfortunately it's impossible to sync every client every frame when there's lag, that's what makes things so tricky

If you want to make an FPS, try searching the way quake does it, that seems to be a popular method. I've read how they do it a few times but it never stuck in my head. it's something about sending acknowledgements all the time and I believe they use UDP rather than TCP.

If you're interested in the way I've done my little game, i'd happily try and explain. One day I'd like to make a little simple example game out of that project.

Pages: [1]
  ignore  |  Print  
 
 

 
Riven (439 views)
2019-09-04 15:33:17

hadezbladez (5294 views)
2018-11-16 13:46:03

hadezbladez (2213 views)
2018-11-16 13:41:33

hadezbladez (5562 views)
2018-11-16 13:35:35

hadezbladez (1156 views)
2018-11-16 13:32:03

EgonOlsen (4592 views)
2018-06-10 19:43:48

EgonOlsen (5467 views)
2018-06-10 19:43:44

EgonOlsen (3127 views)
2018-06-10 19:43:20

DesertCoockie (4023 views)
2018-05-13 18:23:11

nelsongames (4740 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04: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!