What is a MUD?

For years I've wondered, programatically, what a MUD is.

It's like a program constantly waiting for your input, and when that input is finally given -- it compares it with a list of possible commands and, if that command is found, execute it.

And Rooms -- They contain descriptions and possible exits; I'm assuming they're objects with data members for descriptions and exits.

Is the MUD world just an array of these room objects?

And how does the player factor into the game?

Really, I'm just looking for a vague description of the implementation of a MUD world and the player within it.

The way I implemented my MUD was to have basically a list of a bunch of "rooms", classes with a title, long description, etc, with exits stored as a number. Each room had an assigned number that I used to refer to it.

Players internally had a number that determined the room they were located in, and attempts to move checked their current rooms exits.

I had a main thread that would loop through all players logged into the game and would execute one command string off their command queue. There were separate threads for each player that read in input from their socket and placed it into the command queue.

This isn't to say this is the best way of doing it, but I had this system work for my testing purposes.
Topic archived. No new replies allowed.