Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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 1453 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?

Thanks,
roland
Offline ra4king

JGO Kernel


Medals: 347
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  
 
 
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.

Pippogeek (35 views)
2014-09-24 16:13:29

Pippogeek (28 views)
2014-09-24 16:12:22

Pippogeek (17 views)
2014-09-24 16:12:06

Grunnt (40 views)
2014-09-23 14:38:19

radar3301 (23 views)
2014-09-21 23:33:17

BurntPizza (59 views)
2014-09-21 02:42:18

BurntPizza (29 views)
2014-09-21 01:30:30

moogie (34 views)
2014-09-21 00:26:15

UprightPath (47 views)
2014-09-20 20:14:06

BurntPizza (51 views)
2014-09-19 03:14:18
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59: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!