Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
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  
  Game Server  (Read 3267 times)
0 Members and 1 Guest are viewing this topic.
Offline Sueamanu

Senior Newbie





« Posted 2009-10-22 13:51:04 »

Hello, i have simple 2D game client.
Screenshot client:
And player can move with keys ( Up,Down,Left,Right but player is without animation. ), "player" is image.
Im searching tutorials and examples how to create simple Game Servers/Sockets maybe any know ?
My target is 2D multiplayer online client Smiley Something like:
Offline SimonH
« Reply #1 - Posted 2009-10-22 14:11:01 »

This any help?

People make games and games make people
Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #2 - Posted 2009-10-22 15:32:35 »

SimonH's link has some interesting links on approaches to keeping clients in sync. For the actual network communication itself you might want to look at these (Mina is a bit low level):
http://www.java-gaming.org/topics/pyronet-lowlevel-nio-wrapper/20647/view.html
http://www.java-gaming.org/topics/kryonet-tcp-and-udp-client-server-nio-library/21299/view.html

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

Senior Member


Medals: 1
Projects: 1


Co-op Freak


« Reply #3 - Posted 2009-10-27 07:45:18 »

Word of warning: making a multiplayer online game is Lots Of Work. lots and lots and lots and lots.

Problems i see right now in the area: you need a lot of html, php/jsp, database infrastructure to
handle logins, unique users etc... A small multiplayer world is possible to build alone,
but getting users is hard for a little project. And if the game doesnt work without lots of users,
you may as well just made it singleplayer or LAN/online support like Diablo started off with.
You could play with groups of friends in the same room, or over a dedicated server anybody could set up.
This is the mode I would most strongly support for startup mode.
I might stick to making a few smaller projects
before tackling the mmorpuger. That said, go for it Smiley

EDIT pessimistic, no , realistic, yes... we visioned a simple asynchronous (non-live-sync) multiplayer system for mobiles would take a year, it took two years, full-time work...
But hey, i don't wanna rain on anybodys parade, gotta learn the hard way anyhow

Offline h3ckboy

JGO Coder


Medals: 5



« Reply #4 - Posted 2009-10-27 13:58:11 »

man youa re pessimistic, how doy ou know he isnt a experienced programmer and jsut hasnt used networking.

he also said that he is targetting a simple thing, such as 2 ppl walking around on a screen....
Offline karmaGfa

Junior Member




Miaow


« Reply #5 - Posted 2009-10-31 19:16:08 »

pessimistic, no , realistic, yes... we visioned a simple asynchronous (non-live-sync) multiplayer system for mobiles would take a year, it took two years, full-time work...

It doesn't take everybody so long to make it. With the right tools and a basic experience of asynchronous communication, it could take a week to write the network part of a simple game.

For the sample that heckboy wants to implement, it could take 1 hour to me.
I am using Jnag & Darkstar, this helps.

<a href="http://www.le-moulin-studio.com">Le Moulin Studio</a> - MMO Technologies and Services.
Offline Sueamanu

Senior Newbie





« Reply #6 - Posted 2009-11-12 16:35:35 »

Ok. Thanks for replys!  Wink
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #7 - Posted 2009-11-12 17:05:39 »

umm, just so you know I have am already well underway a large multiplayer project.... And I havent had any dificulties so far.

but.... I wasnt refering to me in any way during that post Tongue.

And for the record, I am pretty sure he is done with that simple program of his by now.

and here is a nice tutorial for simple game:

http://www.corvstudios.com/tutorials/udpMultiplayer.php

hope I could help Smiley

EDIT: never mind jsut found otu that you are already using this tutorial lol Tongue
Offline Karmington

Senior Member


Medals: 1
Projects: 1


Co-op Freak


« Reply #8 - Posted 2009-11-12 17:16:06 »

karmaGfa: To make a small part of a complex system, sure it's less. but I meant the whole game in total took two years.

Offline williamwoles

Senior Newbie





« Reply #9 - Posted 2009-11-17 12:15:44 »

In this case it's not very hard to do. Follow the steps:
1) Think on how you are going to store characters on server, to maintain them synchronized.
2) Implement Structure where you are going to store characters
3) Follow some simple tutorial about TCP(skip this step if you are familiar with TCP)
4) On client method, implement functions to send/recieve messages from server(message reciever must be in another thread, because while recieving messages, client can block the interface)
5) Create some xml sample for your communication or just create your protocol
6) Add key listener
6.1) Process key event
6.2) Create message to send to server
7) Create server, which listens on some port and creates a thread per connection
Cool Put your implemented structure in 2) in static class(with private constructor), with synchronized setters, getters and another methods(this will permit every access at any time from any class to updated data)
9) Implement packet parser, which is going to translate packet in values and store them in class implemented on Cool
10) When recieved a packet, after it's stored on class Cool imlement another xml or your own protocol, to send to other clients update of client position
11) After packet created send it to all existing connections(for example)
12) On client side handle the packet and move the character to needed position

This is not that hard to implement what you need.. You just need to understand well how TCP works.(belive me things are getting much harder when you include anti-cheating, more protections, more calculus, trying to take of some load of server computation, having more functionalities)
If you need more help let me know.
~ww~

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

Senior Newbie





« Reply #10 - Posted 2010-03-08 19:55:26 »

williamwoles, very good description, thx!

First of all i'm completely noob to networking. I'm planing create multiplayer shooter game for my experience only.

Is there are any engine that could handle all of that networking (preferably UDP)?
Ideally i want to have method at client sendDataToServer(String message) and method on server sendDataToClient(int clientID, String message) and it takes 50-100ms to deliver message. Is that even possible?

Offline Nate

JGO Kernel


Medals: 147
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #11 - Posted 2010-03-09 00:24:17 »

Is there are any engine that could handle all of that networking (preferably UDP)?
Check the links in this thread.

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.

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

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

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

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

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

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (103 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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!