Jump to content
  • Advertisement
Sign in to follow this  
Diggs

[java] Java multiplayer game

This topic is 4872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been programming in Java for a while now, but mostly applications and a few applets that are far from groundbreaking... My java skills over a network are, however, quite a bit under par. In my spare time I have been developing a sort of tradewars/ utopia/ earth2025... well really it's justa mixture of some of the best components of all the old style BBS door type games. When I look at Java games online, they seem to be more the action/arcade type. I was wondering if java is a viable option for this type of game. And if it is, (which I figure it should be) what direction I should be looking to transition between an application/applet to an online game.

Share this post


Link to post
Share on other sites
Advertisement
You can go one of 3 routes. Applet, application or web application.

If your game is turn based, then a web application would be a good choice. You don't have to write any network code for it and all your users will always be playing the latest version(User needs no downloads or patches).

Applications have a more robust interface, especially if your game is real time. You will have to write your own network code however.

Applets aren't a bad choice if you can stick to Java v1.1.7 or earlier. Most people on Windows machines can't be bothered to install a plugin for newer versions of Java. Plus with webstart, you can have a full blown application that is launched over the Net.

Share this post


Link to post
Share on other sites
Ya here is as great example of a purely java coded web mmorpg and comepletely free too! But there is a downside to making a java based game as ppl have done with this one. You can find the file store location of the client's class files then deobfuscate and decompile and make bots/other cheating programs for it.

Link is www.runescape.com

Share this post


Link to post
Share on other sites
Quote:
Original post by Tallshortkid
Ya here is as great example of a purely java coded web mmorpg and comepletely free too! But there is a downside to making a java based game as ppl have done with this one. You can find the file store location of the client's class files then deobfuscate and decompile and make bots/other cheating programs for it.

Link is www.runescape.com


Runescape is an Applet, not a web app. A web app is very secure.

Share this post


Link to post
Share on other sites
Quote:
Original post by Tallshortkid
O well would you have to upload the class files to run a web app anyways?


The class files reside only on the server. They generate HTML for the user to look at. The only interface the user sees is their browser and the web pages that the web app generates(HTML/javascript/CSS/...).

Share this post


Link to post
Share on other sites

With web apps, you can use Servlets that will process HTTP requests from clients (browsers). You can use this to maintain client state of several applets (the interface you may want to use) without exposing code.

If you plan to make a desktop app with Web start, I suggest you take a look at Java NIO, since it allows asynchronous IO - but only available in SDK 1.4 and beyond.

Share this post


Link to post
Share on other sites
If you're going for something along the lines of E2025 or Utopia, I'd recommend using Php instead. It's pretty similar to C++ and Java so if you're well versed with either, it should be easy enough to learn. Another idea to ponder is using a php game engine with an applet to support it with graphics/added user interaction. A good example of this would be Galactic Emperor over at Skotos.net.

I know that Java's more than capable of doing the same things, but the database interfaces in Php seem easier to me. Less code to get the same thing done, not to mention that php is pretty much made for use with mysql. Just my opinion anyway.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
OK but still has anyone here played runescape? Greatest game I have ever played that has beeen created using Java.

Share this post


Link to post
Share on other sites
Hi,

I haven't played runescape, but after searching for it I found out it is a MMO game. That's a good challenge to use java NIO with those games. I believe there is an article about it around here.

Another option to this kind of game is RMI, where you would create a Remote object (GameServer) to handle client state of several apps. In terms of performance, the above (NIO) is the best option, since it does asynchronous IO.

Hope it helps,
Son Of Cain

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!