Hello Guest

Multi-user

  • 4 Replies
  • 19985 Views
Multi-user
« on: February 01, 2005, 14:50:06 »
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

*

Offline princec

  • *****
  • 1933
    • Puppygames
Multi-user
« Reply #1 on: February 01, 2005, 16:02:45 »
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 :)

Multi-user
« Reply #2 on: February 01, 2005, 20:17:53 »
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]

*

Offline princec

  • *****
  • 1933
    • Puppygames
Multi-user
« Reply #3 on: February 02, 2005, 10:44:10 »
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 :)

Multi-user
« Reply #4 on: February 02, 2005, 11:00:46 »
Thanks for the advise. I will investigate futher... now I know a little more where to look.

Anders