Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
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  
  Best way to go about networking  (Read 2605 times)
0 Members and 1 Guest are viewing this topic.
Offline roland
« Posted 2011-09-17 01:12:10 »

Hi, I am aiming for my next game to be a proper multiplayer online game.
I have used sockets before and understand how they work, but I am not sure about the best way to build my game.

Should I build both server and client at the same time, whenever I change something in the client make sure it works in the server? or can I implement the networking after I have the game running in single player?

I don't especially want to duplicate lots of code from my client and stick it in my server. Is there a way to make the client do most of the game processing, and the server just relay messages, adding and kicking players, and handle important variables like damage etc so it isn't as easily hacked?

Offline ra4king

JGO Kernel

Medals: 508
Projects: 3
Exp: 5 years

I'm the King!

« Reply #1 - Posted 2011-09-17 01:49:49 »

To prevent hacking and modifications of the game, it is a usual design to have the server do all the work and the clients be the graphical front-end of all the relayed data from the server.

EDIT: Have you looked into KryoNet? It is a very solid networking library that does all the low-level socket legwork for you.

Offline roland
« Reply #2 - Posted 2011-09-18 04:59:42 »

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

Innocent Bystander

« Reply #3 - Posted 2011-09-24 00:57:47 »

If you are planning to create a large online game that many people will play at the same time, you can avoid having a server do all the work by distributing the work across the network of users. As for hacking, you could have the game scan a nearby user's output for discrepancies and send out a message for other connected copies of the game to check it. Then if it is found to be strange, have that user booted out of the network.
Pages: [1]
  ignore  |  Print  

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

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

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

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

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (863 views)
2018-03-24 14:47:39

ivj94 (124 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!