Results 1 to 9 of 9

Thread: Developing MUD

  1. #1
    Eleeist is offline Member
    Join Date
    May 2011
    Posts
    84
    Rep Power
    0

    Default Developing MUD

    Hi,

    I am preparing to develop a text based multiplayer game (ie MUD) to aid my learning. I would like to focus on server side programming for now. However before I jump into it I would like to ask a few questions.

    How does the networking works/looks like in Java? I am planning to connect to the server with telnet or some specialised MUD client, but I assume their basic principle is the same. Any articles worth reading?

    The main problem that is bothering me is world map. The world will consist if many "rooms". The character will be able to move from one room to the next using directions such as: north, south, west, east, up, down etc. The only thing that comes to my mind is nested conditionals, which of course is not a good idea at all: what if a player would like to get back to previous room? So how do you suggest I could approach this problem?

    Hmm.. are there any other tips you could give me?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Developing MUD

    For networking you can use the Socket and ServerSocket classes
    get back to previous room
    That sounds like a Stack could be useful

  3. #3
    Eleeist is offline Member
    Join Date
    May 2011
    Posts
    84
    Rep Power
    0

    Default Re: Developing MUD

    Thanks. And what would you recommend for "connecting" the rooms? By that I mean that there should be some kind of a map with coordinates, so that the server will be able to keep track of where each player is located.

    I am thinking about a board, like the chess one. Is this a good idea? How would I go about creating one without the graphics (the board will not be visible to the user, just to the system to have some reference)?

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Developing MUD

    You could connect rooms by references. Say there are 4 connected rooms: N,S,E,W
    Then have 4 Room references for each room:
    Room roomToNorth, etc

  5. #5
    Eleeist is offline Member
    Join Date
    May 2011
    Posts
    84
    Rep Power
    0

    Default Re: Developing MUD

    But wouldn't it become messy if I've got like 100 rooms? I understand that for a simple game, like the one I am developing, this should be sufficient enough and I will use it, but are there any more sophisticated methods?

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Developing MUD

    Not sure what you mean by "sophisticated".
    If each room has some next rooms, then that room would be responsible for remembering what those next rooms are.
    One pass over the layout of the rooms could set all the next room relationships.
    Another way to do it would be to do the search for next rooms every time that you need a next room. That would mean a lot more processing time every time you wanted the next room.

    If the "rooms" are simply squares in a grid of rows and columns, then a next room would be a simple change to the row number or the column number.

  7. #7
    Eleeist is offline Member
    Join Date
    May 2011
    Posts
    84
    Rep Power
    0

    Default Re: Developing MUD

    If the "rooms" are simply squares in a grid of rows and columns, then a next room would be a simple change to the row number or the column number.
    Moving from room to room does not seem like a problem. But how do I create that grid of rooms?

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Developing MUD

    If the rooms are only "logical" then assign sets of x,y values for the boundaries between them, like drawing the grid lines on a piece of paper and writing a number in the center of each square.

  9. #9
    Eleeist is offline Member
    Join Date
    May 2011
    Posts
    84
    Rep Power
    0

Similar Threads

  1. Developing in Java...
    By Artel in forum New To Java
    Replies: 1
    Last Post: 05-02-2011, 03:28 AM
  2. Developing a Listener
    By lostmind in forum Advanced Java
    Replies: 19
    Last Post: 12-24-2010, 09:07 PM
  3. possible for developing ops by swing
    By karthi66 in forum AWT / Swing
    Replies: 3
    Last Post: 08-07-2010, 05:42 AM
  4. developing a GUI for solaris 10
    By DuceDuceExplorer in forum NetBeans
    Replies: 5
    Last Post: 08-05-2008, 06:00 AM
  5. Developing for Mac
    By jmds in forum NetBeans
    Replies: 0
    Last Post: 11-25-2007, 07:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •