Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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  
  gameserver standalone or merged?  (Read 2808 times)
0 Members and 1 Guest are viewing this topic.
Offline bitshit

Junior Member




Java games rock!!


« Posted 2006-01-08 01:09:30 »

Im working on a networked version of a pong clone I wrote. Im thinking about how I can best design the server part. Basically I want a client/server model. The server would be in charge of shared objects like the ball and check for collisions, goals etc.
The client would also compute the ball pos using the same logic, but gets corrected by the server when they're out of sync.

Is it a good idea to make the server app standalone from the game? Or maybe integrate the server into the actual game classes itself? (so it'd also be easier to switch to a peer-to-peer model later? and it also makes sence as much of the gamelogic is shared).

I've started with a server app that is completely seperated from the game (which is an applet). The server application does basically the same things as the game but except the rendering/sound etc and is not an applet. But it doesn't feel right, i've got the same gamelogic at two places that way and other games seem to include the server in the game itself. How is this usually done in multiplayer games?

Thanks!

Martijn
Offline Jeff

JGO Coder




Got any cats?


« Reply #1 - Posted 2006-01-08 04:58:02 »

Depends.

On small group games where rondeyvous is over the net (eg Counterstrike, NWN) typically a light server process is started on the host and then al lthe clients symmetircally connect to it.

Logically, thats the easiest way to go because it makes the clients symmectrial.  Whether you make the server a seperate process or a trhead running in the same process as one of the games though is a trivial difference in Java.  (What I would *not* do is put it in your game loop, that forces an assymetry into the code.)

Keep in  mind though that Applets have pertty serious limits on opening server sockets.

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
Offline Aramaz

Junior Member




Java Games Rock!


« Reply #2 - Posted 2006-01-08 19:32:46 »

I'm working on a multiplayer space shooter with a kind of similar situation (see it in platform/action games, xtreme spacewar). I have one GamePhysics class that does all calculations... this class is used by both the server and the clients (so you don't need to write the code logic twice)... but the client physics gets corrected by the server...works good for me.

So the server is running in it's own process, and as Jeff says, all clients are symmetric. I worked on a networked fighting game once and did it with one of the players actually acting as server... was much more troublesome as I remember it (got alot of assymetry...), but that was years ago, and I lacked alot of network programming experience then...

Play XSW: www.xsw.se
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline bitshit

Junior Member




Java games rock!!


« Reply #3 - Posted 2006-01-08 23:02:18 »

Im not sure what you guys mean with the clients being symetrical, do you mean that all clients connect to the same server like this:

    SERVER
   /       |      \
  /        |       \
C        C       C

Instead of:

    C
  /    \
 C------C


And as for each player acting as a server, it would be the case with p2p? Maybe it a game that requires very quick responses from each player could benefit from this scenario?
Offline Jeff

JGO Coder




Got any cats?


« Reply #4 - Posted 2006-01-09 19:16:13 »

Im not sure what you guys mean with the clients being symetrical, do you mean that all clients connect to the same server like this:

    SERVER
   /       |      \
  /        |       \
C        C       C

This is a really a different issue. Here you are addressing a net topology,. The one you have above is called a star network.

Quote
Instead of:

    C
  /    \
 C------C

This is more like a token ring.

The third type is a "fully connected" network like this:

C  --- C     
|  \   / |
|   \ /  |
|   / \  |
| /    \ |
C-----C

Of these, a star network is the simplest, a fully connected network the most direct.
Most small group games use star networks.

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
Offline Mr_Light

Senior Member




shiny.


« Reply #5 - Posted 2006-01-09 21:00:36 »

Jeff I think it's more like there is no diference with only 3 nodes Wink (connectivity wise)

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Offline bitshit

Junior Member




Java games rock!!


« Reply #6 - Posted 2006-01-09 23:59:03 »

Ah yes with this topology:

    C
  /    \
 C------C

I was actually referring to the same thing as you drawn (a fully connected network, p2p). It might looked like token ring because I used only 3 clients in my example Smiley

But you wrote that hadn't anything todo with the symmetry you guys where talking about earlier... With asymmetry you meant a difference in the gameloop on different clients connected maybe (as there was some talk about integrating the server into the gameloop)?
Offline Jeff

JGO Coder




Got any cats?


« Reply #7 - Posted 2006-01-15 23:39:13 »

Jeff I think it's more like there is no diference with only 3 nodes Wink (connectivity wise)

Good point Cool

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
Offline Jeff

JGO Coder




Got any cats?


« Reply #8 - Posted 2006-01-15 23:41:44 »

ample Smiley

But you wrote that hadn't anything todo with the symmetry you guys where talking about earlier... With asymmetry you meant a difference in the gameloop on different clients connected maybe (as there was some talk about integrating the server into the gameloop)?

Right the symmetryI was referring to is that all clients execute the same code.

This can be true in any connection model, but it also can not be true if oen is still "playing host". 

It can even be true in a star model IF the host is written as running totally independant from the client code.

When it is destintly *not* true is if that hosting is mixed with the clien code.  Then one client ios doing soemthing different (clienting and hsoting) while the others are just hosting.

edit: er I meant "just clienting" ofcourse.

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
Offline pin_kushn

Senior Newbie




Java games rock!


« Reply #9 - Posted 2006-01-17 17:53:37 »

Right the symmetryI was referring to is that all clients execute the same code.

Can you clarify: do you mean "identical code"?  Or do you mean code is centrally located with some kind of remote method accessing?

josh
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #10 - Posted 2006-01-17 20:19:48 »

I mean that all clients are executing identical bits in an identical manner.

Where those bits come from is ANOTHER orthogonal issue.


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
Offline pin_kushn

Senior Newbie




Java games rock!


« Reply #11 - Posted 2006-01-18 22:15:38 »

I mean that all clients are executing identical bits in an identical manner.

Where those bits come from is ANOTHER orthogonal issue.



Thanks.  Any recommendations for a good tutorial on getting started with "real-time" small group networked games?
Offline Jeff

JGO Coder




Got any cats?


« Reply #12 - Posted 2006-01-28 21:19:22 »

Hmm.

There are various articles around about the bits and peices of networkinf for various types of games. It all tends to be game-type specific.  So if yo uare thinkign "FPS" for intance, there are some fairly standard techniques.  A racing game, contact sports game, or head to head fighting game are all more or less deemed difficult to impossible across the internet today due to critical timign issues but there are certainyl techniques used for local LAN netowrking.

In general its very very specific to both the game type and the networking environment.  I knwo of no one-good-source that lays it all out.  (Maybe someday I'll consider writing/editing such a book but not til Im past my current time crunches.)

Your best =bet in the meantime is to tell us ehre what type of game you want to try to build and we can direct you at specific techniques...

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.

pw (26 views)
2014-07-24 01:59:36

Riven (25 views)
2014-07-23 21:16:32

Riven (20 views)
2014-07-23 21:07:15

Riven (22 views)
2014-07-23 20:56:16

ctomni231 (51 views)
2014-07-18 06:55:21

Zero Volt (46 views)
2014-07-17 23:47:54

danieldean (37 views)
2014-07-17 23:41:23

MustardPeter (40 views)
2014-07-16 23:30:00

Cero (56 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!