Monday, January 17, 2005

MUD Update

This posts's at the geeky end of the spectrum, so you may wish to skip it. The MUD (see previous post) continues to plod along, if that's the right metaphor, but has got stuck (that's more appropriate).

Since it's a Java-based look-and-feel approximation to MUDOS, a famous MUD operating system, I've tried to use a lot of the MUDOS methods in it. One of these tricks is at login time the code for handling and creating the input and output streams which the game uses to chat to a player is built into each player object, so when somebody logs on, how do you chat to them before you've set up their player character? The answer is to have a dummy player which sets up I/O and gets the login details. A real player object is then set up for the player, and the dummy player is frozen, has its I/O taken over by the real player, and is then destroyed. Sounds very nasty.

What happens in practice is that the dummy player doesn't destroy itself when it should, and persists for one round, messing up the I/O. I thought I'd solved this one, but it's back. It seems to be waiting to destroy itself until it gets another round of keyboard input, which suggest two problems to me:
Either

  1. it's hanging until it gets keyboard input
  2. the fact that every object in the game has its own thread of control means that it's blocking until some other object does something.

Well, we'll see. Writing that down may have clarified my thoughts a little, and if and when the game ever gets into beta testing mode, I'll publish login details and you can all play (assuming you want to).

Now that's off my chest, the next post may be a litle less techie. I should actually be doing something else rather than blogging, so I'd better listen to my conscience and do it. Bye.

No comments: