🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

multiplayer programming in java

Started by
9 comments, last by thepixlyzdpitbull 23 years, 3 months ago
hi, i''m making an FPS in java, and need some help on the multiplayer programming. anyone know where i can get some tutorials?
------------------You will be told only what you need to know. Reading it backwards will not help you. YOU CANNOT DECIPHER THE CODE.
Advertisement
Well, for some basic information, check out the networking tutorial on sun''s site - I think, if I remember correctly, that it build some kind of chat server (both client and server side).

As for more specific tutorials, I haven''t seen any.


cheers,

Jens
// Jens
ad
Maybe this sounds a bit dumb, but isn''t Java much too slow for a FPS? Well, I would use VC++ or Delphi, but not Java!
Yesterday we still stood at the verge of the abyss,today we're a step onward! Don't klick me!!!
i expected that. have you ever used WildTangent? it''s an SDK + plug-in used to build java applet games. most of the games made by WildTangent are pretty fast and are in 3D. check it out: http://www.wildtangent.com
------------------You will be told only what you need to know. Reading it backwards will not help you. YOU CANNOT DECIPHER THE CODE.
I think the biggest problem would be if you wanted to write the server code in Java and host it on a Windows box. The way socket communications work is for every connection it spawns a thread. Problem being that the Windows runtime (from what I understand) has never been very good at multithreading Java, performance-wise. I can see a MMORPG server in Java keeling over from the load, with a thread per player. One of my great complaints about the Java lib are the this-way-or-no-way design of the socket model. Perhaps I''ve just gotten spoiled by IOCP.
quote: Original post by Kensai

I think the biggest problem would be if you wanted to write the server code in Java and host it on a Windows box. The way socket communications work is for every connection it spawns a thread. Problem being that the Windows runtime (from what I understand) has never been very good at multithreading Java, performance-wise. I can see a MMORPG server in Java keeling over from the load, with a thread per player. One of my great complaints about the Java lib are the this-way-or-no-way design of the socket model. Perhaps I''ve just gotten spoiled by IOCP.


Not necessarily, although it depends on which JVM you''re running on.. I''ve seen a web server written entirely in Java handle peak rates of up to a couple of hundred transactions a second.. I''m not sure how it''d handle several thousand threads at one time, but again it does depend on the VM being used.. The VolanoMark report details the performance of various JVMs in a server app running many simultaneous threads... It''d be interesting to see, in any case



----------------------------------------
Damian.
Email: damian@returnity.com
Web: www.gamedevcentral.com
----------------------------------------Damian.Email: damian@returnity.comWeb: www.gamedevcentral.com
Online Java games aren''t that slow with a decent connection. Check out RuneScape at www.runescape.com, I believe it''s a Java game and usually has between 200 and 600 people on it at the same time. I only get about 4fps with a 56k connection but I tried it with a partial T1 and got over 12 fps which wasn''t that bad at all. It''s free to play too if you aren''t sure about using Java yet. So you could test it out. Don''t know if this helps any.
You are aware that Java applets can only phone home right? I mean you can''t do the basic TCP/IP connection where one player is a host and the others clients. You will have to send all information through your server. It''s an annoying security feature. Does anybody know any other ways around this besides having your server reroute everything (and thus slowing down everything).

Abs

p.s. Check out some Java games I made here .
When I saw the name of this thread I was going to shamelessly plug WildTangent, but I see someone else beat me to it.

The WildTangent multiplayer API will be out "soon".

This topic is closed to new replies.

Advertisement