Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (582)
games submitted by our members
Games in WIP (503)
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  
  network apis for mmorpg  (Read 1659 times)
0 Members and 1 Guest are viewing this topic.
Offline newbie

Innocent Bystander




Java games rock!


« Posted 2003-10-13 07:34:39 »

I'm trying to make a mmorpg that can be played on the internet which can send data at least 10 times per second, allowing multiple local and global chat sessions going on at the same time, and storing character names, states, interactions with terrains/players, etc.  

As I'm concerned with the networking part of this program, I want to know whether OpenJMS is a good choice for this and if so, why.   There aren't much sources for this api, so if links for any good tutorials can be provided, I'd be very much appreciated.  

Also, is java.net.* sun api a good alternative?   Right now I'm considering using this package since I so far can't find good tutorials for OpenJMS and for this being time critical (I also have to implement this on my own so I really have to understand what's going on).   I also want to know if this api would satisfy the above requirements.  

As I am pretty much new to network programming, any useful information is greatly appreciated.  
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2003-10-13 07:53:20 »

You're new to network programming and you decided to start on a MMORPG?!?!?!?

Is this a academic project by any chance?

Kev

Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #2 - Posted 2003-10-13 08:05:55 »

Ok, MMORPG is a bad choice for your first network code, something with say 8 players would be better. For 8 players 10 updates a second is fine, and you don't have to worry too much about your bandwidth usage. MMORPG on the other hand will probably need less than 10 updates a second (based on the number of objects moving in that time), also, you need to be really anal about performance and bandwidth. The world you are representing makes a huge difference on the number of updates you can afford to, as does the desired end user connection, are you aiming to support modem users or BB only?, is it a flying (space or otherwise) game, if so, you need lots more info, is it a ground based type game (or planet based, where you only need an x,y and an angle to define the players location), if so, you can afford to send more updates as you need much less information to work out where anything is.
 For MMORPG you really need to look at using nio, especially server side, also, for character/ship/whatever movement, you might want to consider UDP rather than TCP, and ignore out of sequence packets, this will result in some jumping on slower connections, but will be better than TCP (player movement can be dropped as you will be updating it next time so you don't *need* guarunteed connection, but latency is an issue)(see the nice long thread about UDP v.s. TCP) , other comms should be tcp.

Thats a very brief overview of the nightmare that is MMORPG network issues.

Enjoy

Endolf

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

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2003-10-13 09:48:01 »

Quote
Ok, MMORPG is a bad choice for your first network code, something with say 8 players would be better.


Indeed. Some pro games companies have put non-network specialists to work on producing MMOG's internally, and this accounts for a large number of those that were announced and never appeared. It's not simply hard, it's also unlikely you will ever complete it if you don't really know what you are doing when you start - or have a LOT of time / money / patience to get it wrong lots of times.

Quote
is it a flying (space or otherwise) game, if so, you need lots more info, is it a ground based type game (or planet based, where you only need an x,y and an angle to define the players location), if so, you can afford to send more updates as you need much less information to work out where anything is.


Incidentally, flying is the easiest to write, ground-based is kind of in the middle, and space is extremely difficult (assuming *real* space physics - i.e. no friction etc). Of course, if you choose to make space flight just like flying a plane, it becomes easy too - probably the easiest of the lot when you come to load sharing. Looks stupid though Smiley.

Quote

(see the nice long thread about UDP v.s. TCP) , other comms should be tcp.


You should *definitely* read that UDP thread.

For an intro to NIO, have a look at:

http://www.grexengine.com/sections/people/adam/nio/Introduction_to_NIO_Networking.html

(nb: those articles are not complete yet, although I've had a couple of reports of people managing to fix their NIO problems after reading them, so they're not too bad Wink)

malloc will be first against the wall when the revolution comes...
Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #4 - Posted 2003-10-13 11:51:33 »

Quote

Incidentally, flying is the easiest to write, ground-based is kind of in the middle, and space is extremely difficult (assuming *real* space physics - i.e. no friction etc). Of course, if you choose to make space flight just like flying a plane, it becomes easy too - probably the easiest of the lot when you come to load sharing. Looks stupid though Smiley.


Hmm, I think we might be talking cross purposes here, when you say easiest, which aspect are you talking about, I was talking in terms of the amount of data you have to shift, ie, ground based, map area, x, y, a bearing and maybe the angle looking up/down. Flying, map area maybe, x,y, altitude and then roll,  pitch,  yaw. Space, (non realistic) sector, x,y,z, pitch, roll, yaw. Of course, pitch, roll and yaw are no good as you can end up in gimble lock (I think thats what they call it), which is where your good old 4x4 matricies come from, which means more data across the link. Of course that is only a small problem, the biggest problem is keeping other players in sync with each other and the server, and keeping the server in sync with each client. This is where the nightmare begins. RTS and some RPGs (like the diablo and Baldurs gate) are simple (client issues command, server performs it), anything that requires constant input (mouse look or joystick) is ticky. So i can't see how flying or unrealistc space based games are the easiest. Of course even if you have friction in space, you have the extra axis of translation that a plane doesn't allow, which just adds to the fun Smiley (especially when it cones to trying interpolation)

(Agree with everything else you said, which makes a change Tongue)

Endolf

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #5 - Posted 2003-10-13 13:08:48 »

Quote


Hmm, I think we might be talking cross purposes here,


I don't think so...

Quote

I was talking in terms of the amount of data you have to shift, ie,
...
Of course that is only a small problem, the biggest problem is keeping other players in sync with each other and the server, and keeping the server in sync with each client. This is where the nightmare begins.


Exactly. With flying, your position cannot undergo abrupt changes. Hence, maintaining distributed state (distributed across all the clients  that can "see" a relevant body) and all the servers (depending upon presence/abscence of clustering)) is easier. As you point out, maintaining this state is the hardest problem in the shifting of data.

Flying also reduces to the smallest amount of data transferred, on average. This is because the the number of bytes to store current position etc are irrelevant when it comes to amount of data to update postitions - what matters is how much data you will send post-compression / optimizations. With non-abrupt changes, you can compress very well (assuming the server knows what dead-reckoning system(s) the client is using, and so only needs to send out data to "correct" the predictions the client is making when the server KNOWS that that prediction will be wrong).

In space...more abrupt changes are the norm.

malloc will be first against the wall when the revolution comes...
Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #6 - Posted 2003-10-13 13:50:02 »

Hmm
 I'm not sure, if you update every visible object say twice a second, you will almost certainly have some degree of error (unless they were flying in straight line, not likely in say a WWII dog fighting game), so you will need to send a correction, in this case I can't see how you can reduce a 4x4 matrix into anything less than 3 flaots for x,y,z and an AxisAngle, which gives 7 floats, which is exactly the same as for space. The velocities arn't different either, in flying you need slip, rate of climb, and forward velocity, which are the same as you would need in space, giving a total of 10 floats. You prorably need a rate of roll/pitch/yaw too, adding a further 3 floats (otherwise your prediction for the next cycle will be even worse), so thats 13 flaots for flying or space. The prediction methods vary, but as long as the client and server are using the same method they have almost no effect, as anyone doing any prediction will be incorrect compared to the authority (the client probably).
 Ground based (walking in this assumption) is not quite as bad, needing x,y, maybe a z depending on wether you are allowed in multi-storey buildings, a direction you are looking in (rotation and elevation), plus some flags for walking sideways, walking forwards/backwards, and running forwards/backwards forwards, which is 6 floats plus a short or something for the flags. I can't see how, knowing that things need updating, you can possibly shift less than this amount of data, per update.
 I'd like to know, i'd love to have 100+ ships in a fight even for modem users Smiley

Endolf

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.

xsi3rr4x (72 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (79 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (80 views)
2014-04-14 15:48:38

tom_mai78101 (104 views)
2014-04-10 04:04:31

BurntPizza (164 views)
2014-04-08 23:06:04

tom_mai78101 (260 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!