Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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  
  An old question? Where to calculation collision?  (Read 1529 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

« JGO Spiffy Duke »


Medals: 195
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2003-07-20 18:22:17 »

I'm working on a multiplayer asteroids style game, a demo is web startable from:

http://www.cokeandcode.com/astroprime

Currently each client maintains a picture of the arena they are playing in. Each client sends updates of their player N times a second (currently N = 10) to the server. The server then broadcasts the state of all the players to all the players M times a second (currently M = 10).

Although I'm going to add stuff about only sending updates based on changes but this currently seems to work fine for a small number of players just flying around.

I've just started implementing the ships shooting. My orignal idea was to let the status of the ships (e.g. is the fire button pressed) let each of the players know when shots should be produced. This would mean that although the shots wouldn't be perfectly synchonized, it would be [good enough (tm)].

Starting to think about collisions, where to perform the caculation and the assocaited health decrement?

I seem to have 3 options:

1) Maintain a full picture on the server. Every single shot that gets produced, is only produced on the server. All collision detection goes on there. This seems great from a consistancy point of view, but with the overhead of sending message for each shot (and possible maintaining movement?)

2) Each client produces shots for itself, only shots that hit the player on its host machine count. This means that only shots the player "sees" shots hit them actually do damage. Of course, nothing is consistant now. Also, how to handle non-player controled objects. [Also prone to cheats]

3) Some sort of halfway house, maybe players report what they see and server takes what most people "saw". Not quite sure about this, maybe some more refinement.

Currently my fave is number 2, since it fits with the way things currently work.

I'd really appreciate feedback/ideas/pointers..

Thanks,

Kev

Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #1 - Posted 2003-07-21 02:39:44 »

Other multiplayer games like Quake maintain shots (e.g. rockets) as separate objects on the server so the position of shots is updated by the server and broadcast to clients.  The server decides who gets hit.  

P.S.
Don't get me started on how client side prediction (needed for smooth internet play) ruins the game --you dodge a shot as far as your view is concerned but you got hit from the server point of view. (This is a separate issue from general network lag.)

Online Abuse

JGO Knight


Medals: 14


falling into the abyss of reality


« Reply #2 - Posted 2003-07-21 08:17:40 »

Quote
P.S.
Don't get me started on how client side prediction (needed for smooth internet play) ruins the game --you dodge a shot as far as your view is concerned but you got hit from the server point of view. (This is a separate issue from general network lag.)


thats where time nudge comes in Cheesy

Client side prediction x ms into the future, effectively negating ping latency.
Doesn't help with instant hit weapons; and projectile weapons fire will appear to instantly travel the 1st x ms of their flight from the originators gun.
Still, helps Q3 hpbs enormously.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
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.

xFryIx (57 views)
2014-11-13 12:34:49

digdugdiggy (35 views)
2014-11-12 21:11:50

digdugdiggy (29 views)
2014-11-12 21:10:15

digdugdiggy (23 views)
2014-11-12 21:09:33

kovacsa (46 views)
2014-11-07 19:57:14

TehJavaDev (50 views)
2014-11-03 22:04:50

BurntPizza (50 views)
2014-11-03 18:54:52

moogie (65 views)
2014-11-03 06:22:04

CopyableCougar4 (63 views)
2014-11-01 23:36:41

DarkCart (149 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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