Multi-user

Started by jam007, February 01, 2005, 14:50:06

Previous topic - Next topic

jam007

Hi

IÃ,´m making some progress in my game devevelopment and have started to think about the future...multiuser. The thing is i havenÃ,´t more than tried som basic network classes from the Java tutorial so far and are therefore more than a bit lost when it comes to designing this part.
Could anyone direct me to a source of info about the network part of a multiuser java game. Tutorials, examples and thoughts on the subject...
(IÃ,´v tried searching the web and javagaming.org without any great result,  IÃ,´v probably missed something...)
I would like to transfer some basic data like position between players.

Anders

PS It is (or will be) an open source Ice Boat game in 3D using LWJGL. I just moving to sourceforge.net

princec

It's pretty difficult stuff, networking is. Its fundamental design is radically different depending on:

  • The time nature of game (realtime, interactive, or fixed turn based)
  • Whether you need client-server architecture, peer-peer, hub-based
  • Whether it's 2, 20, 200, or 20000 players
amongst other things. So firstly ask yourself about those three questions.

Cas :)

jam007

thanks for the reply

1) realtime 3D
2) Im thinking of  having a server running that people can log on to to play having clients in the game.
3) 2-20 concurrent users would be a realistic guess.

IÃ,´v read about and tested som examples of Javas RMI, would that be useful? Having a List at the server and clients invoking a get and set methods to retrive and place current info.

Anders
[/quote]

princec

RMI is a very high latency, high level protocol, and it's totally unsuitable for realtime. For fixed turnbased games it'd be ideal, as these are very like the normal business software client/server model.

You could sensibly use RMI for your lobby server though to manage setting up games and logging in / out.

However your realtime protocol will have to be TCP/IP or UDP/IP sockets. With <20 clients you can probably get away with using normal sockets and IO, although you might want to investigate using the new javax.nio package for maximum performance.

Depending just how realtime you need the game, you might have to axe TCP/IP and go for UDP, which involves writing your own TCP-like protocol over UDP. It's not particularly hard but not particularly easy either.

Cas :)

jam007

Thanks for the advise. I will investigate futher... now I know a little more where to look.

Anders