Anyone have any good resources for networking with JAVA?

want to get started learning networking for my MORPG, and I am looking for some good resources to help me on my way.

been looking on google myself, but most of the pages i am linked to are pretty much full of people putting each other down, and hardly any actual information. (will still keep looking anyway :P)

So I am hoping someone here might have something i can use, like a page they have bookmarked or something. Doesn’t matter how small or big, all information helps.

It needs to be said that an MORPG is a huge undertaking on its own… but especially so if you’ve never done any networking before. I recommend trying some simpler networking projects first. Even for a simple game, adding multiplayer increases the complexity by 100x at least. It’s the heart and soul of an MORPG and so it’s important to get it right. Lots of hard concepts to consider.

All that being said, JME has a networking API called SpiderMonkey that you can look at. There are some tutorials on here and there are the TestChatClient and TestChatServer in the JME tests that can show the basics of how this API works.

I plan to be working on the project for a long time, and most of my interest is in getting the multiplayer aspects to work. :stuck_out_tongue:

that said my networking will probably start out pretty simple at first, mostly focusing on getting two players to show up on the screen at the same time, then I will expand it into tracking each of the players and translating them correctly on the client.

Best way for me to learn is by doing, so i would prefer to keep working on this, even though it is usually better to start off on something simpler.

Thanks for the info about the API, I will probably check it out after I log my progress.

EDIT: also i did do some networking years ago :stuck_out_tongue: but that wasn’t really in a language, just general stuff

Learning networking by trying to write a MORPG is like teaching yourself to swim by setting yourself on fire :slight_smile:
Apart from SpiderMonkey you might look at KryoNet GitHub - EsotericSoftware/kryonet: TCP/UDP client/server library for Java, based on Kryo

lol well i learnt to swim by drowning :stuck_out_tongue:

thanks for the resource, ill take both of those into consideration while researching and practicing.

also, although the end game goal is MORPG, right now the goal is more to get basic client to server connections working, than improving it from there, I have no doubt it will start of pretty unstable and unreliable, but as i gain more experience I will improve it.

got to start somewhere i guess.

@yurikoma The correct way to do this is to make a game and after several years of experience, make another game with online functionality. I don’t want to be discouraging but, people here are not kidding when they say MORPG is almost impossible to do even if you have experience.

I hope you plan 5+ years for it in then.

I have planned for as long as it takes really :stuck_out_tongue:

Also I don’t see how making a game without online functionality would help, because i will still be stuck in the same situation I am now when i do decide to make the one with online functionality. Seems to me it would be best to learn what i need to know when i need to know it, than work on it and play around with it from there. Correct me if I’m wrong.

@yurikoma said: I have planned for as long as it takes really :P

Also I don’t see how making a game without online functionality would help, because i will still be stuck in the same situation I am now when i do decide to make the one with online functionality. Seems to me it would be best to learn what i need to know when i need to know it, than work on it and play around with it from there. Correct me if I’m wrong.

Well, if you’ve never made a complete game before…

Making a game is like learning to shave with a straight razor.

Networking is like learning to ride a bike with no hands while standing on the seat.

I would never attempt to learn both of those things at the same time.

If you’ve never made a complete game then you have probably few ideas on how to structure it properly, how to scale up systems as your feature list grows, how to implement a proper game loop, use app states/controls/whatever. Trying to thread networking through that will lead to something you will have to throw away and start over completely. Maybe even a few times.

On the other hand, if you start making a single player game and then iterate on it a few times to isolate the game logic from the presentation space then you might start to clearly see where networking can fit in. Then you do a couple simple networking experiments to verify assumptions about how all of that works and nice ways to separate concerns. At that point, you have the skills needed to put it all together. You will also better understanding where the existing networking APIs fit in and how best to utilize them.

If you’ve written a complete game before then the above has less bite.

We aren’t trying to discourage you from writing your dream game. On the contrary, we are trying to encourage you by keeping you from giving up in 6 months because it’s “too hard”… which was really only because you picked the absolute hardest path to your goal. Seriously, there are few programming problems today as generally hard as writing a networked game… especially an RPG.